starting openocd with debug launcher

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

Moderators: tfAteba, barthess, RoccoMarco, lbednarz, utzig

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

starting openocd with debug launcher

Postby JessicaB » Thu Nov 21, 2024 6:48 am

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: 833
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 137 times

Re: starting openocd with debug launcher

Postby steved » Thu Nov 21, 2024 9:48 am

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: 14556
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1106 times
Been thanked: 937 times
Contact:

Re: starting openocd with debug launcher

Postby Giovanni » Thu Nov 21, 2024 10:21 am

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

Postby JessicaB » Sat Nov 23, 2024 5:27 am

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: 14556
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1106 times
Been thanked: 937 times
Contact:

Re: starting openocd with debug launcher

Postby Giovanni » Sat Nov 23, 2024 8:36 am

Hi,

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

Giovanni


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 27 guests