cancel
Showing results for 
Search instead for 
Did you mean: 

LibUSB Error suddenly appearing

ChrisKiwi
Associate

I am using a MacBook M1 Max (Sonoma 14.6.1) and STM32CubeIDE(1.16.0) with a STM32g0316-disco

board.  

Everything was working fine until, out of the blue, I started getting LibUSB errors when I tried to flash/debug my code.

I tried a second identical dev board and new cables and every usb-c port on my Macbook and the error persists.

 

I brought the machine up in safe mode and the error is still there.  Here is the Error message from the IDE.

libusb: warning [darwin_open] USBDeviceOpen: another process has device opened for exclusive access

Device connect error

 

Error in initializing ST-LINK device.

Reason: libusb: warning [darwin_open] USBDeviceOpen: another process has device opened for exclusive access

libusb: info [darwin_claim_interface] no interface found; setting configuration: 1

libusb: error [darwin_claim_interface] could not set configuration

Failed to connect to device. Please check power and cabling to target.

 
The USB device tree on my Mac shows the 3 USB3.1 Buses with STM32 STLink connected to one of them.  The device is correctly resolved as follows:

 

STM32 STLink:

Product ID: 0x374b
Vendor ID: 0x0483 (STMicroelectronics)
Version: 1.00
Serial Number: 0670FF3936324D5043114936
Speed: Up to 12 Mb/s
Manufacturer: STMicroelectronics
Location ID: 0x00100000 / 1
Current Available (mA): 500
Extra Operating Current (mA): 0

And yet STM32CubeIDE cannot flash the board because it seems to think that (or is told by) Darwin (=MacOS) that the port is not available.

I'm not really sure where the problem is.  I've tried reinstalling LibUSB as well but it makes no difference.  What is particularly annoying is I cannot recall making any changes at all between everything working well and the problem appearing.  I was happily editing my code and from one compile/flash to the next I problem appeared and will not go away.

Any ideas anyone?

1 REPLY 1
Pavel A.
Evangelist III

Reason: libusb: warning [darwin_open] USBDeviceOpen: another process has device opened for exclusive access

Try to find who else has the ST-link opened.