I am using freertos on STM32F4-Nucleo. To get CPU usage I am using vTaskGetRunTimeStats() with following changes
**void configureTimerForRunTimeStats(void)
{
g_osRuntimeCounter = 0;
}
unsigned long getRunTimeCounterValue(void)
{
return g_osRuntimeCounter;
}**
The g_osRuntimeCounter increments in timer callback function. Everything works fine I am getting CPU usage of running tasks and IDLE time but is there a way to get CPU usage in ISR? The CAN reception and USB-OTG reception is interrupt based and executes few functions. And I need CPU usage of that.