[riot-notifications] [RIOT-OS/RIOT] cpu/stm32l1: optimize power consumption (#11832)

Francisco notifications at github.com
Fri Jul 12 15:20:04 CEST 2019


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->

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](https://comm.eefocus.com/media/download/index/id-1013834), 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`

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

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

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11832

-- Commit Summary --

  * stm32l1/vendor: add v2.3.0 vendor files
  * cpu/cortexm_common: replace irq_restore by __set_PRIMASK for stm32l152re
  * nucleo-l152re/openocdf_config: enable DEBUG only for gdb
  * stm321l1/vendor: migrate to new v2.3.0 vendor files
  * cpu/stm32_common: minimize consumption for STM32L1

-- File Changes --

    M boards/nucleo-l152re/dist/openocd.cfg (28)
    M cpu/cortexm_common/include/cpu.h (8)
    M cpu/stm32_common/cpu_init.c (12)
    M cpu/stm32_common/periph/dma.c (6)
    M cpu/stm32l1/include/cpu_conf.h (37)
    A cpu/stm32l1/include/vendor/stm32l151xb.h (8070)
    A cpu/stm32l1/include/vendor/stm32l151xba.h (8146)
    A cpu/stm32l1/include/vendor/stm32l151xc.h (9054)
    A cpu/stm32l1/include/vendor/stm32l152xe.h (9350)
    D cpu/stm32l1/include/vendor/stm32l1xx.h (6672)
    M cpu/stm32l1/periph/adc.c (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11832.patch
https://github.com/RIOT-OS/RIOT/pull/11832.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11832
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190712/55b250ff/attachment.html>


More information about the notifications mailing list