Embedded Development Board Learning


Setting FreeRTOS Project #3 Adding the SystemView

Date: febrero 27, 2025

Author: Guillermo Garcia

Categories: RTOS Tags:

If you work with FreeRTOS and want to analyze your system’s real-time performance, SystemView is a powerful tool that allows you to visualize task execution, interrupts, and events in your embedded system. In this article, you will learn how to Adding thr SystemView into a FreeRTOS project to improve debugging and software optimization.

What is SystemView?

This software is a real-time tracing tool developed by SEGGER, designed to capture and analyze events in embedded systems. It provides a detailed visualization of task execution, interrupts, and operating system calls, helping identify bottlenecks and improve code efficiency.

Install SystemView

Download SystemView from SEGGER’s official website and install it on your computer. This tool will allow you to visualize the captured events in your embedded system.

First we need to download the installation file, go to the official SEGGER page.

Download SystemView software from the SEGGER website

Download SystemView files

In addition to the software, we will need some source files that we will add to our project. These source files contain the code necessary to receive the correct events from our board.

The necessary files can be downloaded from the same page in the SystemView, Target Sources section.

Download files for SystemView software target from SEGGER website

Add SystemView Files to Your Project

You can find more information on how to add and prepare your project with software on the following page of SEGGER with FreeRTOS.

In our project we will generate a folder called SEGGER/SystemView where we will place the files we downloaded in the previous section.

SEGGER SystemView files folder

Config

We copy the Config folder from the downloaded files.

Config SystemView files folder

Sample

In the Sample/FreeRTOSV11 folder we copy the following files.

Sample SystemView files folder

SEGGER

We copy the SEGGER folder into our project.

SEGGER SystemView files folder

Add to CMake build system

Now we need to add the files to our build system so that they are added to the build. To do this we need to tell CMake to add the files when it starts the build.

Go to the CMakeLists.txt file and we will put the source files and header file paths in the next section.

Adding SystemView files to the CMake build system

We need to add the header #include «SEGGER_SYSVIEW_FreeRTOS.h» in our FreeRTOSConfig.h configuration file.

File FreeRTOSConfig.h headaer for SystemView

To start systemView before starting the FreeRTOS kernel we must call the following macro traceSTART(); which calls the initialization functions.

Adding macro traceSTART for start SystemView

Viewing tasks

SystemView requires your board to be connected via a J-Link debugger. However, the STM32F407VG Discovery Kit comes with an integrated ST-Link debugger, which is not compatible with SystemView. This means that, by default, you cannot use with this board.

Fortunately, you can convert the board’s built-in ST-Link debugger into a J-Link through firmware reprogramming. In this article.

We debug and we can see the task we created called TaskTest and the time it is running.

Result in SystemView software with FreeRTOS

Closing

Integrating SystemView into a FreeRTOS project is a straightforward process that provides a clear view of the system’s real-time behavior. By following these steps, you can improve the efficiency of your embedded application and optimize task and interrupt management.



Card image cap
Guillermo Garcia Thanks for reading! I am one of the editors of this site and I am committed to providing you with the best information possible by sharing my experience in embedded systems.


Comments... There are no comments.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Publicidad