I've developed a RTOS plugin for SEGGER J-link, and I thought it could be of interest for someone. SEGGER's license doesn't allow me to publish the source code.
The plugin allows GDB to obtain info from the executing threads, so that the IDE can show the different threads in the system, and unwind the stack for each frame:
Much of the code comes from the OpenOCD ChibiOS integration, so the functionality of the two plugins should be similar. Some functionality is not implemented:
- setting the CPU registers of non-current threads. All CPU register modifications are done to the CPU registers directly, and not to the stacked registers of each thread.
- reading/setting the ISR-stacked CPU registers (R0~R3... etc, port_intctx) of non-current threads. The read values are always 0.
- reading/setting the floating-point registers and the floating-point status registers
I've only tried it with the STM32F407. It may work with the Cortex-M3, M0, M0+, and all Cortex-M4F, but that's not tested.
- copy the DLL to C:\Program Files (x86)\SEGGER\JLink_xxx\GDBServer\
- start the GDB server with the following additional argument:
Code: Select all