Date: febrero 27, 2025
Author: Guillermo Garcia
Categories: RTOS Tags: FreeRTOS
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.
Table of Contents
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.
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.
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.
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.
We copy the Config folder from the downloaded files.
In the Sample/FreeRTOSV11 folder we copy the following files.
We copy the SEGGER folder into our project.
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.
We need to add the header #include «SEGGER_SYSVIEW_FreeRTOS.h» in our FreeRTOSConfig.h configuration file.
To start systemView before starting the FreeRTOS kernel we must call the following macro traceSTART(); which calls the initialization functions.
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.
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.
Deja una respuesta