Hi
I’m using FreeRTOS V10.0.1 on a NXP K22 MCU.
I’ve just started to implement some power saving features and need to reduce the clock speed when the application is receiving data, and then increase the speed when the application is sending data (because the data needs to be compressed and it takes longer to compress it)
I’m not sure how to notify FreeRTOS that the clock rate has been changed, so I have been setting the SystemCoreClock global variable, which I know FreeRTOS uses, and then calling vPortSetupTimerInterrupt() to reconfigure the timer.
SystemCoreClock = CLOCK_GetFreq(kCLOCK_CoreSysClk);
vPortSetupTimerInterrupt();
However this only seems to work correctly when changing from specific slower clock speeds, to a faster clock speed
50Mhz → 100Mhz works OK.
40Mhz → 100Mhz works OK
but 45Mhz → 100Mhz seems to cause FreeRTOS to stop scheduling tasks correctly and the task code only seems to be executed at random times, often with large delays.
I am not using TickLess idle, because I’m not fully sleeping the application, as USB needs to be maintained at all times.
So I’m simply changing the clock rate.
I’ve tried ending and the starting the scheduler when I change clock rates, but that just seems to cause my watchdog timer to activate, as if the application has hung.
If possible can someone tell me what I need to do, in order to notify FreeRTOS that I am about to change, or have just changed the clock speed, so that I can change clock speeds