From: texane Date: Mon, 24 Nov 2014 22:29:09 +0000 (-0600) Subject: Improve error message for not able to open X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7d6dad8546efad7e55a82c3668cef7b49062c05e;hp=23e03fa07428610cb67cfb2dcea720de20a3b778;p=fw%2Fstlink Improve error message for not able to open --- 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; } }