Multithread debugging with chibistudio and openocd

Discussions and support about ChibiStudio, the free development environment for ARM.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Multithread debugging with chibistudio and openocd

Post by steved »

Giovanni wrote:Is there a way to specify that "-rtos ChibiOS" on the command line? that would allow me to do that from the Eclipse launcher instead of having to manually change OOCD files (if not possible, it would be worth suggesting this to the OOCD team).


Yes. You can specify one or more configuration files using -f.

The command required has to include the target name (basically, processor type), so will vary by platform.

I've got into the habit of creating a project-specific batch file to start OpenOCD, and it turns out you can create a little file to enable the rtos functionality.

Create a file add_rtos.cfg:

Code: Select all

$_TARGETNAME configure -rtos ChibiOS


My startup batch file now contains:

Code: Select all

C:
cd \ChibiStudio\workspace30\STM32F407_Download
c:\ChibiStudio\tools\openocd\bin\openocd.exe -f stm32f4discovery.cfg -f add_rtos.cfg


On a quick check, that works.

You can give longer paths for files. Or you can specify an additional search directory using the -s command line option to use Chibi-wide files (the OpenOCD script libraries are already in the search path)
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Re: Multithread debugging with chibistudio and openocd

Post by TexZK »

Hi steved,
I'm using ChibiStudio Preview 11, and OpenOCD replaced with its latest 0.9.0-rc1 version. I added "openocd_add_rtos.cfg" to the "<CHIBI_STUDIO>/tools" folder, with the same contents of the "add_rtos.cfg" file you mentioned.

The new Arguments of the external tool are the following:

Code: Select all

-c "telnet_port 4444" -f "interface/stlink-v2.cfg" -f "${file_prompt}" -f "${eclipse_home}/../tools/openocd_add_rtos.cfg"


Although it can find the additional configuration file, I can't get any other threads inside the Debug view, except for the current thread, even when pausing the target after the ChibiOS initialization.
Do you have any advice? I hope this feature will be added to the next ChibiStudio, since it's very useful to analyze the stacks like I can do when debugging host programs with Eclipse.
Post Reply