Microchip’s MPLAB

THREADX Awareness Plugin for Microchip’s MPLAB IDE

The THREADX RTOS awareness plugin for MPLAB is delivered and installed as a part of the Microchip MPLAB IDE. The plugin facilitates rapid understanding of what is happening in the THREADX application, including information about all application threads and any other application THREADX object. MPLAB provides an overall display showing the Project, Source Code, Watch Lists, and other information in separate windows, each selectively shown or hidden as specified by the user selection. When the program operation changes the value of a displayed variable or object, all window updates are highlighted.

The Thread List

This is arguably the single most important window of the RTOS plugin.

This window shows a list of all threads created by the current application (by calls to tx_thread_create) and some items pertaining to their current state. The currently active thread is indicated by an arrow in the first column (and typically by a state of RUNNING in the State column). The order of the threads is that of the _tx_thread_created_ptr.

You can examine a particular thread by double-clicking on the corresponding row in the window. All debugger windows (Watch, Locals, Register, Call Stack, Source, Disassembly, etc.) will then show the state of the program from the point of view of the thread in question. A thread selected in this way is indicated in the Thread window by a different color (for the moment, a subdued blue color).

The last row of the Thread window is always NO TASK. Double-clicking on this row makes the debugger show the state of the program as it currently is (that is, as it would be shown without an RTOS plugin), in effect always following the active task.

Note that if a task has been selected by double-clicking, the debugger will show the state of that particular task until another task (or NO TASK) is selected, even if execution is performed by or in another task. For example, if task A is currently active (RUNNING) and you double-click on task B, which is READY, you will see information about the suspended task B. If you now perform a single-step by pressing F10, the active task (A) will perform a single-step, but since you are focused on task B, not much will actually visibly change

Debugger Window

The Debugger window shows the source code and/or assembly code for the thread being debugged. Breakpoints may be set at any executable line.

Watch Window

The Watch Window (shown at the right in the display below) enables quick reference to any number of variables of interest. Changes are highlighted in red.




Subscribe to our news