Skip to content

cpu/stm32l4: add STOP and STANDBY low-power modes#11173

Closed
aabadie wants to merge 2 commits intoRIOT-OS:masterfrom
aabadie:cpu_stm32l4_pm
Closed

cpu/stm32l4: add STOP and STANDBY low-power modes#11173
aabadie wants to merge 2 commits intoRIOT-OS:masterfrom
aabadie:cpu_stm32l4_pm

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Mar 13, 2019

Contribution description

This PR adds STOP and STANDBY low-power modes to stm32l4 MCU family. There are 3 levels of STOP modes for L4, this PR uses STOP1 because I found less constraint (more peripherals can be used during this mode). Even if possible, the SRAM2 retention is disabled during standby mode.

On a nucleo-l433rc or nucleo-l476rg, I got the following consumption results:

  • stop: ~8.5uA
  • standby: ~0.5uA

For standby mode, the wake-up pins are disabled because when enabling them, there's an important consumption increase (around 300uA). On the l4 boards I have, except l496zg, one of the wake-up pin (PA2) in connected to the stdio UART: this crashes the cpus when entering standby mode and this wake-up pin is enabled.

Testing procedure

  • Build an flash tests/periph_pm on a nucleo-l476rg
  • Plug a multimeter on the IDD pins in Amper mode measurement
  • Switch to STANDBY mode:
> unblock 0
> unblock 1
> unblock_rtc 1 5

You should see a drop of consumption from 3.8mA to 0.5uA. After 5 seconds, the board reboots.

  • Switch to STOP mode:
> unblock 1
> unblock_rtc 1 5

You should see a drop of consumption from 3.8mA to 8.5uA

Issues/PRs references

None

@aabadie aabadie added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: pm Area: (Low) power management labels Mar 13, 2019
@aabadie aabadie requested a review from vincent-d March 13, 2019 16:04
Copy link
Copy Markdown
Contributor Author

@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.

I tested this PR on nucleo-f091rc and STOP mode works although consumption see quite high (~2mA instead of 7 in normal run mode). By default, the STANDBY mode doesn't work because all wakeup pins are enabled which causes troubles.

This is why I don't like the current default behaviour with wake-up pins. See my comment below.

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Mar 14, 2019

I mixed up this one with #9521 and posted my review on the wrong one...

@aabadie aabadie added the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 14, 2019
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Mar 14, 2019

For simplicity, this PR is now based on #9521.

@aabadie aabadie removed the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 20, 2019
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Mar 20, 2019

Rebased now that #9521 is merged. I need to re-test it again though.

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Mar 20, 2019

Re-tested this PR on nucleo-l476rg, nucleo-f446re and nucleo-l073rz. All good.

@vincent-d, do you have any comment on this one ?

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Mar 20, 2019

closing in favor of #11211.

@aabadie aabadie closed this Mar 20, 2019
@aabadie aabadie deleted the cpu_stm32l4_pm branch July 4, 2019 17:04
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: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant