-
Notifications
You must be signed in to change notification settings - Fork 945
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
Use more efficient mode for STM32L4XX stop mode #1097
Conversation
Hi @angelnu |
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. |
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