St-linkv2 openocd error

HI peeps, so I was trying to find my previous post about using the stlink cause my usb came off again and well I don’t want to mess it up again so I found the topic but when I try to use openocd I get this following.

sudo ./openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/target/stm32l4x.cfg -c "program /tmp/arduino_build_245212/ProffieOS.ino.elf verify reset exit"
[sudo] password for max: 
./openocd.bin: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory

Google says:

broken link to the download. but I’ll take note of the package and try to find it.

apt-get update
apt-get install libudev0

the libudev0 version in that other link is out dated. the current version is 200 not 195. thanks this resolved the issue. actually it borked my laptop and I reinstalled my ubuntu desktop. alas I lost my config so I’m rebuilding.

I’m haven’t been able to use this version of ubuntu.

Linux Heironymous 5.19.0-50-generic #50-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 18:24:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

I may see if the 32 bit version of the arduino may work

This is your linux kernel version, not your ubuntu version.
To get the ubuntu version, use lsb_release -a.
Also, if you actually want help, I need to know what the problem actually is.
Is it still libudev.so.1: cannot open shared object file ?

1 Like

I need to retry the st-link but yes it was the same error the last time I tried.

o LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

the command I am using is this.

/home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/linux/openocd/bin/openocd -s /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/ -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/interface/stlink-v2.cfg -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/target/stm32l4x.cfg -c “program ./ProffieOS.ino.elf verify reset exit”

ERROR:
/home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/linux/openocd/bin/openocd.bin: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory

I think the openocd which comes with the arduino-proffieboard is too old now.
However, I think that most linux distributions comes with an openocd that is new enough to support stm32l433, so maybe just run apt install openocd and try that version instead?

1 Like

oh great. thanks man.

I got this error after inputted the following

/usr/bin/openocd -s /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/ -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/interface/stlink-v2.cfg -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/target/stm32l4x.cfg -c “program ./ProffiOS.ino.elf verify reset ext”

Error:

How about:

openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg  -c “program ./ProffiOS.ino.elf verify reset ext”

?

local permissions

max@Heironymous:/tmp/arduino_build_46699$ openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ./ProffieOS.ino.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
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate

Info : clock speed 500 kHz
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

ROOT

max@Heironymous:/tmp/arduino_build_46699$ sudo openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ./ProffieOS.ino.elf verify reset exit"
[sudo] password for max: 
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate

Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.274468
Info : STM32L433.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for STM32L433.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000040 msp: 0x2000c000
** Programming Started **
Info : device idcode = 0x10016435 (STM32L43/L44xx - Rev Z : 0x1001)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08038a68 .. 0x08038fff
Error: failed erasing sectors 0 to 113
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L433.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
** Programming Failed **
shutdown command invoked

This seems to indicate a poor link.
Or possibly that your proffieboard doesn’t have enough power? (USB or battery)

Is GND connected between the ST-link and the proffieboard?

yes it is.

it’s battery cause the usb fell off again.

should I connect the charger to it or is that not enough?

USB

CONNECTION

PROFFIE

the wiring guide I’m using looks the same.

proffiewiring

Battery power should be enough.
However, if you just stuck a wire into the hole, that might be why the connection is bad.

I added the charger and I got the following error and this did work previously.

 sudo openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ProffieOS.ino.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
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate

Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.281437
Error: init mode failed (unable to connect to the target)
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked