Pregunta

I am using FT2232H in SYNC FIFO FT245 mode and I can't get it working on Linux, my code is perfectly working on Mac OS X, but it doesn't on Linux.

I have installed both libftdi1 and libftdi-dev packages.

Relevant parts of code:

    #define PID 0x6010

    .
    .
    .

    if(vftdic == NULL)
    {
        this->ftdic = static_cast<struct ftdi_context*>(malloc(sizeof(struct ftdi_context)));
    }
    else
    {
        this->ftdic = vftdic;
    }
    int f;
    // Init 1. channel
    if (ftdi_init(ftdic) < 0)
    {
        throw DeviceException("ftdi_init failure\n", FTDI_ERROR);
    }
    ftdi_set_interface(ftdic, INTERFACE_A);
    f = ftdi_usb_open(ftdic, 0x0403, PID);
    if (f < 0 && (f != -5))
    {
        //here f is equal to -8 only on Linux
        throw DeviceException("Unable to open FTDI device, channel A\n", FTDI_ERROR);
    }

Here is listing from lsusb:

Bus 001 Device 005: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC

All hardware used is the same (MacBook Pro 2010 + my usb device with ft2232h).

¿Fue útil?

Solución 2

In addition to making sure you have permission to the device node, you must verify that no other driver (such as a USB serial driver which normally ships with a linux distribution) has claimed the interface.

Otros consejos

Does the user account you're using have permissions to access the raw USB bus? Check permissions of the device file corresponding to your FTDI located somewhere below /dev/bus/usb – most like you don't have permissions to access it.

In that case add some UDev rules to place the device file in the ownership of some dedicated group and and add yourself to the members of this group.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top