We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I use LPC2478 and would like to know if there is any way to measure in real time the stack load? thanks
It all depends on your definition of "real time".
You can at any time check the stack pointer value. That would be "real time", except that to get some real work done you would have to limit yourself to how often you sample the stack pointer.
To get the stack peak, you can fill the stack with a known pattern and then regularly scan the stack to see how much of the pattern that got overwritten.
I haven't checked the options list for the compiler but some compilers have support for adding special prologue code to check stack limits on every function call. I haven't seen anything that the ARM compiler have any such feature.
RTX have functionality for stack checking. Obviously only sampled when RTX is in control.
Was thinking of enjoying the idle task of RTX to check on my stack allocated tasks. So could have a datalogger with the % usage of the stack.
Also thought to monitor the CPU usage of each task, so I can estimate what task is hogging the CPU.
Thanks.
The trick with RT applications is that it is normally more important to figure out the response times from the different threads, than the amount of CPU they consume. CPU load is more a question of power consumption, as long as all events gets processed in time.