PEmicro Blog

PEmicro Introduces OS-Aware Debug Support for Azure RTOS ThreadX

by Juan See on Oct 13, 2021

With version 5.1.4 of PEmicro's GDB Server for ARM devices, initial support for Azure RTOS ThreadX is now available. The user does not have to do anything to set it up; the GDB server will automatically detect the presence, type, and configuration of an OS by the querying the application's symbol table for identifying characteristics. Using these discovered symbols, the debugger can traverse the kernel's internal data structures to enumerate the available threads and their corresponding execution context. This information is then used to dynamically populate the Eclipse views as the user navigates between the threads. 

Getting Started

PEmicro GDB ThreadX support can be added into many Eclipse IDEs including :

For this example, NXP's MCUXpresso IDE is being used in conjunction with the MCUXpresso SDK installer with the Azure RTOS ThreadX option enabled. 

Figure 1 : Enable Azure RTOS option in MCUXpresso SDK installer

The MCUXpresso SDK installer will include an Azure RTOS ThreadX example: 

Figure 2 : Azure RTOS ThreadX example

Debugging The ThreadX Example

Debugging the ThreadX example is just as easy when using a PEmicro debug probe in combination with the GDB server plugin. Upon creation of the new example project, the IDE will automatically generate a debug profile that can immediately be used to debug the target using the default settings.

Figure 3 : PEmicro Debug Configuration

Upon successful detection of a ThreadX OS, the server will print "Successfully initialized kernel symbols." to the console window. 

Figure 4 : ThreadX detected

Also, once the server detects that the scheduler has started it will print out "Kernel thread information now available." to the same console. 

Figure 5 : ThreadX scheduler started

Thread Information in Eclipse Views

At this point, thread information will begin to appear in the Eclipse views. These can be a quick ways of diagnosing problems with the project's setup in case auto detection fails.

With OS aware debugging enabled, all of these threads will be visible in the debug view of Eclipse. Here the stack trace, execution state, and name of each thread is visible. The most useful feature of this view though is that it allows the user to dynamically update the content of each Eclipse view to match any point of interest. For example, the code view can be updated to reflect the current program counter of another thread by simply clicking the point in the stack trace. 

Dynamic ViewsFigure 6 : ThreadX visible threads

Interested users can get it now by updating an existing installation or installing it directly from the PEmicro Eclipse update site.

Tags related to this Blog Post

GDB Server     ARM     NXP     Debug