Starting TraceAlyzer (Snapshot Mode)

Starting the TraceAlyzer Snapshot Recorder

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:

main.c
#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 host application will connect to the embedded target via an onboard or external J-Link and will read all the trace data up to the PC.

Before starting the reading process, open TraceAlyzer and click J-Link -> J-Link Settings and a dialog window similar to the one shown in Figure TraceAlyzer - J-Link Settings will be displayed. Make sure that you have confirmed the following settings:

  • 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).
TraceAlyzer - J-Link Settings

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. 

TraceAlyzer - Memory Region Settings

Finally, to read a recording click J-Link -> Read Trace (Snapshot) and you will be presented with the main window that displays the timeline.

TraceAlyzer - Streaming Status Window

Further Reading

For additional and more detailed coverage of TraceAlyzer refer to the TraceAlyzer Documentation.