Hello,
I wish to measure the CPU utlization for a cortex processor running an RTOS (keil RTX). Without an RTOS, i can measure the idle time to come to some conclusion. But with RTOS, can someone guide me how to measure CPU utlization?
Thanks & Best Regards Vivek
Hi Vivek,
As suggested in this thread, I am also trying to measure the idle time , etc and arrive at CPU util using the logic analyzer.
However, I am curious to know ("Without an RTOS, i can measure the idle time to come to some conclusion"), how / which method did you use for this?
Regards Padma
Hi Padma,
I used Stuart's method. Inside the while (1) loop, i keep incrementing a counter variable. I reset the variable periodically. The period is something that i defined. (say 10 ms). I used to store these data in an array to make an iterative measurement.
Iam equally curious about your method using a logic analyzer. (though i dont have one to ake use of)
hope this helps.
BR/ Vivek
Hello All,
When i make repeated measurements, i observe that sometimes, i get values that are twice or thrice the value i get most of the times.
For ex i get CPU_idle_time_counter = 0x00057E34 most of the times, but i also get 0x000AFC68 and 0x00107A9D.
I couldnt think of any reason why this could happen. Idle task is not executed. That is clear. But is it OK to ignore such values.
Vivek
interrupts during measurement?
i dont have any interrupts enabled in my program. After i set up the clock, initialize a timer, enable it and go into a while(1) loop with a variable (counter) to make idle time measurement. With this simple code, i didnt even attach my application.
If the task that reads out the sample and clears the counter misses one run, then the counter may measure during two time slices.
Thanks.
i repeated the test for different frequencies. But the counter variable measuring the idle time counts the same number.
With increase in frequency, i was expecting the code to count up to a larger number.
Are you busy-looping the counter increment? You may not use a timer to increment the value, since then you have hardware acceleration and doesn't compute the availability of CPU instructions.
Ok. Will it work if i disable the flash accelerator ?
Will it work if i disable the flash accelerator ?
don't do that. your system will crawl...
I can disable flash acceleration for just for measurement purpose and i can re-enable it later
View all questions in Keil forum