cancel
Showing results for 
Search instead for 
Did you mean: 

Reduce power consumption STM32L4

Hello there,

I am developing a FreeRTOS based application using STM32L452 MCU. I am looking for a way, to reduce the power consumption in the idle intervals of the processors work. When reviewing the sleep modes, it occured to me that the MCU might be unresponsive to external events or even lose context (MCU reset), which is not fit in this RTOS running application.

I thought then that I could simply reduce the HCLK frequency by playing with the PLL registers. The problem here is that the systick timer will get altered, and I really need it to stay with its regular timebase (1 ms). I checked either it is possible to clock the Systick timer from other sources, but it seems like its only HCLK and HCLK / 8. The datasheet says it is calibrated for this value.

I would appreciate some suggestions on this topic.

Lukasz.

22 REPLIES 22
Hello,
After your advices I implemented the tickless mode to the system. After dividing the systick clock by 8, I can get isle times up to around 1.6 sec, which is nice.
What I am wondering about now is at what point there is an advantage of going to sleep- to be exact, what is the minimum time for which the mcu while going asleep will gain power and not waste it by constant waking up and sleeping? I believe that by sleeping every 1 ms for 1 ms I wont gain anything? Preliminarly I have set the system to tickless only of it will be able to stay like this for at least 400 ms.
Is there a way to derive at what point (minimum sleep time) it starts to be advantegous to go tickless?
zsellera
Associate

There's a project that use LPTIMx as the tick timer: this way you can have FreeRTOS ticks updated even in STOPx modes (it's what you need imho).

Changing SYSTICK prescaler (/1 or /8) is nice if you want to run occasionally faster, but you're generally fine at lower speeds. It offers a limited gain only compared to STOP mode sleep states (ie: sleep @64 MHz ~1.4 mA; sleep @8 MHz ~0.3 mA; while stop2 is lower than ~10uA). Anyway, this exactly what I needed recently. This is my blog post with implementation details on it (changing voltage scaling, flash latency, tuning pll, etc).

Hi @zsellera​ ,

Thank you for suggesting this solution- wish I had it at the time of dealing with my problem :). Will surely remember about it for the next project.