[riot-notifications] [RIOT-OS/RIOT] pr: optimize stop mode for stm32f* (#11758)

Francisco notifications at github.com
Fri Jun 28 10:33:59 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 #11359, where STM32L1 has been cut from the PR. 

On start-up it configures all GPIO's as AIN. On other boards of the STM32 family (L0 & L4) this is done by default. There for this is only done for STM32F0-7~.

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

<!--
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
-->

Supply voltage for all the below measurement was 3.3V. Al pin headers where disconnected where disconnected, supply 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 stm32f7 is around 1.24mA, with this PR it drops to **350uA** (270uA typ f746zg). To test run:

`make BOARD=nucleo-f746zg -C tests/periph_pm/ flash`

As of know when entering STOP mode consumption on stm32f4 is around 500uA, with this PR it drops to **120uA** (datasheet 120uA typ for f446re). To test run:

`make BOARD=nucleo-f446re -C tests/periph_pm/ flash`

As of know when entering STOP mode consumption on stm32f3 is around 1mA, with this PR it drops to **15.3uA** (datasheet 7.4uA typ for f303re). To test run:

`make BOARD=nucleo-f303re -C tests/periph_pm/ flash`

As of know when entering STOP mode consumption on stm32f2 is around 1.27mA, with this PR it drops to **200uA** (datasheet 200uA typ for f207zg). To test run:

`make BOARD=nucleo-f207zg -C tests/periph_pm/ flash`

As of know when entering STOP mode consumption on stm32f1 is around 100uA, with this PR it drops to **11uA** (13.5uA typ f103rb). Tested on nucleo-f103rb:

`make BOARD=nucleo-f103rb -C tests/periph_pm/ flash`

As of know when entering STOP mode consumption on stm32f0 is around 507uA, with this PR it drops to **10.7uA** (3.5uA typ f072rb). To test run:

`make BOARD=nucleo-f072rb -C tests/periph_pm/ flash`

NOTE: on nucleo boards if power is measured directly after programming there will be around 200uA of current consumption coming from the stlink. The stlink must start without being connected to the board or power the board externally.

### Issues/PRs references

<!--
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/.
-->

Based on work from #8403 & #10052. Taken from #11359.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * cpu/stm32_common: minimize consumption for STM32F0/2/3/4/7
  * cpu/stm32_common: minimize consumption for STM32F1
  * cpu/stm32_common: refactor gpio_pm_init_ain

-- File Changes --

    M cpu/stm32_common/cpu_init.c (5)
    M cpu/stm32_common/include/periph_cpu_common.h (15)
    M cpu/stm32_common/periph/gpio.c (80)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11758.patch
https://github.com/RIOT-OS/RIOT/pull/11758.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/11758
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190628/e43310e6/attachment-0001.html>


More information about the notifications mailing list