Tracealyzer and Keil µVision
Tracealyzer is an advanced software tracing tool designed for RTOS-based applications and provides more than 30 graphical views of the real-time behavior, making it easier reveal bugs and performance issues. With Tracealyzer you increase development efficiency and deliver robust, responsive software, on time and within budget. To learn more about how Tracealyzer can be used in practice, check out the blogs and white papers in Resources.
This page is intended for users of Keil µVision and FreeRTOS, SafeRTOS, ThreadX or Micrium. This page is also relevant if you are using the CMSIS-RTOS API configured to use the FreeRTOS kernel. If using Keil RTX5, make sure to use Tracealyzer for Keil RTX5 instead (instructions here).
Using Tracealyzer with Keil µVision
First, you need to enable tracing in your system. Tracealyzer uses software-based tracing, so no special hardware is required. We recommend an Keil ULINKpro or ULINKplus probe to allow for trace streaming, although this is also possible in other ways.
For ThreadX, Tracealyzer supports the included trace recorder from Express Logic, which just needs to be enabled in your build. Note that this recorder library only supports snapshot mode.
For FreeRTOS, SafeRTOS and Micrium µC/OS-III, Percepio provides a powerful trace recorder library that supports both snapshot and streaming mode. To include this in your build, check this guide for FreeRTOS. Other RTOSes have very similar guides, found in their respective User Manual (found in the Tracealyzer Help menu).
Snapshot mode
In snapshot mode, software events are stored in a on-target RAM buffer. Keil µVision can be configured to save the trace buffer to a file, that Tracealyzer can then read and visualize.
Open the “Function Editor” (in “Debug” menu, enabled when debugging…) and add the below code. This will create a new button that saves the current trace buffer to “out.hex”. Open this file in Tracealyzer.
FUNC void SavePercepioRecorderData(void) {
printf("Saving Recorder Data in out.hex!\n") ;
exec("SAVE \"out.hex\" RecorderDataPtr , (RecorderDataPtr + 1)");
}
DEFINE BUTTON "Save Recorder Data", "SavePercepioRecorderData()"
This script works with the Percepio trace recorder library, used for FreeRTOS, SafeRTOS and Micrium. For ThreadX, change “RecorderDataPtr” in the above script to the name of the ThreadX trace buffer (the first parameter of your tx_trace_enable call).
Streaming Mode
Tracealyzer also allows for continuous streaming of the trace data, e.g. via ARM ITM, SEGGER J-Link RTT or other custom interfaces.
Read Percepio Application Note PA-021 to learn how to use setup Tracealyzer and Keil µVision for ITM streaming from FreeRTOS, SafeRTOS or Micrium.