2024-10-08 03:56 AM - edited 2024-10-08 03:59 AM
Hello,
I am trying to make a program in which the micro stm32u5 is stored in ram memory some data after activating the Sleep Mode.For this I have defined in the flash file the SRAM2 memory that is supposed to be in charge of this and I have saved it as noload so that it keeps its values:
SRAM2 (xrw) : ORIGIN = 0x20030000, LENGTH = 64K
.ram2 (NOLOAD):
{
_sram2 = ..;
*(.ram2*)
. = ALIGN(4);
_eram2 = ;
} >SRAM2
Once SRAM2 is defined, I have saved a structure in that section of srram2 memory:
NODEconf_TypeDef NODE_conf __attribute__((section(".ram2")));
When I run the code I can see in Memory that this structure is well stored in memory, but when I run the Standby Mode and it is awakened by the RTC alarm, all the parameters of the structure are erased.
void SLEEP_mode(void) { HAL_PWREx_EnableSRAM2ContentStandbyRetention(PWR_SRAM2_PAGE1_STANDBY); HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN7_HIGH_3); HAL_PWR_EnterSTANDBYMode(); }
Any help?
Solved! Go to Solution.
2024-10-09 01:29 AM
The problem was that I was using the stm32u5xx_hal_timebase_rtc_alarm_template.c library, and a part of the code triggered a forced reset of the memory.
2024-10-09 01:29 AM
The problem was that I was using the stm32u5xx_hal_timebase_rtc_alarm_template.c library, and a part of the code triggered a forced reset of the memory.