The NOLOAD section variable initializes with garbage value on hard reset.
Hi ST team,
I want to define a new section in the ld script so I can use that for variables that have to keep their values in case of soft resets.
I have made some changes in the script as follows,
.noinit (NOLOAD):
{
. = ALIGN(4);
_noinit = .;
*(.noinit .noinit.*)
. = ALIGN(4) ;
_end_noinit = .;
} >RAM
I have also defined a variable of this kind in the following way,
uint32_t tempVar __attribute__ ((section(".noinit"))) = 0;
At every soft reset, the value of this variable is preserved. However, at every hard reset, the variable is initialized with some garbage value.
What am I missing here?
Thank you.
