Skip to content

Commit 34f73c3

Browse files
FRASTMfpistm
authored andcommitted
stm32L4+ going to STOP2 lowpower mode must keep SRAM3
The low power DEEP_SLEEP mode corresponds to STOP2 low power mode for the stm32L4+. In this case, the SRAM3 must be powered during the low power phase since it is a part of the SRAM area for this target. Signed-off-by: Francois Ramu <[email protected]>
1 parent 4971cd4 commit 34f73c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/low_power.c

+4
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ void LowPower_stop(serial_t *obj)
295295
|| (WakeUpUart->Instance == (USART_TypeDef *)LPUART2_BASE)
296296
#endif
297297
) {
298+
#if defined(PWR_CR1_RRSTP)
299+
// STM32L4+ must keep SRAM3 content when entering STOP2 lowpower mode
300+
HAL_PWREx_EnableSRAM3ContentRetention();
301+
#endif /* PWR_CR1_RRSTP */
298302
// STM32L4xx supports STOP2 mode which halves consumption
299303
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
300304
} else

0 commit comments

Comments
 (0)