OpenOCD with ST-LINK v3 mini (resolved)

Update: The issue got resolved by installing the latest version of openocd. All works well if I install do brew install openocd --HEAD instead of brew install openocd, i.e., use 0.11.0+dev-00562-g5ab74bde0 instead of 0.11.0. This resolves the segfault!

I got an ST-LINK v3 mini which I’d like to use instead of flashing via USB in DFU mode for better debugging. Flashing via USB in DFU mode works as it should (both using the web interface as well as make program-dfu).

Unfortunately, however, I get a segfault when I try to flash via the ST-LINK v3 mini both using task build_and_program in VSCode as well as make program on the command line.

The error, e.g., when using the Blink example, is:

openocd -s /usr/local/share/openocd/scripts -f interface/stlink.cfg -f target/stm32h7x.cfg \
                -c "program ./build/Blink.elf verify reset exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1800 kHz
make: *** [program] Segmentation fault: 11

Any help would be much appreciated!

Additional notes:

  • The programmer is detected as a USB device and mounted
  • The seed is powered externally
  • I have triple checked that cable orientations are correct
  • My OpenOCD version is up-to-date
  • The USB cable is the same that works for flashing in DFU mode via USB
  • I’m on macOS Monterey
  • Full output of openocd -f interface/stlink.cfg -f target/stm32h7x.cfg -c init -c "reset init" -d3
  • I tried running openocd via gdb to get a stacktrace but unfortunately it seems stuck in an endless loop without returning.

This worked for me as well. Thanks for posting the update!


Hi, what resolved this issue for you? Having the same problem, exactly as described by op

Just in case: See Update: … at the very top of my original post to read how I resolved it back then

Yep. To verify, updating to the latest version of openocd did the trick. I happen to be running version 0.11.0+dev-00590-g2586fec92.

Wow you guys are quick! And I am bad at reading :smiley: ill try that, thank you!
Update: It worked!