libftdi Archives

Subject: Re: [PATCH] Fixed purge & added purge_test.c; Fixed C++ bit-or's & const.

From: Eric Schott <eric@xxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 6 Jul 2018 09:07:28 -0400

On Thu, 5 Jul 2018 11:08:19 -0700 (MST),Russ Berman wrote:

> I also have been having the same Purge issues as Eric. I also have the manual
> from FTDI under NDA that Thomas referred to. I reached out to my FTDI
> contact to discuss a possible PurgeRX/PurgeTX transposition in the manual,
> and received the following reply:
>
> /Likely an issue of naming.  The buffers are named w/r/t the FT2xx chip.
> When sending data from the FT2xx device to the host, the TX buffer is used.
> (FT_Read command on host)
> When the FT2xx device is receiving data from the host, the RX buffer is
> used.  (FT_Write command on host > /

Russ, Thank you for this information.  You have independently verified
what I surmised after a two week or so effort of characterizing the
libftdi1 behavior and comparing it to a conventional UART.

The libftdi1 purge, as it exists, is broken code.  Specifically an
RX purge clears the hardware TX buffers and flushes the software RX
buffer.  The TX purge clears the hardware RX buffer and flushes the
software TX buffer.

> So it appears Eric's patch is correct and should be incorporated. It amazes
> me that so many people have been using Libftdi up to this point without
> experiencing (or at least complaining) about this problem. It's a killer for
> us.

I suspect individuals who have required a correct purse (flush) worked
around the broken code with either delays or discarding data.

Thomas Jarosch had issues with the patch because "it might cause
breakage for existing users of the lib."

Since my user set, while of a moderate size, is rather contained, I
implemented a "patched" libftd1 which had correct functionality.
Of course, the code compiled against my patch will not work with a
distribution supplied libftdi1.

At this point, I feel it would be beneficial to create a correctly
working library with an incremented major number with that fix.
At the same time, I recommend implementing API changes to minimize
breakage of user code with future versions (e.g., using a PIMPL
idiom for the context structure).

Eric.




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