Skip to content
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

cpu/stm32l1: optimize power consumption #11832

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

fjmolinas
Copy link
Contributor

Contribution description

This PR is based on previous work in #8403 & #10052. On start-up it configures all GPIO's as AIN.
On other boards of the STM32 family (L0 & L4) this is done by default. In #11758 this was done for STM32F0-7, with #11830 that solves #11820, it can now be done for STM32L1.

As stated in this AN, doing this saves the consumption of the input Schmitt trigger. The only case where this shouldn't be done is when the pin is connected to an external driver that has a pull-up or pull-down setting, this should be handled by pertinent drivers.

Testing procedure

Supply voltage for all the below measurement was 3.3V. ASupply was measured directly threw the IDD pin either with a multi meter or NUCLEO-LPM01A power measurement extension.

As of know when entering STOP mode consumption on stm32l1 is around 500uA, with this PR it drops to 1.5uA (datasheet typ 1.4uA for l152re). To test run:

make BOARD=nucleo-l152re -C tests/periph_pm/ flash

Issues/PRs references

Depends on #11830 and #11489
Closes #11359 & #10052

@fjmolinas fjmolinas added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: pm Area: (Low) power management State: waiting for other PR State: The PR requires another PR to be merged first labels Jul 12, 2019
- With this PR all GPIOs are set as AIN on start up.

Co-authored-by: Oleg Artamonov <oleg@unwds.com>
@fjmolinas fjmolinas force-pushed the pr_optimize_pm_stm32l1 branch from 1ce0eb1 to 3cd7244 Compare August 5, 2019 13:40
@fjmolinas fjmolinas added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Aug 5, 2019
@fjmolinas fjmolinas requested a review from aabadie August 5, 2019 13:41
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested power consumption on nucleo-l152re and confirm the (huge) improvement.

Code changes are good. ACK

@fjmolinas fjmolinas added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 5, 2019
@aabadie
Copy link
Contributor

aabadie commented Aug 6, 2019

Forgot to merge this one yesterday.

@aabadie aabadie merged commit 51e4008 into RIOT-OS:master Aug 6, 2019
@fjmolinas fjmolinas deleted the pr_optimize_pm_stm32l1 branch August 7, 2019 15:41
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: pm Area: (Low) power management CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants