2019-03-27 03:26 AM
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.
Solved! Go to Solution.
2019-03-29 03:59 AM
2021-05-10 12:45 PM
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).
2021-05-10 12:53 PM
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.