...
To start recording you need to call the macro TRACE_START()
from your application code. the code listing below shows an example where the trace recording is started on the main function right after initializing the trace module:
Code Block | ||
---|---|---|
| ||
#include <os_trace.h>
.
.
.
int main(void)
{
OS_ERR err;
BSP_Init(); /* Initialize CPU clock frequency. */
.
.
.
CPU_IntDis(); /* Disable all Interrupts. */
OS_TRACE_INIT(); /* Initialize the uC/OS-III Trace recorder. */
OS_TRACE_START(); /* It should be called after the system is initialized. */
.
.
.
OSInit(&err); /* Init uC/OS-III. */
.
.
.
OSStart(&err); /* Start multitasking (i.e. give control to uC/OS-III). */
.
.
.
} |
To analyze a recording you need the host application, TraceAlyzer for µC/OS-III, which works with both the streaming and snapshot recorders. The tool can be downloaded from the following link: http://percepio.com/tz/
...
- The J-Link Speed matches the one supported by your embedded target and the one configured by other tools using the same J-Link session (e.g. Debugger and/or µC/Probe).
- The Debugger Interface matches the one supported by your embedded target and the one configured by other tools using the same J-Link session (e.g. Debugger and/or µC/Probe).
- The Target Device name matches your embedded target and the one configured by other tools using the same J-Link session (e.g. Debugger and/or µC/Probe).
...
Panel | ||||
---|---|---|---|---|
| ||||
Before streaming the data, TraceAlyzer makes an attempt to locate the symbol RecorderData
where the trace data is stored. You simply need to specify the memory base address where RecorderData
is located and the range to search.
Click J-Link -> Memory Region and in the dialog window similar to the one shown in Figure TraceAlyzer - Memory Region Settings make sure that the Start Address and the Bytes to Read fields are correct.
Panel | ||||
---|---|---|---|---|
| ||||
Finally, to read a recording click J-Link -> Read Trace (Snapshot) and you will be presented with the main window that displays the timeline.
...
Panel | ||||
---|---|---|---|---|
| ||||
Further Reading
For additional and more detailed coverage of TraceAlyzer refer to the TraceAlyzer Documentation.