#include <stdint.h>
#include <time.h>
#include <sys/types.h>
-#include <libusb-1.0/libusb.h>
+#include <libusb.h>
#include "stlink-common.h"
#include "stlink-usb.h"
size = send_recv(slu, 1, cmd, slu->cmd_len, rdata, rep_len);
if (size == -1) {
printf("[!] send_recv\n");
- return;
+ return 0;
}
return read_uint32(rdata, 4);
}
slu->usb_handle = libusb_open_device_with_vid_pid(slu->libusb_ctx, USB_ST_VID, USB_STLINK_32L_PID);
if (slu->usb_handle == NULL) {
- // TODO - free usb context too...
WLOG("Couldn't find any ST-Link/V2 devices");
goto on_error;
}
stlink_enter_swd_mode(sl);
}
+ stlink_reset(sl);
+ stlink_load_device_params(sl);
stlink_version(sl);
error = 0;