From 57a0e313894df85b1472dfe128c983eead6059ed Mon Sep 17 00:00:00 2001 From: Lucien Dufour Date: Fri, 21 Nov 2025 19:13:30 +0100 Subject: [PATCH] jtag: xds110: Add libusb_open() result to error log When not having access to the usb devices, but using the xds110, the issue is that one first has to spend time to find the problem. The additional error message helps others at finding this issue faster. Solution: "xds110.c:378 usb_connect(): libusb_open(): LIBUSB_ERROR_ACCESS" Change-Id: Ic59e29d4dd06868920c2b912e4c866d4f176a563 Signed-off-by: Lucien Dufour Reviewed-on: https://review.openocd.org/c/openocd/+/9265 Tested-by: jenkins Reviewed-by: Antonio Borneo --- src/jtag/drivers/xds110.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c index a2b0dd213..75d6a4f81 100644 --- a/src/jtag/drivers/xds110.c +++ b/src/jtag/drivers/xds110.c @@ -373,6 +373,9 @@ static bool usb_connect(void) /* If we fall though to here, we don't want this device */ libusb_close(dev); dev = NULL; + } else { + const char *err_msg = libusb_error_name(result); + LOG_ERROR("libusb_open(): %s", err_msg); } } }