jtag/mpsse: mpsse_flush should not treat LIBUSB_ERROR_INTERRUPTED as an error
[openocd.git] / src / jtag / drivers / esp_usb_jtag.c
index dd96f4b3954915a776d71d00b4f34dfff70562bc..95040595439e6d8feef01a76aeef8841a8db1f14 100644 (file)
@@ -487,7 +487,7 @@ static int esp_usb_jtag_init(void)
        bitq_interface->in_rdy = esp_usb_jtag_in_rdy;
        bitq_interface->in = esp_usb_jtag_in;
 
-       int r = jtag_libusb_open(vids, pids, &priv->usb_device, NULL);
+       int r = jtag_libusb_open(vids, pids, NULL, &priv->usb_device, NULL);
        if (r != ERROR_OK) {
                LOG_ERROR("esp_usb_jtag: could not find or open device!");
                goto out;
@@ -506,11 +506,13 @@ static int esp_usb_jtag_init(void)
         * 1- With the minimum size required to get to know the total length of that struct,
         * 2- Then exactly the length of that struct. */
        uint8_t jtag_caps_desc[JTAG_PROTO_CAPS_DATA_LEN];
-       int jtag_caps_read_len = jtag_libusb_control_transfer(priv->usb_device,
+       int jtag_caps_read_len;
+       r = jtag_libusb_control_transfer(priv->usb_device,
                LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE,
                LIBUSB_REQUEST_GET_DESCRIPTOR, esp_usb_jtag_caps, 0,
-               (char *)jtag_caps_desc, JTAG_PROTO_CAPS_DATA_LEN, LIBUSB_TIMEOUT_MS);
-       if (jtag_caps_read_len <= 0) {
+               (char *)jtag_caps_desc, JTAG_PROTO_CAPS_DATA_LEN, LIBUSB_TIMEOUT_MS,
+               &jtag_caps_read_len);
+       if (r != ERROR_OK) {
                LOG_ERROR("esp_usb_jtag: could not retrieve jtag_caps descriptor!");
                goto out;
        }
@@ -580,7 +582,8 @@ static int esp_usb_jtag_init(void)
                0,
                NULL,
                0,
-               LIBUSB_TIMEOUT_MS);
+               LIBUSB_TIMEOUT_MS,
+               NULL);
 
        return ERROR_OK;
 
@@ -637,7 +640,7 @@ static int esp_usb_jtag_speed(int divisor)
 
        LOG_DEBUG("esp_usb_jtag: setting divisor %d", divisor);
        jtag_libusb_control_transfer(priv->usb_device,
-               LIBUSB_REQUEST_TYPE_VENDOR, VEND_JTAG_SETDIV, divisor, 0, NULL, 0, LIBUSB_TIMEOUT_MS);
+               LIBUSB_REQUEST_TYPE_VENDOR, VEND_JTAG_SETDIV, divisor, 0, NULL, 0, LIBUSB_TIMEOUT_MS, NULL);
 
        return ERROR_OK;
 }
@@ -648,8 +651,8 @@ COMMAND_HANDLER(esp_usb_jtag_tdo_cmd)
        if (!priv->usb_device)
                return ERROR_FAIL;
        int r = jtag_libusb_control_transfer(priv->usb_device,
-               LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR, VEND_JTAG_GETTDO, 0, 0, &tdo, 1, LIBUSB_TIMEOUT_MS);
-       if (r < 1)
+               LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR, VEND_JTAG_GETTDO, 0, 0, &tdo, 1, LIBUSB_TIMEOUT_MS, NULL);
+       if (r != ERROR_OK)
                return r;
 
        command_print(CMD, "%d", tdo);
@@ -685,7 +688,7 @@ COMMAND_HANDLER(esp_usb_jtag_setio_cmd)
                d |= VEND_JTAG_SETIO_SRST;
 
        jtag_libusb_control_transfer(priv->usb_device,
-               0x40, VEND_JTAG_SETIO, d, 0, NULL, 0, LIBUSB_TIMEOUT_MS);
+               0x40, VEND_JTAG_SETIO, d, 0, NULL, 0, LIBUSB_TIMEOUT_MS, NULL);
 
        return ERROR_OK;
 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)