This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SIMPLELINK-OPENOCD: Building Fails — Deprecated Functions on libusb

Part Number: SIMPLELINK-OPENOCD

On macOS 10.13.6, building SIMPLELINK-OPENOCD fails due to a call of a deprecated function in the latest version of libusb 1.0.22.

$ make

[...]

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -I./jimtcl -I./jimtcl -isystem /usr/local/Cellar/libusb/1.0.22/include/libusb-1.0 -I/usr/local/Cellar/libusb-compat/0.1.5_1/include -I/usr/local/Cellar/libusb/1.0.22/include/libusb-1.0 -I/usr/local/Cellar/libftdi/1.4/include/libftdi1 -I/usr/local/Cellar/libusb/1.0.22/include/libusb-1.0 -I/usr/local/Cellar/hidapi/0.8.0-rc1/include/hidapi -I./src/jtag/drivers/libjaylink/libjaylink -I./src/jtag/drivers/libjaylink -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -g -O2 -MT src/jtag/drivers/src_jtag_drivers_libocdjtagdrivers_la-xds110.lo -MD -MP -MF src/jtag/drivers/.deps/src_jtag_drivers_libocdjtagdrivers_la-xds110.Tpo -c src/jtag/drivers/xds110.c -o src/jtag/drivers/src_jtag_drivers_libocdjtagdrivers_la-xds110.o

src/jtag/drivers/xds110.c:344:3: error: 'libusb_set_debug' is deprecated [-Werror,-Wdeprecated-declarations] libusb_set_debug(ctx, LIBUSB_LOG_LEVEL_NONE); ^ /usr/local/Cellar/libusb/1.0.22/include/libusb-1.0/libusb.h:1299:1: note: 'libusb_set_debug' has been explicitly marked deprecated here LIBUSB_DEPRECATED_FOR(libusb_set_option) ^ /usr/local/Cellar/libusb/1.0.22/include/libusb-1.0/libusb.h:89:49: note: expanded from macro 'LIBUSB_DEPRECATED_FOR' #define LIBUSB_DEPRECATED_FOR(f) __attribute__((deprecated)) ^

Solution consists to switch to an earlier release of libusb, e.g. 1.0.21.

$ brew info libusb
libusb: stable 1.0.22 (bottled), HEAD
Library for USB device access
https://libusb.info/
/usr/local/Cellar/libusb/1.0.21 (29 files, 510.4KB)
Poured from bottle on 2017-01-24 at 14:28:02
/usr/local/Cellar/libusb/1.0.22 (29 files, 514.8KB) *
Poured from bottle on 2018-07-25 at 16:12:55
From: github.com/.../libusb.rb
==> Options
--with-default-log-level-debug
Build with default runtime log level of debug (instead of none)
--without-runtime-logging
Build without runtime logging functionality
--HEAD
Install HEAD version

$ brew switch libusb 1.0.21
Cleaning /usr/local/Cellar/libusb/1.0.21
Cleaning /usr/local/Cellar/libusb/1.0.22
4 links created for /usr/local/Cellar/libusb/1.0.21

$ brew info libusb
libusb: stable 1.0.22 (bottled), HEAD
Library for USB device access
https://libusb.info/
/usr/local/Cellar/libusb/1.0.21 (29 files, 510.4KB) *
Poured from bottle on 2017-01-24 at 14:28:02
/usr/local/Cellar/libusb/1.0.22 (29 files, 514.8KB)
Poured from bottle on 2018-07-25 at 16:12:55
From: github.com/.../libusb.rb
==> Options
--with-default-log-level-debug
Build with default runtime log level of debug (instead of none)
--without-runtime-logging
Build without runtime logging functionality
--HEAD
Install HEAD version

I haven't found how to report an issue at the SDO-EMU > OpenOCD repository.

  • Thank you for pointing this out. I will reach out to my colleagues to make them aware of it.

    Regards,
    Chris
  • This issue has already been addressed and the fix will be included in the next release of the TI OpenOCD support.  In the meantime, if you go to the git.ti.com and download a copy of the develop branch, you should be able to build and run OpenOCD with the latest libusb.  Let me know here whether that works for you or not.

  • Thank you for the update. I went through the commits log but couldn't find any mention about libusb, hence my post.

    I see release 1.1 adds support for stand-alone XDS110 Pod.

    The overview section only lists flash programming. Is there a roadmap for featuring debugging?

  • The change was made as part of the XDS110 Pod commit.  libusb deprecated a command used to turn on debug output.  We just removed the offending command (removing it didn't change any functionality in the production build). There wasn't a separate commit just to do that fix.

    To support the various MCU devices, we only needed to add XDS110 code plus flash code for the specific devices.  All other debug functionality for Cortex M cores was already present in OpenOCD. Refer to the OpenOCD documentation for specific debug features.

**Attention** This is a public forum