Hello,

it looks like the latest ftdi code checks for ftdi->usb_dev not null
before doing anything else. this breaks the libftdi driver for windows
(cross-compiled using mingw32 on debian)

here is the ftdi code :

int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
{
    if (ftdi == NULL || ftdi->usb_dev == NULL)
        ftdi_error_return(-2, "USB device unavailable");

    switch (interface)
    {
        case INTERFACE_ANY:
        case INTERFACE_A:
            /* ftdi_usb_open_desc cares to set the right index,
depending on the found chip */
            break;
        case INTERFACE_B:

The following patch fixes it :

diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c
old mode 100644
new mode 100755
index 38195c7..3ea6246
--- a/src/jtag/drivers/ft2232.c
+++ b/src/jtag/drivers/ft2232.c
@@ -2196,11 +2196,11 @@ static int ft2232_init_libftdi(uint16_t vid,
uint16_t pid, int more, int* try_mo
        /* default to INTERFACE_A */
        if(channel == INTERFACE_ANY) { channel = INTERFACE_A; }

-       if (ftdi_set_interface(&ftdic, channel) < 0)
-       {
-               LOG_ERROR("unable to select FT2232 channel A: %s",
ftdic.error_str);
-               return ERROR_JTAG_INIT_FAILED;
-       }
+//     if (ftdi_set_interface(&ftdic, channel) < 0)
+//     {
+//             LOG_ERROR("unable to select FT2232 channel A: %s",
ftdic.error_str);
+//             return ERROR_JTAG_INIT_FAILED;
+//     }

        /* context, vendor id, product id */
        if (ftdi_usb_open_desc(&ftdic, vid, pid, ft2232_device_desc,

Not sure if it is the best solution, but seems to work.

Regards

Francois
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to