libftdi Archives

Subject: Asynchronous Read Hangs

From: Jim Hendry <hendryjh@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 26 Feb 2013 17:16:51 -0500
I am having problems with ftdi_read_data_submit/ftdi_transfer_data_done blocking instead of returning available data to my app.

The device attached to the FT2232H A interface generates 1 byte for every byte it receives from the FTDI chip. My app schedules a number of writes with ftdi_write_data_submit. Each call of ftdi_write_data_submit is immediately followed by a call of ftdi_read_data_submit to retrieve the generated data. After X ftdi_write_data_submits, ftdi_transfer_data_done is called on the first write ftdi_transfer_control pointer, and then called again with the first read ftdi_transfer_control pointer. ftdi_transfer_data_done never returns waiting for the read data.

I have verified that the device is sending data back to the FTDI chip. Additionally, I linked with a verbose debugging build of libusb and can see that all of the data has been sent and retrieved from the FTDI chip, so I am not sure why ftdi_transfer_data_done hangs instead of returning the first packet.

When I have the device constantly transmit data to the FTDI chip then reads do not hang.

I have tried varying how much data I write before attempting to read any of it back. Anywhere from 262kB to 4MB. I have also tried different xfer sizes: 1 byte, 1kB, 2kB, 8160 bytes.

Is there some minimum (or mandatory) size for xfers?

Using libftdi1-1.0.tar.bz2 and the latest stable libusb-1.0.9.

Thank you for your help,
Jim


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread