Freertos CPU load occasionally reaches 100%, but there are only some simple tasks; Calculation formula: (Total time - Idle task running time)/Total time. Will Tickless model affect CPU load calculation?
Depending on how tickless idle is working, it might not carry CPU load measurements correctly over it, and not count that idle time.
As Richard mentioned, tickless idle sleep mode may effect idle time count. To ensure accurate time counting, we can check the following:
- Examine the implementations of
portALT_GET_RUN_TIME_COUNTER_VALUEandportGET_RUN_TIME_COUNTER_VALUE. These two port run time macros are responsible for obtaining the run time counter time base. If the counter is halted during the tickless idle sleep, the time elapsed during sleep may not be accounted for. - Some ports utilize
xTickCountto implement these two port macros. Please verify ifvTaskStepTickis called within yourportSUPPRESS_TICKS_AND_SLEEPimplementation. ThevTaskStepTickfunction is used to correctxTickCountand account for the time that passed during the sleep period.