Measuring Real Time for a microcontroller using a Lauterbach Debugger and TRACE32 Software is very easy.
In the following image example, The execution time of the function UpdateCGI is measured:
Note:
This is assuming that, between the two breakpoints, no other code from another task is executed.
So, to guarantee the accuracy of your results,
it's preferred to either put the code you want to measure (code inside UpdateCGI in the above example) into a critical section or
grammatically stop the hardware timer at the start of that code and resume it again at the end of the code.
In the following image example, The execution time of the function UpdateCGI is measured:
- Put a breakpoint in the line of its call and another one at the line just after it.
- Open the RunTime tool from the Misc menu.
- Run the code, the debugger will stop at the first breakpoint.
- Then run again, so that it stops at the second breakpoint.
- Read the execution time from the RunTime window (laststart time).
This is assuming that, between the two breakpoints, no other code from another task is executed.
So, to guarantee the accuracy of your results,
it's preferred to either put the code you want to measure (code inside UpdateCGI in the above example) into a critical section or
grammatically stop the hardware timer at the start of that code and resume it again at the end of the code.
16 comments:
Thank you !
Thanks
You are welcome :-)
You are welcome :-)
Give me different results for differentts run on the same function , why ?
Because in each run, different code is executed for the same function because of conditional checks (if conditions, conditional looping on some variable that change its value each run, ...).
Thanks please can you tell me how to measure elapsed time from the first function call and the second call of the same function : i mean time spent before the function is being called again ?
Thanks a lot
Just put a single breakpoints at the start of that function, run, the debugger will hit the breakpoint, run again, the debugger will hit the breakpoint again, and then read "laststart time". It's the time you need.
Simple, To the point !
Thanks :)
Thank you
Thank you very much!
Thank you kind sir :)
Can we able to do the same from cmm script?
Thank you. but please help clarify is the "laststart" the overall time spend btw breakpoint A and B? I'm trying to find documentation but couldn't if you have any reference please share it.
Post a Comment