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

Some questions about RAM non_init

Hello,

I want to use RAM to keep some data after a soft reset, so that I can find problems after reset.
And I also found some implementation methods, such as using .non_init section. I also achieved it, but I still have some doubts and hope to get answers.

https://devzone.nordicsemi.com/f/nordic-q-a/48919/ram-retention-settings-with-softdevice-enabled/194367#194367

1).  In the flash_placement.xml file, there is clearly a .non_init part, but it is not displayed during debugging. 


When I assign size to .non_init in the flash_placement.xml file or define variable in the code, I can see the non_init section during debugging. Why is this?

Fullscreen
1
static uint8_t data[16] __attribute__((section(".non_init")));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
or 
Fullscreen
1
<ProgramSection alignment="4" load="No" name=".non_init" size="16"/>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

2). What is the RAM that has not been allocated?

For example, the address 0x200046f7-0x20005800 in the figure. Is its value maintained, or is it used by the .stack section when the program is running?

Thanks & Regards

Gray