Can anybody tell me how to find the cpu usage of AVR32 Part UC3A0512?
AVR32 CPU Usage
Author
Message
AFAIK there are no utilities that are ready made to do this. You will have to write code yourself to measure the performance.
Can you help how to do this by code? For a FREERTOS application?
Can we use configUSE_IDLE_HOOK ?
Level: Hangaround
Joined: Tue. Oct 9, 2007
Posts: 398 View posts
Location: Eindhoven, The Netherlands
The freeRTOS manual suggests that the idle hook could be used to measure the amount of cpu spare time. So the answer is YES.
Is this make sense? Please let me know
UINT32 Tick_Hook_Cnt = 0;
UINT32 Idle_Hook_Cnt = 0;
void vApplicationTickHook(void){
Tick_Hook_Cnt++;
}
void vApplicationIdleHook(void){
Idle_Hook_Cnt++;
}
int cpu_utilization_percentage()
{
return (100 - Idle_Hook_Cnt * 100/Tick_Hook_Cnt);
}
Set an output pin high when idle, and low when doing something?