libftdi Archives
|
From: | Jim Hendry <hendryjh@xxxxxxxxx> |
---|---|
To: | libftdi@xxxxxxxxxxxxxxxxxxxxxxx |
Date: | Thu, 28 Feb 2013 18:28:18 -0500 |
OS: ubuntu 12.04 and 12.10 Switching to libusbx made no difference. Things work well if I queue of a bunch of transmits with ftdi_write_data_submit and then use regular synchronous ftdi_read_data to read back the data. Unfortunately, when I move the app to a slower processor the bit error rate shoots way up. My assumption is that receive buffers in libusbx/libftdi are overflowing, although I am not sure how to check this. I anticipate that queuing up reads with ftdi_read_data_submits will alleviate the problem by providing my receive buffers to the underlying code. My data rates are 40Mb/s in each directions (80Mb/s total).
I turned on logging in libusbx and noticed something interesting. When I sent two 512 bytes packets of data, each followed by a 512 byte read, the allocated urbs looked like: [ 0.002312] [00006ba6] libusbx: debug [submit_bulk_transfer] need 1 urbs for new transfer with length 512 [ 0.002325] [00006ba6] libusbx: debug [submit_bulk_transfer] need 1 urbs for new transfer with length 4096
[ 0.002396] [00006ba6] libusbx: debug [submit_bulk_transfer] need 1 urbs for new transfer with length 512 [ 0.002407] [00006ba6] libusbx: debug [submit_bulk_transfer] need 1 urbs for new transfer with length 4096
So it looks like the urbs for reads are always 4096 bytes (or minimum). In this case I could see the [reap_for_handle] msgs showing two 512 bytes writes, and then sometime later a 1030 bytes xfer for the read. So libusx has read back the data. But ftdi_transfer_data_done hangs waiting for the first 512 bytes.
When I switch my packet size to 4096, then I am able to read a few packets (the exact number changes every run) before ftdi_transfer_data_done hangs waiting for a read. If I do a run where there is only ever one outstanding ftdi_read_data_submit then everything is fine. Is there a libftdi limitation to only have one outstanding async read request? The only app that I found that uses ftdi_read_data_submit is urjtag, but it only sends one and then waits for it.
Thanks, Jim On Wed, Feb 27, 2013 at 6:22 PM, Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:
libftdi - see http://www.intra2net.com/en/developer/libftdi for details. |
Current Thread |
---|
|