-
Notifications
You must be signed in to change notification settings - Fork 2k
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/stm32: optimize power consumption #11359
Conversation
1e7c4dc
to
c08a447
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to avoid hard coded values ?
c08a447
to
00598ac
Compare
@aabadie @vincent-d I extended the PR for F* minus F1 and F0 (which I haven't tested), I moved around some code to periph_gpio.c, how do you fill about this? Also removed the use of cpu_check_addressed, It didn't work in some very specific cases, using IS_GPIO_INSTANCE() cmsis macro works better. |
676efb9
to
8ed7a80
Compare
@kYc0o I remember you mentioning offline at IETF that you had some problems with this approach, Would you want to state them or is this approach different than what you where telling me? |
Oh my only problem was to have "bricked" boards after the first flash. This was because the SWD pins were configured this way and thus the flasher couldn't read them. Did you experience something like that? To solve it I just needed to push the reset button until openocd was able to identify the board. |
- Update periph/dma according to new macro definitions for stm32l1xxx boards
Closed in favor of #11832. |
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
STM32Lfamily (L0 & L4) this is done by default. There for this is only done for STM32L1 and STM32F0-7(excluding F1, I don't have one to test).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. 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.
I don't have an F0 yet, will test as soon as I get one.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-l103rb:
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
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
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
Based on work from #8403 & #10052. Depends on
#10051 or #11358.#11489