Low Power Mode StandBy at STM32L562 - SRAM2 Data retention cannot be disabled
Hello Community,
I am programming the STM32L562E-DK discovery board and working with the Standby low-power mode. In the data sheet there are 3 standby variations explained:
- Standby with Full SRAM2 data retention
- Standby with 4kB SRAM2 data retention
- Standby without any data retention (all SRAM1 and SRAM2 is lost)
I cannot reach the variations, where part of the SRAM2 or all SRAM2 data retention should be disabled.
Always after I wake up the processor from the standby mode the data in SRAM2 is still there. SRAM1 is lost (which is correct).
I have tried everything to activate the Standby mode without any data retention, but it doesnt work.
To put the processor in standby mode I use the following code:
__HAL_RCC_PWR_CLK_ENABLE();
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
if (__HAL_PWR_GET_FLAG(PWR_FLAG_WUF2) != RESET)/* Check and Clear the Wakeup flag */
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);
}
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_HIGH);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);
HAL_PWREx_EnableUltraLowPowerMode();
HAL_PWREx_DisableSRAM2ContentRetention();
HAL_PWR_EnterSTANDBYMode();I checked every important register, especially the PWR->CR3->RRS bits which determine SRAM2 data retention.
My code is pretty much based on the official standby mode example at https://github.com/STMicroelectronics/STM32CubeL5/blob/master/Projects/STM32L562E-DK/Examples/PWR/PWR_STANDBY/Src/main.c .
I don't know if I am missing an instruction or if there exists a hardware bug which leads to the disability to disable SRAM2.
If anyone can help I would very much appreciate it.
Thanks in advance.