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
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

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.

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
// clone repo
$ git clone 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

Thanks for the info, mos!