Use more efficient mode for STM32L4XX stop mode#1097
Merged
fpistm merged 8 commits intostm32duino:masterfrom Jul 3, 2020
angelnu:master
Merged
Use more efficient mode for STM32L4XX stop mode#1097fpistm merged 8 commits intostm32duino:masterfrom angelnu:master
fpistm merged 8 commits intostm32duino:masterfrom
angelnu:master
Conversation
Member
|
Hi @angelnu |
Contributor
Author
|
Jep, I know (looking forward to it) :-) This patch is independent from the sleep time. I made it specific for the STM32L4 since this is the only device I have that supports STOP2. It would be nice if there would be a define for all platforms with STOP2... I hope I can get the style check to agree so the patch is ready. If you have any other feedback you would like to get here please let me know. |
fpistm
requested changes
Jul 3, 2020
fpistm
reviewed
Jul 3, 2020
fpistm
approved these changes
Jul 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes/implements the following bugs/features
Feature 1
Currently the low power library uses HAL_PWR_EnterSTOPMode for all devices. This does not leverage the stop2 mode which is available in the STM32L4XX. This results in 4,6 uA instead of 1,35 uA in my nucleo_l412kb.
Stop1 is only required when the UART device needs to wake up. So when not used the patch calls HAL_PWREx_EnterSTOP2Mode directly.
Feature 2
When available use the MSI as wake up clock. This avoids starting the HSI which generates a short spike of ca 300 uA until the SystemClock_ConfigFromStop is called.
Validation
Not adding a new sketch since no external APIs are changed by this patch.
Code formatting
Closing issues
NA