starting openocd with debug launcher

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
JessicaB
Posts: 2
Joined: Thu Nov 21, 2024 6:35 am

starting openocd with debug launcher

Post by JessicaB »

I'm new to ChibiOS and ChibiStudio/eclipse.
I'm using a ST-Link to debug. I want to click the Build/flash/run launcher and have it start OpenOCD. Currently I have to go to the external tools menu to find 'OpenOCD on STLink'. In addition, after clicking that I have to navigate to 'C:\ChibiStudio\tools\openocd\scripts\target\stm32f4x.cfg'. This is rather annoying. Can't the project remember which debugger and config I use?
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: starting openocd with debug launcher

Post by steved »

I just create a small batch file in the project directory which starts up openOCD in a project-specific way, such as:

Code: Select all

REM starts in the Eclipse directory
cd ..\tools\openocd\
REM bin\openocd -s "scripts" -f board/st_nucleo_f7.cfg -l /Temp/Chibi/oocd.log -f add_rtos.cfg
bin\openocd -s "scripts" -f board/st_nucleo_f7.cfg -c "$_TARGETNAME configure -rtos chibios"

(The commented out statement adds console output to a log file, rather than displaying it).
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: starting openocd with debug launcher

Post by Giovanni »

JessicaB wrote:I'm new to ChibiOS and ChibiStudio/eclipse.
I'm using a ST-Link to debug. I want to click the Build/flash/run launcher and have it start OpenOCD. Currently I have to go to the external tools menu to find 'OpenOCD on STLink'. In addition, after clicking that I have to navigate to 'C:\ChibiStudio\tools\openocd\scripts\target\stm32f4x.cfg'. This is rather annoying. Can't the project remember which debugger and config I use?


Hi,

You could "clone" the "OpenOCD on STLink" launcher and replace the prompt with a fixed path to a script.

1) External Tools Configuration... in the tools menu.
2) Select "OpenOCD on STLink" under "Programs".
3) Duplicate button and give the clone a better name.
4) In the arguments box replace "${file_prompt}" with your fixed path.

You can have as many launchers you want.

Giovanni
JessicaB
Posts: 2
Joined: Thu Nov 21, 2024 6:35 am

Re: starting openocd with debug launcher

Post by JessicaB »

This made it easier.

Eclipse seems to be very configurable, and I think that makes it a bit confusing for beginners to change how it works from out of the box. I'm starting to get it.

Thanks for help!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: starting openocd with debug launcher

Post by Giovanni »

Hi,

True, Eclipse is confusing initially but then things start to make sense and it becomes very powerful.

Giovanni
Post Reply