libftdi Archives

Subject: RE: Release 0.15 and the ft2232 data loss.

From: "David Challis" <dchallis@xxxxxxxxxxxxx>
To: <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 20 Mar 2009 13:05:52 -0700
Here is a some more information on my setup.  

On the camera side, we have a ft2232H, running a single channel in high
speed async fifo mode.  Data rate to the host is 800kbytes per second max.
Data flow from the camera microprocessor to the ft2232H is regulated by the
ft2232H asserting/de-asserting the TXE# pin.  

The Linux test host is an eMachines T5224. Dual Core Pentium D 820 2.8 Ghz
with 1 GB ram.  Intel 945 / NH82801 chipset. Testing with Fedora 10.
Current libftdi is 0.15. As I said above, this setup works perfectly with
the ft245bl.  Switching to the ft2232H causes the data loss.

This setup with the ft2232H works without data loss on Windows and works
with a ft245BL in place of the ft2232H on both Windows and Linux, so we know
the camera interface is correct.

The test case that fails is very simple:

The host opens a connection to the ft2232H.  4 bytes of data are written
from the host to the camera. The camera responds with 128 bytes back to the
host.  The host issues two read requests.  One for 2 bytes (to get the
packet data size) and then one for the remaining bytes to be sent.  The
second read times out and does not receive the entire 128 bytes sent by the
camera.  

Looking at the buffer after each failure show that the data loss is not
consistent.  The data sent by the camera is an ascii text string in this
case.  Each time the test is run, a different part of the text string is
missing.  

It feels like that with the high speed transfer, the data from the device is
arriving faster than the host can handle it.  I would expect that as the
host falls behind, the #TXE would be de-asserted, stopping the data flow
until the host catches up. I would guess that I'm not configuring the
ft2232H properly. 

This is indeed what happens with the windows drivers (with rts/cts flow
control turned on) as a comparison.  That is what leads me to believe that
it is something wrong on the Linux host side, rather than a problem with the
ft2232H.

Any ideas or thoughts would be appreciated.

Cheers,

Dave Challis



> -----Original Message-----
> From: Uwe Bonnes [mailto:bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
> Sent: Friday, March 20, 2009 2:42 AM
> To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: Release 0.15 and the ft2232 data loss.
> 
> >>>>> "David" == David Challis <dchallis@xxxxxxxxxxxxx> writes:
> 
>     David> We use the FT2232H to transfer large amounts of data
> (megabytes)
>     David> between a camera and a Linux host (Fedora 10).  We've used
>     David> release libftdi 0.12 with the ft245BL without problems.  We
>     David> recently upgraded tolibftdi 0.15 and started using the high
> speed
>     David> mode of the FT2232H.  While reading on the host pc data
> coming
>     David> from the ft2232H, we find the we lose some of the data.  It
> looks
>     David> like a data overrun or dropped data.
> 
> Dave,
> 
> could you please be more verbose?
> Information about
> - Datarate
> - USB Chipset
> - CPU
> comes to mind.
> 
> Bye
> --
> Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 
> Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
> --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
> 
> --
> libftdi - see http://www.intra2net.com/en/developer/libftdi for
> details.
> To unsubscribe send a mail to
> libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


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

Current Thread