diff options
Diffstat (limited to 'src/jtag/drivers/mpsse.c')
-rw-r--r-- | src/jtag/drivers/mpsse.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jtag/drivers/mpsse.c b/src/jtag/drivers/mpsse.c index d6cbc84..92f9331 100644 --- a/src/jtag/drivers/mpsse.c +++ b/src/jtag/drivers/mpsse.c @@ -55,6 +55,7 @@ #define FTDI_DEVICE_OUT_REQTYPE (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE) #define FTDI_DEVICE_IN_REQTYPE (0x80 | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE) +#define BITMODE_RESET 0x00 #define BITMODE_MPSSE 0x02 #define SIO_RESET_REQUEST 0x00 @@ -315,6 +316,19 @@ struct mpsse_ctx *mpsse_open(const uint16_t *vid, const uint16_t *pid, const cha err = libusb_control_transfer(ctx->usb_dev, FTDI_DEVICE_OUT_REQTYPE, SIO_SET_BITMODE_REQUEST, + 0x0b | (BITMODE_RESET << 8), + ctx->index, + NULL, + 0, + ctx->usb_write_timeout); + if (err < 0) { + LOG_ERROR("unable to reset bitmode: %d", err); + goto error; + } + + err = libusb_control_transfer(ctx->usb_dev, + FTDI_DEVICE_OUT_REQTYPE, + SIO_SET_BITMODE_REQUEST, 0x0b | (BITMODE_MPSSE << 8), ctx->index, NULL, |