Openocd error "Can't find interface/stlink.cfg"

Hello, I’m having trouble getting ST Link-V3 debugger working with my Daisy Patch. I’m running Ubuntu 20.04.

I’m trying to flash blink onto my Patch. Steps I’m taking:

  1. Connect a USB data cable to the ST Link-V3, connect the ST Link-V3 to the Daisy Seed on my Daisy Patch, centered over the pins with the red stripe facing in the correct direction as per the documentation
  2. Power on Daisy Patch
  3. In a clone of the official daisy examples project, navigate to seed/Blink
  4. Run make clean; make; make program (I had trouble getting the vscode tasks to work so I just copied the make commands that the task “build_and_program” executes)

I get the following error from openocd during execution:

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.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:60: Error: Can't find interface/stlink.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
make: *** [../../libdaisy/core/Makefile:270: program] Error 1

Could anybody help me figure out what I’m doing wrong? Thanks!

Where did you install openocd from? The version 0.11.0 we bundle with the daisy toolchain includes a file scripts/interface/stlink.cfg. That’s here.

Apparently older versions come with a differently named version of that file. something like stlink-v2.cfg.

So the first two things I’d check are: “which version of openocd do I have?”. With openocd --version.

And “do I have that file or some variation of it?” For that you’ll need to cd to the folder where openocd is installed for you and look into the interface folder wherever it is.

Hi Ben, thanks for the reply.

This must be my problem then. I installed openocd via sudo apt-get and it looks like I have 0.10.0

ev@ubuntu:~/dev/daisy-projects$ openocd -v
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html

I’ll figure out how to get 0.11.0 installed. Thank you!

Seems like a likely cause, please report back what you find!
Makes me a bit wary since that’s the way we recommended people install it and I was under the impression the version distributed through apt was good.

Hello,
I also ran into this problem, apt still includes 0.10.0, i found that building openocd from source worked for me. I thought it might be useful to write out some instructions of what i did. I’m a Linux newbie so i presume there are others too and hope this helps a bit even if it’s slightly incomplete or what-not.

// well i started by removing the version that sudo apt-get install openocd gave me, which was 0.10.0
$ sudo apt-get remove openocd

// Website https://openocd.org/pages/documentation.html
// clone repo
$ git clone https://git.code.sf.net/p/openocd/code openocd-code
$ cd openocd-code

// read the "README" :)

// from the README
// check/gather dependencies
$ libtool -v
$ pkg-config --version
$ libtool --version
$ autoconf --version
$ automake --version
$ texinfo --version


// install missing dependencies
$ sudo apt install autoconf
$ sudo apt install automake
$ sudo apt-get install libtool

// make openocd, i went for 0.11.0
$ git checkout v0.11.0
$ git submodule init
$ git submodule update --init --recursive
$ ./bootstrap
$ ./configure
$ make
$ sudo make install

//verify installation/version
$ which openocd
$ openocd --version
2 Likes

Thanks for the info, mos!

Okay this is ancient, but I ran into the same problem and fixed it. Running Windows 11

My steps:

  1. Download and run latest firmware for my STLink-V3-MINIE from the STM website
  2. Download and install the driver for the same thing
  3. Download and extract the latest openocd from here
  4. Figure out where my DaisyToolchains openocd is located (by running which openocd in the VSCode-Terminal. In my case that spit out a Linux path: /c/Program Files/DaisyToolchain/bin/openocd. I manually converted it to a windows path (C:/Program Files/DaisyToolchain/bin/openocd.exe (note the `.exe)) and checked for the file
  5. Rename the old file to openocd.exe.old, just in case you need it later
  6. Put all files from the openocd bin folder into the bin folder of the DaisyToolchain
  7. Same for share and driver

This should now work.

1 Like