2021-03-31 01:17 AM
When trying to use the debug function in CubeIDE on Linux I get an udev related error. It works most of the time, but at some functions it stops and the debugger drops out. See below for technical details as well as a workaround.
Details
OS: Kubuntu 18.04
Kernel Version: 4.15.0-140-generic
Error in CubeIDE (v1.1.6): `libusb: error [udev_hotplug_event] ignoring udev action bind`
udev Version: 10.45
Board: STEVAL-STWINKT1
Debugger: STLINK-V3MINI
See attached screenshot of syslog and cubeIDE:
Workouround
Disabling the udev service via systemctl fixes the issue, using this example bash script:
#!/bin/bash
#simple script to enable/disable udev
#------------------------------------
#why? gives error when debugging
# THIS IS ONLY A WORKAROUND, NOT A FIX!
#------------------------------------
#How to use:
# (1) connect board and programmer to USB port
# (2) run this script as root with option stop
# (3) ...debug... (note: hotplug, device allocation won't happen anymore)
# (4) run this script as root with option start
COMMAND='stop'
if [[ $1 != 'start' && $1 != 'stop' ]]; then
printf "Write either...\nstop\tstop udev and related sockets or\nstart\tstart udev and related sockets\n"
exit
fi
if [[ $1 == 'start' ]]; then
COMMAND='start'
fi
systemctl $COMMAND systemd-udevd-control.socket
systemctl $COMMAND systemd-udevd-kernel.socket
systemctl $COMMAND udev.service
Of course this is only a workaround. In general one does not want to disable udev.