libftdi Archives

Subject: Re: write/read syncronization

From: Matthias Janke <janke@xxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 8 Feb 2010 17:04:45 +0100

sorry for the silence I had an imap problem.

Am Fri, 5 Feb 2010 10:11:25 +0100 (CET)
schrieb "Dr. Igor Nikitin" <igor.nikitin@xxxxxxxxxxx>:

> >     Igor> "one" is almost always missed, not appearing in further
> >output.
> > I don't know. Maybe the uC is not out of reset? Maybe the FT takes
> > some time to setup?  What happens if you loopback tx/rx at the
> > FT232 without the uC ...
> The same behavior if tx and rx on FT232 are directly connected.
>         ftdi_write_data(&ftdi, (unsigned char*)str,
> strlen(str)+1); usleep(10000);
>         rsiz=ftdi_read_data(&ftdi, buf, 1000);
> The first message disappears, others are OK. Sleep 1sec
> before the first write does not help. ftdi_usb_reset() before 
> the first write does not help. Replugging USB cable helps
> for one run of test program. It shows the first message, 
> in further runs it disappears again.

I can confirm this behaviouted a program/script [2], but beware that
its kernel version dependant.

Another way to get the first byte written on a "old" device is to open
an close it with D2XX prior to libftdi stuff. But that's rather

I tried to investigate father with usbmon and wireshark ( including
Uwe's hint [3]), but didn't come to a solution. I think the difference
lies in the open function of D2XX. If I remember correctly I didn't
observe this behaviour with a FT245, but don't count on it. Hopefully
this helps someone with better usb debugging skills/tools.



libftdi - see for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread