SRAM2 is only partially retained
Hello dear STM32-Community,
I'm using an STM32L4R and wanted to configure my data retention of SRAM2 for standbymode.
I did the following changes to the linker file:
/* Highest address of the user mode stack */
_estack = 0x10004000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x800; /* required amount of heap */
_Min_Stack_Size = 0x800; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
SRAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
}
[........]
.data :
{
. = ALIGN(8);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(8);
_edata = .; /* define a global symbol at data end */
} >SRAM2As seen on the screenshot the data is acutally saved in SRAM2 (0x10000000)
but except for counter, which is specifically initalized with
volatile uint32_t Counter __attribute__((section(".sram2")));
everything else is reset after restarting the programm. What am I doing wrong? Or do i have to manually enter every variable to sram2 myself?
Kind regards and thank you in advance
crackl1ng
