-
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
stm32l1/lpm: low power implementation for stm32l1 #4980
Conversation
Sorry, took a while... Seems oke (just as any other STM32) but I don't have a board to test. |
break; | ||
case LPM_IDLE: /* STM Low power run mode */ | ||
current_mode = LPM_IDLE; | ||
PWR->CR |= (PWR_CR_LPSDSR | PWR_CR_LPRUN); |
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.
Low power run mode cannot be entered if the system clock speed exceeds fMSI 1
I guess this is 4.194 MHz but all boards are currently using the HSI as clock source and running at >= 32MHz. Also to enable LPRUN
the Vcore must not exceed Vcore range 2 which means the CPU clock may not run faster dan 16MHz.
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.
@DipSwitch @shady33 do you think is OK to change Vcore and system frequency inside the lpm_arch_set? It can be reverted latter in the lpm_arch_awake function.
I noticed the enter sleep function in the stm32l1 hal implementation 1 doesn't change frequency nor Vcore range. I'm not sure if those conditions are expected before the sleep call.
Please have a look at: https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f4/lpm_arch.c#L31 about how the
|
The f4 has only 3 modes, the l1 has two additional modes for Low Power. What is the problem with the current implementation ? |
Edited |
I was planning to define the LPM modes in the following way: And with LOW_POWER_MODES_ENABLED Or is there no need for the low power modes at all? |
Feature freeze -> postponed. |
Postponed due to Feature Freeze. |
Hi @shady33 I was about to start the lpm implementation for STM32L1 but noticed this PR. We are very interested in this feature for a battery based IoT network. If there's something we can do to help just let me know. Cheers! |
Hi @jia200x Unfortunately, I don't have access to STM32L1 boards. So, I can't test out the code. But I had done most of the work. You can see if it fits with Riot's rules. If it does you could just pull it or feel free to close this PR as I may not be able to test it. Cheers! |
Hi @shady33 Nice! I have some NZ32-151RC boards I can use. Tomorrow I will give it a try. |
@jia200x did you? |
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.
This'll need to be reworked on top of #6160.
(#6160 got merged) |
any new here? Is this adaptable to #6160 or start from scratch and close this one? |
ping, since #6160 has been merged, this one needs adaption |
LPM was remove with #6160, close as memo like other PRs |
The Low power modes implementation for the STM32L1 series.