SRAM memory is deleted when a software or watchdog reset occurs?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hello. Is SRAM memory deleted if software or watchdog reset occurs? I know that RAM memory is volatyle, and i am using PSoC5.

   

Here is the code i would use for testing if SRAM is deleted or not if reset occurs. I am wondering if it is ok. 

   

 

   

 

   

#include <device.h>

   

 

   

void main()

   

{

   

unsigned char *P = (unsigned char*)0x20000000;

   

unsigned char cnt = 0;

   

 

   

if(*P != 0xAA)

   

{

   

*P = 0xAA;

   

Pin1_Write(1); //led1 is on if SRAM is erased 

   

Pin2_Write(0);

   

}

   

else

   

{

   

Pin1_Write(0);

   

Pin2_Write(1); //led2 is on if SRAM is not erased

   

}

   

 

   

    for(;;)

   

    {

   

        cnt++;

   

CyDelay(1000);

   

if(cnt == 16) 

   

CY_SET_REG8(RESET_CR2, 1); //software reset 

   

    }

   

}

0 Likes
9 Replies