2023-01-10 09:46 AM
Hi guys,
I use stm32L4 and freertos, I try to make low power run mode in my project. Normally my mcu works 60Mhz but I want to reduce clock as much as possible in low power run mode like 1Mhz and I want to use freertos in low power run mode. I change clock configuration before low power run mode but in low power run mode freetos osDelay time change.
I need and example application for how to use low power run mode with freertos.
2023-01-10 07:38 PM
Soft timers in FreeRTOS are based on the system tick, normally derived from the SYSTICK timer but ST uses an alternate source in the HAL. If you reduce the clock rate used by the system tick then any delays will be reduced as well. So going from 60MHz to 1MHz means the delay call will be 60 times longer in duration.
You will need to adjust the timer count for RTOS system tick when you decrease or increase clocks. For SYSTICK stop the timer, change the reload and restart the timer. For whatever timer ST uses follow the same general procedure.
Bear in mind if you use preemptive multitasking the time slice for executable tasks will be affected by changing the system tick. Ideally all non-essential tasks are suspended in low power run mode.
Jack Peacock