RTOS Details - nxp-mcuxpresso/vscode-for-mcux GitHub Wiki
The RTOS DETAILS view shows various information about RTOS Tasks/Threads. The view appears in the bottom pane, once a debug session is started, and disappears after debugging ends.
Once the target is suspended, the view will try to detect the RTOS type and read information about the tasks/threads. Every time the target stops (suspended or stepped), the RTOS DETAILS view will refresh with updated information. The view is independent of the debug probe being used, as it only uses GDB commands to receive information from the target.
The supported RTOS's are:
Once the RTOS type is detected, the RTOS threads/tasks are displayed in a table, along with various information for each thread. General capabilities of the table:
- Resize columns by dragging their edges.
- Sort columns by clicking on them.
- Hover over each cell and header to get more information.
- Color rows by task/thread state.
- Display warning icons when missing certain RTOS configurations. The warning icons can be hovered for more help on how to solve the issue.
- Refresh button in the top right corner for re-reading the data from the target's memory.
Task information is available once the FreeRTOS scheduler has started. Thus, it does not appear straight after loading the application when the default breakpoint on main()
is reached.
Some columns might show a warning icon. Hovering over the icon will reveal the macro that needs to be modified inside the FreeRTOSConfig.h
header file included in the FreeRTOS source distribution.
Note: For west-based MCUXpresso SDK 24.12 or newer, the
FreeRTOSConfig.h
header file is not included in the imported project. Instead, create aprj.conf
file in the project's folder and set the symbols using the following syntax:CONFIG_<symbol name>=<value>
. For example, to enableconfigRECORD_STACK_HIGH_ADDRESS
,prj.conf
should contain the following line:CONFIG_configRECORD_STACK_HIGH_ADDRESS=y
. See Configuration System Based on Kconfig for more information.
For FreeRTOS, the following columns are available:
-
TCB#: Task Control Block.
configUSE_TRACE_FACILITY
needs to be set to 1. -
Task Name: Name of task.
configMAX_TASK_NAME_LEN
needs to be greater than 1. - Task Handle: Address of the task handle.
- Task State: Current task state. Rows are also colored based on the state.
- Priority: Task actual priority and task base priority.
-
Stack Usage: Graphical view of current stack usage, peak usage and total size for the task. Hovering over the cell reveals more information about the stack.
configRECORD_STACK_HIGH_ADDRESS
needs to be set to 1. -
Runtime: Task runtime with percentage value.
configGENERATE_RUN_TIME_STATS
needs to be set to 1.
Some columns might show a warning icon. Hovering over the icon will reveal the configuration symbol that needs to be set. Usually, these symbols can be set using the prj.conf
file located in project's folder. See Setting Kconfig configuration values for more information.
CONFIG_THREAD_MONITOR
needs to be enabled to extract the required thread information from the Zephyr RTOS kernel.
For Zephyr, the following columns are available:
-
Name: Name of the thread.
CONFIG_THREAD_NAME
needs to be enabled. - Handle: Address of the thread handle.
- Priority: Priority of the thread.
- State: Current task state. Rows are also colored based on the state.
-
Stack Usage: Graphical view of the stack delta offset, current usage and total size for the thread. Hovering over the cell reveals more information about the stack.
CONFIG_THREAD_STACK_INFO
needs to be enabled.
Stack peak usage is determined by reading the stack memory and finding the first byte that doesn't match the initial fill value of the stack (known as the high watermark). Because this operation can be expensive at runtime, stack peaks can be disabled via the setting mcuxpresso.rtos.displayStackPeaks
.
Note: Currently, the high watermark is only computed for FreeRTOS.