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.

FreeRTOS

FreeRTOS Tasks

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.

Zephyr

Zephyr Threads

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

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.