So far I have covered in this tutorial series how to install ARM GNU gcc, adding Eclipse, followed by adding GNU GDB debugger, and then adding Processor Expert. I’m using FreeRTOS a lot in my projects, and luckily there is a Kernel Awareness Plugin available for FreeRTOS for GDB in Eclipse. This tutorial is about how to install and use it.
List of Tutorials
- Part 1: Setting up ARM GNU tool chain
- Part 2: Setting up Eclipse IDE
- Part 3: Setting up the debugger (P&E and Segger)
- Part 4: Setting up Processor Expert
- Part 5: Setting up FreeRTOS Kernel Awareness
- Part 6: Linux Host Support with OpenOCD and CMSIS-DAP
- Part 7: GNU ARM Eclipse Plugins
- Part 8: Processor Expert with GNU ARM Eclipse Plugins
- Part 9: DIY Free Toolchain for Kinetis: Part 9 – Express Setup in 8 Steps
- Part 10 – Project Creation with GNU ARM Eclipse 2.1.1
Debugging gets a bit more complicated with an RTOS: as each task has its own stack, the debugger normally does not know which other tasks exists. As such, if I stop my program/task, then the debugger will just show the current context and task. CodeWarrior for MCU10.x comes with Kernel Awareness for MQX, but not for FreeRTOS.
What a kernel awareness plugin does is to give other information to the debugger about the RTOS. For this it needs to read the RTOS information from the target. Unfortunately, as this is dependant of the debugger, such a kernel awareness needs to match the debugger used. Other debuggers like Keil, IAR, Atollic or Lauterbach have implemented a FreeRTOS kernel awareness into their debugger. What we need here is a FreeRTOS Kernel Awareness for Eclipse and GDB.
State Viewer Plugin from Wittenstein
HighIntegritySystem/Wittenstein produces commercial version of FreeRTOS (SafeRTOS, OpenRTOS) provides a free Eclipse GDB FreeRTOS Kernel Awareness plugin which works with their products and the ‘normal’ FreeRTOS.
- Go to http://www.highintegritysystems.com/down-loads/stateviewer-plug-in/
- You need to register to receive an email with instructions to download and install the Eclipse plugin. Basically it gives you a PDF and the link to the Eclipse updater to download the plugin
Kernel Awareness Views
After installation, I have set of new views available accessible with the menu Window > Show Views:
Altough they are under ‘OpenRTOS’ and ‘SafeRTOS’, they work very well with normal FreeRTOS. The views with the (DSF) suffix to not work with normal GDB (I’m using), they would would need a debugger with DSF (Debugger Services Framework) extension. So I’m using the ‘normal’ views.
Task Table View
The Task Table View shows the current state of all tasks:
Queue Table View
In order to display the queues, I need to configure the RTOS to use a registry for their names. I specify the number of queues in the FreeRTOS properties:
Additionally, in my sources I have to give it a name with
QUEUE_StdIn = xQueueCreate(QUEUE_LENGTH, QUEUE_ITEM_SIZE); vQueueAddToRegistry(QUEUE_StdIn, (signed char*)"QUEUE_StdIn");
With this, my registered queues are shown in the Queue Table view:
With the FreeRTOS task awareness plugin, I can visualize the tasks and queues in Eclipse. The views are available for free from the Wittenstein web site after registration. Even if the views are very simple, they help to have an overlook what is going on in the system.
Happy Awarenessing 🙂