Page 1 of 1

SEGGER J-link ChibiOS RTOS awareness plugin

Posted: Fri Sep 27, 2019 5:52 pm
by dismirlian
Hi all,

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:

rtos_plugin.jpg


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.

To use:
- copy the DLL to C:\Program Files (x86)\SEGGER\JLink_xxx\GDBServer\
- start the GDB server with the following additional argument:

Code: Select all

-rtos GDBServer/RTOSPlugin_ChibiOS


Regards,
Diego.

Re: SEGGER J-link ChibiOS RTOS awareness plugin

Posted: Tue Nov 26, 2019 9:42 pm
by faisal
Hey Giovani, looks interesting ya :)