i have been spending my day on setting up a new ubuntu 22.04 workstation for working
on my daisy projects. Everything works ok in Arduino IDE (dfu and swd upload) , but unfortunately openocd does resist my efforts.
OS: ubuntu 22.04
Arduino IDE: upload via DFU … works
Arduino IDE: upload via SWD/stlin32 … works
vscode: build and program DFU … works
vscode: build and program … FAILS
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 OpenOCD: Bug Reporting
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ’.
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
and openocd --version provides this:
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
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 OpenOCD: Bug Reporting
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ’.
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
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.12.0+dev-01528-g07141132a (2024-03-08-18:04)
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
Error: The specified debug interface was not found (hla)
The following debug adapters are available:
1: buspirate
Hi I’m just getting off the starting blocks and managed to run into all of the above problems.
But I eventually managed to get the STLink working on Ubuntu 20.04.
/usr/bin/openocd was 0.10, so I followed @tele_player and installed 0.12
I built it from source, but didn’t --enable_stlink when I configured. Then got the error with “buspirate” the only available adapter.
Fixing that I got LIBUSB_ERROR_ACCESS when trying to flash (unless I sudo:ed). In this case I missed the udev rules that you get from the package stlink-tools (apt install stlink-tools)