Skip to content

stm32L4+ going to STOP2 lowpower mode must keep SRAM3#66

Merged
fpistm merged 1 commit into
stm32duino:mainfrom
FRASTM:issue64
Jan 3, 2022
Merged

stm32L4+ going to STOP2 lowpower mode must keep SRAM3#66
fpistm merged 1 commit into
stm32duino:mainfrom
FRASTM:issue64

Conversation

@FRASTM
Copy link
Copy Markdown
Contributor

@FRASTM FRASTM commented Dec 16, 2021

On the stm32L4+ , the low power DEEP_SLEEP mode corresponds to STOP2 low power
mode. 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 (SRAM is made of SRAM1+SRAM2+SRAM3).
By default, the content of the SRAM3 is lost during STOP2 low power mode and consequently this must be changed.

Fixes #64

Signed-off-by: Francois Ramu [email protected]

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]>
@fpistm fpistm added the enhancement New feature or request label Dec 16, 2021
@fpistm fpistm added this to the 1.2.0 milestone Dec 16, 2021
@fpistm fpistm self-requested a review December 16, 2021 09:03
@FRASTM
Copy link
Copy Markdown
Contributor Author

FRASTM commented Dec 16, 2021

Going to STOP2 (stm32duino deepsleep mode) with SRAM3 powered is similar (in terms of current consumption and wakeup time) to STOP1 mode.

@@ -295,8 +295,8 @@ void LowPower_stop(serial_t *obj)
       || (WakeUpUart->Instance == (USART_TypeDef *)LPUART2_BASE)
 #endif
      ) {
-    // STM32L4xx supports STOP2 mode which halves consumption
-    HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
+    // STM32L4xx supports STOP1 mode which halves consumption and maintains SRAM3
+    HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);
   } else
 #endif
   {

@fpistm fpistm merged commit 34f73c3 into stm32duino:main Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

STM32L4R5xx does not restart or resume code execution after wakeup from deep sleep

2 participants