[Solved] Error trying to use JTAG debugger: OpenOCD init failed

I just got a Segger J-Link Mini. I’m not having any luck programming the Daisy with it so far. I’m running macOS 10.14.6. I’m not sure what else to try. Is there a step I’ve missed?

  • I can program the Daisy directly through build_and_program_dfu.
  • I’ve downloaded and installed the driver from Segger’s website.
  • I’ve installed the Cortex-Debug VS Code extension.
  • The Daisy is powered from its USB port.
  • The J-Link is connected to a USB port on the Mac and its green LED is on.
  • The J-Link is connected to the Daisy. I’m pretty sure the cable is oriented correctly (see photo).
  • The output from make program 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
        http://openocd.org/doc/doxygen/bugs.html
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
Error: open failed
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

make: *** [program] Error 1

replace “interface/stlink.cfg” with “interface/jlink.cfg” perhaps ?
I haven’t had the experience - I’m on windows and st-link v3

it can be edited in “libdaisy/core/Makefile” line 19

Thanks, that got me on the right track. Instead of editing the Makefile, I can set the environment variable PGM_DEVICE=interface/jlink.cfg. I also changed my project’s launch.json to use jlink.cfg instead of stlink.cfg. Now I’m up and running!

1 Like