-
Notifications
You must be signed in to change notification settings - Fork 3k
Fixed a problem that the STOP2 was falling back to STOP1 #3663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
the LPR was not turned on. Now the deepsleep mode only needs 1.6uA instead of 10uA.
Thanks Helmut to have found this 😄 |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update code style
targets/TARGET_STM/sleep.c
Outdated
int pwrClockEnabled = __HAL_RCC_PWR_IS_CLK_ENABLED(); | ||
int lowPowerModeEnabled = PWR->CR1 & PWR_CR1_LPR; | ||
|
||
if (!pwrClockEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code style violation needs '{'
targets/TARGET_STM/sleep.c
Outdated
__HAL_RCC_PWR_CLK_ENABLE(); | ||
HAL_PWREx_EnableLowPowerRunMode(); | ||
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); | ||
if (lowPowerModeEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code style violation needs '{'
targets/TARGET_STM/sleep.c
Outdated
|
||
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); | ||
|
||
if (lowPowerModeEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
targets/TARGET_STM/sleep.c
Outdated
|
||
if (lowPowerModeEnabled) | ||
HAL_PWREx_EnableLowPowerRunMode(); | ||
if (!pwrClockEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
The LPR was not turned on when entering into STOP2. Now the deepsleep mode on the STM32L4 Nucleo board needs only 1.6uA instead of 10uA.
This is described in the STM RM0351 Reference manual, Section PWR registers BIT-14
Note: Stop 2 mode cannot be entered when LPR bit is set. Stop 1 is entered instead.
I am pretty happy that I figured this out.
Regards Helmut