Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

shady33
Copy link
Contributor

@shady33 shady33 commented Mar 7, 2016

The Low power modes implementation for the STM32L1 series.

@OlegHahm OlegHahm 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 Area: drivers Area: Device drivers labels Mar 7, 2016
@DipSwitch
Copy link
Member

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);
Copy link
Member

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.

Copy link
Member

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.

@DipSwitch
Copy link
Member

Please have a look at: https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f4/lpm_arch.c#L31 about how the lpm_arch could be implemented. Using the low power features of the STM32L1 are very board specific and cannot be applied to all boards just like this. I would advice to make them configurable by defining a set of macro's which can be set in board.h of the board implementation.

  • IDLE should be something like 5.3.5 Sleep mode this is the default mode and RIOT expects that all peripheral stay enabled

@shady33
Copy link
Contributor Author

shady33 commented Mar 18, 2016

The f4 has only 3 modes, the l1 has two additional modes for Low Power. What is the problem with the current implementation ?

@DipSwitch
Copy link
Member

Edited

@shady33
Copy link
Contributor Author

shady33 commented Mar 19, 2016

I was planning to define the LPM modes in the following way:
LPM_IDLE : STM Sleep mode
LPM_SLEEP : STM Stop mode
LPM_POWERDOWN : STM Standby mode
LPM_OFF : STM Standby mode

And with LOW_POWER_MODES_ENABLED
LPM_IDLE : STM Sleep mode
LPM_SLEEP : STM Low Power sleep mode
LPM_POWERDOWN : STM Stop mode
LPM_OFF : STM Standby mode

Or is there no need for the low power modes at all?

@miri64 miri64 modified the milestone: Release 2016.07 Mar 29, 2016
@kYc0o
Copy link
Contributor

kYc0o commented Jul 25, 2016

Feature freeze -> postponed.

@kYc0o kYc0o modified the milestones: Release 2016.10, Release 2016.07 Jul 25, 2016
@miri64
Copy link
Member

miri64 commented Oct 31, 2016

Postponed due to Feature Freeze.

@miri64 miri64 modified the milestones: Release 2017.01, Release 2016.10 Oct 31, 2016
@jia200x
Copy link
Member

jia200x commented Dec 20, 2016

Hi @shady33

I was about to start the lpm implementation for STM32L1 but noticed this PR.
What's the status?

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!

@shady33
Copy link
Contributor Author

shady33 commented Dec 20, 2016

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!

@jia200x
Copy link
Member

jia200x commented Dec 20, 2016

Hi @shady33

Nice! I have some NZ32-151RC boards I can use. Tomorrow I will give it a try.
Cheers!

@PeterKietzmann
Copy link
Member

@jia200x did you?

Copy link
Contributor

@kaspar030 kaspar030 left a 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.

@miri64
Copy link
Member

miri64 commented Jan 13, 2017

(#6160 got merged)

@PeterKietzmann PeterKietzmann modified the milestones: Release 2017.01, Release 2017.04 Jan 26, 2017
@PeterKietzmann PeterKietzmann removed this from the Release 2017.01 milestone Jan 26, 2017
@smlng
Copy link
Member

smlng commented Mar 6, 2017

any new here? Is this adaptable to #6160 or start from scratch and close this one?

@aabadie
Copy link
Contributor

aabadie commented Jun 20, 2017

ping, since #6160 has been merged, this one needs adaption

@kYc0o kYc0o mentioned this pull request Oct 29, 2017
5 tasks
@smlng
Copy link
Member

smlng commented Jan 12, 2018

LPM was remove with #6160, close as memo like other PRs

@smlng smlng closed this Jan 12, 2018
@smlng smlng removed this from the Release 2018.01 milestone Jan 12, 2018
@smlng smlng added the State: archived State: The PR has been archived for possible future re-adaptation label Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Platform: ARM Platform: This PR/issue effects ARM-based platforms State: archived State: The PR has been archived for possible future re-adaptation 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.

10 participants