From 7d6dad8546efad7e55a82c3668cef7b49062c05e Mon Sep 17 00:00:00 2001 From: texane Date: Mon, 24 Nov 2014 16:29:09 -0600 Subject: [PATCH] Improve error message for not able to open --- src/stlink-usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stlink-usb.c b/src/stlink-usb.c index d0baa0d..d8b6c46 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "stlink-common.h" #include "stlink-usb.h" @@ -788,7 +789,8 @@ stlink_t* stlink_open_usb(const int verbose, int reset) { } else { int error = libusb_open(list[cnt], &slu->usb_handle); if( error !=0 ) { - WLOG("Error %d opening ST-Link/V2 device %03d:%03d\n", error, libusb_get_bus_number(list[cnt]), libusb_get_device_address(list[cnt])); + WLOG("Error %d (%s) opening ST-Link/V2 device %03d:%03d\n", + error, strerror (errno), libusb_get_bus_number(list[cnt]), libusb_get_device_address(list[cnt])); goto on_error; } } -- 2.30.2