Commit aa29f083 authored by Spencer Oliver's avatar Spencer Oliver
Browse files

stlink: correctly signal stlink_interface_open failure

give the user a error msg on open failure.

Change-Id: If4a57bac7f3e1746c2a05c7a96747a38da188041
Signed-off-by: default avatarSpencer Oliver <>

Tested-by: jenkins
Reviewed-by: default avatarMathias Küster <>
parent 0cccdde3
......@@ -609,7 +609,7 @@ int stlink_usb_open(struct stlink_interface_param_s *param, void **fd)
if (jtag_libusb_open(vids, pids, &h->fd) != ERROR_OK) {
LOG_DEBUG("stlink_open_usb: open failed");
LOG_ERROR("stlink_open_usb: open failed");
return ERROR_FAIL;
......@@ -142,10 +142,11 @@ static int stlink_transport_init(struct command_context *cmd_ctx)
if (!t) {
LOG_ERROR("stlink_transport_init: no current target");
return ERROR_FAIL;
int retval = stlink_interface_open();
if (retval != ERROR_OK)
return retval;
return stlink_interface_init_target(t);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment