This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51 RAM retention after System Reset question.

Hello, I looked througth the devzone but didn't find direct answer. So created new one.

RM v3.0 states chapter 12.1.19 "Reset behavior" with table. However, it is not clear for me what crosses in table mean. In general, I want to use filled data array in RAM after calling NVIC_SystemReset(). I use softdevice and tried to do next:

uint32_t ramon_all= POWER_RAMON_ONRAM0_RAM0On  << POWER_RAMON_ONRAM0_Pos
                     | POWER_RAMON_ONRAM1_RAM1On  << POWER_RAMON_ONRAM1_Pos
                     | POWER_RAMON_OFFRAM0_RAM0On  << POWER_RAMON_OFFRAM0_Pos
                     | POWER_RAMON_OFFRAM1_RAM1On  << POWER_RAMON_OFFRAM1_Pos;
 static uint8_t myarray[64] __attribute__( ( section( "NoInit"), zero_init) ); //place it to NoInit section.
sd_softdevice_enable(...);
...
memset(myarray,0xA5,64);
...
uint32_t res=sd_power_ramon_set(ramon_all);  //check result
uint32_t ramon; 
res=sd_power_ramon_get(&ramon); //check result and value
sd_nvic_SystemReset();

After reset myarray filled with zeros.
The questions:

  1. Is RAM retention possible at system reset. If yes, how to make it possible or what is wrong in my code?

  2. What the link of NVIC_SystemReset(); in code with Table 12.1.19 "Reset behaviorchapter" in RM ? Does NVIC_SystemReset perform soft reset?

P.S. These threads helped me, but partially. Link , Link

Parents Reply Children
No Data
Related