FreeRTOS V10.4.1 with SEGGER SystemView V3.12

Amazon has released in the past week the FreeRTOS version V10.4.0. Time to upgrade, actually the most recent version 10.4.1! The same time the SEGGER SystemView V3.12 was released back in April this year. No surprise: with the FreeRTOS changes they don’t work out of the box: but no worries, I have you covered and applied all the needed patches and changes to have them working again together: the latest FreeRTOS v10.4.x with Segger SystemView v3.12:

Segger SystemView 3.12 with FreeRTOS 10.4.2

Segger SystemView 3.12 with FreeRTOS 10.4.2

FreeRTOS

In case you have not noticed: FreeRTOS is now hosted on GitHub which makes it easy to follow of it. The release V10.4.0 was announced 9-Sept-2020, but with GitHub it was easy to jump on the most recent V10.4.1 version.

The big change with V10.4.x is that the Direct Task Notification has been extended to support an array of notification values. Direct Task Notification has been a great feature to me, as it is efficient, fast and I’m using it in nearly all of my applications. But it has been limited to 32bits (on a 32bit processor like ARM Cortex) and if you hit that limit, other ways of notifications had to be used for the extra needs. Now the number of (32bit) entries can be specified.

I have successfully ported the RTOS and applied all the patches. For example it runs now with the MCUXpresso SDK in the MCUXpresso (Eclipse based) IDE with all the ‘bells & whistles’:

MCUXpresso IDE 10.2.0 running FreeRTOS 10.4.1

MCUXpresso IDE 11.2.0 running FreeRTOS 10.4.1

To add some ‘icing on top of the cake’: updated Processor Expert components are included:

FreeRTOS Processor Expert Components

FreeRTOS Processor Expert Components

SystemView

The Segger SystemView has been upgraded to Version 3.12. SystemView uses SEGGER RTT and is a great tool to get insights into the application RTOS and runtime behavior.

Segger SystemView 3.12 with FreeRTOS 10.4.2

Segger SystemView 3.12 with FreeRTOS 10.4.2

The FreeRTOS Kernel requires several patches and tweaks to work correctly with SystemView. To stream the trace data directly to the host the SEGGER RTT needs to be present and configured. Because of the FreeRTOS API changes the patches from SEGGER had to be extended and have been applied to the Kernel sources. In addition to that, all the latest patches to make the GNU Link Time optimization to work with the Kernel (e.g. to prevent wrong removal of objects by the linker).

Summary

Both the SystemView component and FreeRTOS are available as Processor Expert components which can be used with the MCUXpresso IDE:

FreeRTOS and SystemView as Processor Expert Components

FreeRTOS and SystemView as Processor Expert Components

All the ported files (FreeRTOS, RTT, SystemView) are available on GitHub (see links at the end of this article) and work nicely with the latest IDE and SDK, gcc (including the most aggressive optimizations, including LTO).

MCUXpresso SDK Intergration

MCUXpresso SDK Integration with CMSIS

Summary

I have now the latest and greatest FreeRTOS and SystemView working together, with all the patches applied. The extended direct task notification in FreeRTOS is a great extension and I plan to use it in one of my next application. With the MCUXpresso IDE and SDK I have everything integrated and can use the SystemView to inspect the performance of my FreeRTOS applications with the latest version.

You can get the source files from the links below.

Happy FreeRTOSing 🙂

Links

28 thoughts on “FreeRTOS V10.4.1 with SEGGER SystemView V3.12

      • I just open and compare with the”official” version and port.c for M4 is very very different !

        I will try to adapt it to my needs as I don’t use MCUXpresso

        Like

        • It is different because
          a) it contains all the extra support for tracing (Percepio/Segger)
          b) not only supports Cortex-M4, but M0, M0+, M4 and M4
          c) it support gcc, IAR and Keil
          I do support as well HCS12, HCS08, DSC, …: the original FreeRTOS way to support each port in single files is one way, but leaves a lot of duplication.
          Because we use FreeRTOS with many different architectures, it is easier to have the common things together.
          If you are interested in M4 only: this is guarded in the code with macros, so you easily can single that out.

          Like

  1. Pingback: Steps to use FreeRTOS with newlib reentrant Memory Allocation | MCU on Eclipse

  2. Pingback: RTOS Trace: TraceX with Microsoft Azure RTOS (aka ThreadX) | MCU on Eclipse

  3. @Erich Your blog is remarkable. I am using FreeRtos10.4.3. I am also facing patch issues with Segger systemview. I don;t know where is the problem.

    Like

  4. I am using FreeRtosv10.4.3 and segger v3.20. IDE I am using is system workbench for stm32. I am having patch issues with FreeRtos.

    Like

  5. Pingback: Debug Firmware Switching for the LPC4322 | MCU on Eclipse

  6. Hi I am very very newbie, but I have a question. How to apply the patch file e.g FreeRTOS_10_4_3.patch on windows. I dont know what should be the command or app to do that.
    the official systemview guide show this command for linux patch -p1 -r . < FreeRTOS_10_4_3.patch

    thanks

    Liked by 1 person

  7. the core patch has file path like this
    diff -rupN org/Source/include/FreeRTOS.h new/Source/include/FreeRTOS.h
    and the amazon patch has paths like this
    diff -rupN org/lib/FreeRTOS/portable/GCC/ARM_CM0/port.c new/lib/FreeRTOS/portable/GCC/ARM_CM0/port.c

    maybe amazon FreeRTOS is not the same source files I generate from STM32CubeMX. I dont know, I hope you can give an advice

    Liked by 1 person

    • Yes, the STM32CubeMX files are different, and most ports from all vendors. The patch file really only applies to the official FreeRTOS releases. I recommend that you open the patch file with a text editor and apply the patches by hand. This is what I did for my port(s)

      Like

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.