cancel
Showing results for 
Search instead for 
Did you mean: 

Verification of CPU Load

smrtkai
Senior
Posted on November 05, 2015 at 16:48

Hi,

I try to measure the CPU load of my STM32F429I-Discovery board. I tried the approach described on

http://stm32f4-discovery.com/2015/05/cpu-load-monitor-for-stm32f4xx/

. This shows me a CPU utilization of 99% in ''work mode'' and a CPU utilization of 29% in ''idle mode''. In ''work mode'' the while-loop handles a digital signal processing task and in ''idle mode'' the while-loop is empty.

I doubt that the calculated values by this approach are correct, that's why I want to verify the values with another approach. Although I have some interrupts (ADC and DMA), the value of 29% seems way too high. Unfortunately I do not know, which approach is reliable.

Is there a way to measure the CPU load using Keil uVision's Debugger?

Or how do I toggle a pin, when changing from work to sleep mode? I haven't found any sample code.

I do not use RTOS, that's why the approach in

/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4%20Processor%20Load&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=661

in this forum, does not apply.

Thanks for your help in advance.

null
5 REPLIES 5
franck2399
Associate
Posted on November 05, 2015 at 17:49

Hi smrtkai,

Maybe you should have a look there ;)

http://stm32f4-discovery.com/2015/05/library-60-cpu-load-monitor-for-stm32f4xx-devices/

Hope it helps

Posted on November 05, 2015 at 18:53

You haven't found any code to initialize/toggle a GPIO pin, or figured out how to toggle it in your idle/grinding while loop?

If you have interrupt based code, toggle another GPIO on entry/exit from that. And consider putting a WFI in the idle loop if the exit case is controlled by an interrupt trigger.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smrtkai
Senior
Posted on November 09, 2015 at 15:34

I think we have a little misunderstanding. Of course I know how to toggle a pin. That's like if I would ask ''I could not find any example code Hello World in C. Can you help me?'' :D

And of course I have had a look at the CPU monitor library. That's exactly the same link and approach described above.

For the pin-toggling approach, when do I toggle? Before __wfi() and after?
Posted on November 09, 2015 at 18:49

I'd put one on either side of the WFI, and another at entry/exit for the interrupt. That way you'd know how much idle time you have, and how long it spends in the interrupt.

At the very least it would give you a view of where the time is going, and you could refine further.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smrtkai
Senior
Posted on November 10, 2015 at 09:24

Okay, thanks.