2

I am trying to enable stlink by configuring openOCD. It is saying it cannot find my libusb-1.x file even though it is installed by virtue of installing openOCD as it is a dependency. I am not sure what to do

Here is the error:

checking for LIBUSB1... no
configure: WARNING: libusb-1.x not found, trying legacy libusb-0.1 as        
a fallback; consider installing libusb-1.x instead
checking for LIBUSB0... no
checking for HIDAPI... no
checking for HIDAPI... no
checking for HIDAPI... no
checking for LIBFTDI... no
checking for LIBFTDI... no
checking for LIBJAYLINK... no
configure: error: libusb-1.x is required for the ST-Link JTAG Programmer

This is my input:

./configure --enable-stlink

What can I do to fix this?

Thank you

Senyo
  • 81
  • 6

3 Answers3

3

You can try to install libusb via

sudo apt-get install libusb-1.0-0-dev

Magee Len
  • 31
  • 2
1

In my case I have to install pkg-config, which suddenly was not installed in my system. Then this error gone.

sudo apt install pkg-config
0

First, install the missing dependency, then configure openOCD while enabling the maintainer mode and FTDI support.

By doing this you will still be able to interface STM32 uCs with ST-Link and FTDI but you will lose JTAG support, but that's ok for non-hard-core stuff.

sudo apt-get install libusb-1.0.0-dev
./configure --enable-maintainer-mode --enable-ftdi
FutureJJ
  • 2,368
  • 1
  • 19
  • 30