Multi-threaded RTOS debug
Enable RTOS thread view
Set the Enable RTOS Integration checkbox and select from the list of options:
For example, here is how an Embedded GDB Server configuration can be set up using the QEMU emulator:
FreeRTOS/Zephyr tasks view
When debugging a configuration like the one given above, you will see the FreeRTOS/Zephyr tasks listed in the Threads & Variables pane of the debug tool window.
For each task, the variables are presented in the Variables pane.
FreeRTOS objects view
To explore FreeRTOS objects, switch to the FreeRTOS Objects tab. The Task table shows a list of tasks with status information; the Queue table shows currently active queues, semaphores, and mutexes; the Timer table lists the software timers:
For this tab to work correctly, configure the following definitions in FreeRTOSConfig.h:
configUSE_TRACE_FACILITYto 1, for displaying task numbers and queue types.
configMAX_TASK_NAME_LENto a value greater than zero, for displaying the task name properly.
configRECORD_STACK_HIGH_ADDRESSto 1, for displaying the task stack info.
configGENERATE_RUN_TIME_STATSto 1 for collecting runtime info (runtime column of the task table).
configQUEUE_REGISTRY_SIZEgreater than zero and
vQueueAddToRegistry()to assign a name to a queue, semaphore, or mutex. This is useful as queues have no name by default, unlike tasks (which get a name at creation time).
CLion will show a warning in case some of the defines are missing:
FreeRTOS heap view
The FreeRTOS Heap tab shows the current heap usage and memory block allocation for all the default FreeRTOS memory management schemes.