AVR32 CPU Usage

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can anybody tell me how to find the cpu usage of AVR32 Part UC3A0512?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFAIK there are no utilities that are ready made to do this. You will have to write code yourself to measure the performance.

Letting the smoke out since 1978

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you help how to do this by code? For a FREERTOS application?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can we use configUSE_IDLE_HOOK ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The freeRTOS manual suggests that the idle hook could be used to measure the amount of cpu spare time. So the answer is YES.

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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);
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Set an output pin high when idle, and low when doing something?

Hans-Christian