1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

FTDI FT2232 accesses under Linux much slower than under WinXP

Discussion in 'Embedded' started by harald, Dec 19, 2006.

  1. harald

    harald Guest

    I've got a problem with the FTDI-chip FT2232 running under Linux:

    I have written a small test program for WinXP. The access to the FT2232
    in FIFO-Mode occurs as expected.
    The porting to the Linux system was also successful.

    I use the Evaluationboard "EZ1CUSB 12" of EasyFPGA as hardware. The
    board has a USB connector, a FT2232 chip and a FPGA.
    Linux system: Suse 10.1, Kernel
    FTDI driver software: libftd2xx.so.0.4.10

    When opening the DEVICE the following parameters are adjusted:
    FT_SetUSBParameters (ftHandle, 0 x10000, 0;) // InTransferSize = 64
    FT_SetLatencyTimer (ftHandle, 2); // Latency timer = 2 ms

    To test the data processing speed I call following function in my
    program (ReadBurstFT2232 =):
    [1] The host PC claims a larger amount of data (e.g. 16 Kbytes).
    Therefore we write an instruction (approx. 5 bytes) with a FT_Write
    into the FPGA. The FPGA writes
    the requested data into the FIFO of the FT2232.
    [2] Start for the time measurement.
    [3] The status of the "Receive queue" is as long as queried with
    FT_GetStatus, till 16 Kbytes are available. The number of requests with
    are counted.
    [4] end of the time measurement.
    [5] The 16 Kbytes read into an Array in my program with FT_Read.

    This function "ReadBurstFT2232" is called repeatedly in a loop.
    Great differences during the time measurement (= proportionally to the
    number of FT_GetStatus requests) occours:
    - the first run needs approx. 1000 milliseconds.
    - the next 2 -5 runs needs approx. 250 milliseconds
    - all further runs needs approx. 30 milliseconds in which randomly runs
    occurs from time to time with approx. 150 milliseconds.
    I get comparable transmission delays for reputations -- if I call the
    loops with the "ReadBurstFT2232" requests.
    If I make a delay from approx 1ms [sleep(1)], all runs needs approx.
    1000 milliseconds second.
    Under Windows the different transmission delays don't occur. Every run
    with an amount of data of 16 Kbytes needs approx. 18 milliseconds.

    Has anybody got an idea about this issue? Could it perhaps be a
    resource scheduling issue of the host PC?

    Greetings, Harald
    harald, Dec 19, 2006
    1. Advertisements

  2. harald

    Uwe Bonnes Guest

    At least try with Latency timer = 1 ms and try again. "Latency timer = 0"
    might also be worth a try, but also may make thinhs worse.
    Uwe Bonnes, Dec 19, 2006
    1. Advertisements

  3. Very jumbled post, but it sounds like it might need the
    ASYNC_LOW_LATENCY flag of the tty driver. This disables
    the Nagle-type algorithm of the tty transmit function.
    Clifford Heath, Dec 19, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.