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:
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’:
To add some ‘icing on top of the cake’: updated Processor Expert components are included:
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.
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:
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).
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
- FreeRTOS and SEGGER Files on GitHub: https://github.com/ErichStyger/McuOnEclipseLibrary
- Processor Expert Port and components: https://github.com/ErichStyger/McuOnEclipse_PEx
- FreeRTOS Kernel on GitHub: https://github.com/FreeRTOS/FreeRTOS-Kernel
- Segger SystemView download page: https://www.segger.com/downloads/systemview/
- Tracing with FreeRTOS: New FreeRTOS V10.0.0: Amazon, Segger SystemView and Percepio Tracealyzer
- FreeRTOS examples and more: https://github.com/ErichStyger/mcuoneclipse
I was just starting a new project with freertos and I saw your post.
You save me a lot of time to patch freertos ! thanks !!
LikeLike
Now I know that my efforts are paying off π
LikeLike
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
LikeLike
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.
LikeLike
Pingback: Steps to use FreeRTOS with newlib reentrant Memory Allocation | MCU on Eclipse
Pingback: RTOS Trace: TraceX with Microsoft Azure RTOS (aka ThreadX) | MCU on Eclipse