This example project shows how to record and analyze FreeRTOS and system activity with SEGGER SystemView and pyOCD on an STMicroelectronics NUCLEO-H743ZI2 board.
-
Install both required desktop applications:
-
Clone this repository, for example using Git in VS Code, or download the ZIP file. Open the repository root folder in VS Code and let the required tools and software packs install.
-
Connect the NUCLEO-H743ZI2 board and use the CMSIS view action buttons to build, load, and run the project with the systemview-file target set.
-
Press the blue user button on the board several times to generate SystemView messages, then stop the application with the CMSIS view action buttons.
-
Start the SEGGER SystemView Application and open
./out/SEGGER-SystemView+STM32H743ZITx.core0.ch1.bin. -
Use SEGGER SystemView to inspect the recorded system and FreeRTOS activity.
SEGGER SystemView is a real-time software analysis tool that records and visualizes the runtime behavior of embedded systems. It shows detailed timing for tasks, interrupts, software timers, and application events, helping developers find inefficiencies, resource conflicts, and unintended interactions.
The target-side SystemView instrumentation sends events through SEGGER Real Time Transfer (RTT). In this example, pyOCD accesses RTT through the target's debug port and writes the SystemView data to a recording file. The SEGGER SystemView Application then opens that file for graphical analysis. This approach does not require a dedicated UART or extra target pins.
The same approach can be adapted for other devices and boards. For product details, downloads, and usage information, see the official SEGGER SystemView product page, SystemView downloads, and SystemView User Guide.
To use SEGGER SystemView as shown in this example, install the following software packs:
SEGGER::RTTpack, version 8.58.0 or laterSEGGER::SystemViewpack, version 4.12.0 or laterARM::CMSIS-Compilerpack, version 2.3.0 or laterARM::CMSIS-FreeRTOSpack, version 11.0.1 or later
The target-side SEGGER::SystemView software pack provides the instrumentation
code. The separately installed
SEGGER SystemView Application
is required to view and analyze the recorded data.
-
In the Software Components view, enable the following components:
SEGGER→RTTSEGGER→SystemView,FreeRTOSvariant
-
Add the required code to your application:
-
At the end of
FreeRTOSConfig.h, add:#include "SEGGER_SYSVIEW_FreeRTOS.h"
-
Include the configuration header in the application source:
#include "FreeRTOSConfig.h"
-
Start recording before initializing the RTOS:
traceSTART(); -
Send application messages to SEGGER SystemView:
SEGGER_SYSVIEW_PrintfHost("Button pressed %d times", count);
-
-
In the
csolution.ymlfile, add the followingrtt:node under thedebugger:node:rtt: - channel: - number: 1 mode: systemview
pyOCD can also stream data directly to the SEGGER SystemView Application over a network connection instead of recording it to a file. To use this mode, change Target Set from systemview-file to systemview-server in the Manage Solution view.
