2015-11-05 07:48 AM
Hi,
I try to measure the CPU load of my STM32F429I-Discovery board. I tried the approach described onhttp://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¤tviews=661
in this forum, does not apply. Thanks for your help in advance. null2015-11-05 08:49 AM
http://stm32f4-discovery.com/2015/05/library-60-cpu-load-monitor-for-stm32f4xx-devices/
Hope it helps2015-11-05 09:53 AM
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.2015-11-09 06:34 AM
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?2015-11-09 09:49 AM
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.2015-11-10 12:24 AM
Okay, thanks.