libftdi Archives

Subject: potential libftdi data loss issue

From: "Rolf Fiedler" <derRolf@xxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sat, 14 Jan 2012 11:32:27 +0100
Hello,
 
my name is Rolf and I am new to this list. I think I may have found and issue 
with libftdi (I am using the latest git at time of writing).
 
 We have some hardware that has a FPGA connected to an FT245BL. We have been 
using that on Windows with D2XX for some time (years). The data rate is quite 
high, to operate the device we need to transfer around 500 KB/s (that means 
KBytes).
 
 The good news is that I could port our software to MacOS X 10.7 without too 
much problems. I also can get the 500 KB/s data rate without errors, so the 
application and the device is working.
 
 BUT: Our FPGA has also a mode to test the maximum usb bulk transfer speed by 
sending test data (incrementing 32 bit numbers) as quickly as possible. This 
test fails with data losses on the libftdi/libusb-1.0/MacOS X stack. The test 
reports around 450KB/s arrived in my application.
 
 When I run the same test on the same machine/same device on a stack FTDI 
D2XX/WinXP/VirtualBox/MacOS X I do not loose any data, but the data rate is 
only about 530 KB/s. But at least the flow control is working here and we are 
not loosing data with the D2XX driver.
 
 When run on Windows on bare metal (no virtual box) the test typically gives us 
something in the range of 1000KB/s to 1050 KB/s (without data losses).
 
 The FPGA is designed to send data to the FT245BL whenever the FIFO can accept 
data (as indicated by the handshake line). From my understanding there should 
be no data loss. I do a ftdi_setflowctrl(p, SIO_RTS_CTS_HS) to enable 
handshake, but that does not seem to help.
 
 So my questions to the list would be:
 - is a flow control problem with ftdi_read_data() known?
 - how would I best debug this (since the issue only occurs at high data rate I 
might not be able to printf-debug this)?
 - Is virtual box also using libusb? If so, the problem would appear to be in 
libftdi, otherwise it could also be an libusb issue.
 
 When I get to work next week, I will also do tests on Linux. Maybe this is a 
MacOS X only issue.
 
 Any help is much appreciated,
 Rolf
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!               
Jetzt informieren: http://www.gmx.net/de/go/freephone

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

Current Thread