FTDI Community

General Category => Discussion - Software => Topic started by: j.pflaum on June 10, 2021, 11:45:40 AM

Title: USB communication fails after a undefinde time because of an overlapped timeout
Post by: j.pflaum on June 10, 2021, 11:45:40 AM
I am building a software (in c) which on the one side connects to a device with a FT601 using FTD3XX library and on the other side to another software via TCP/socket communication.
I am using multiple threads - 1. TCP incoming data + USB outgoing data / 2. TCP outgoing data / 3. USB incoming data. Number 2 and 3 share a ring buffer.
For the USB incoming (asynchron read from USB) I used the FTDI data streamer demo app 1.3.0.4 as a template:

 - SetStreamPipe
 - InitializeOverlapped
 - ReadPipeEx
 - Rerun:
    - GetOverlappedResult
    - ReadPipeEx

After a undefined time the GetOverlappedResult always throws an Timeout Error (FT_STATUS: 19 / GetLastError(): 121). Once the failure occures, it will always be there even after restart of both Computer and Device.

Can anyone explain to me, what is going on and what I am missing / doing wrong? Or how I can fix this?

Thank you and best regards
Title: Re: USB communication fails after a undefinde time because of an overlapped timeout
Post by: FTDI Community on July 08, 2021, 04:51:58 PM
Hello,

We have a recovery procedure in this application note below (see section 3.2). Could you advise if this procedure helps to recover from the error?
AN_412_FT600_FT601 USB Bridge chips Integration
https://ftdichip.com/wp-content/uploads/2020/08/AN_412_FT600_FT601-USB-Bridge-chips-Integration.pdf (https://ftdichip.com/wp-content/uploads/2020/08/AN_412_FT600_FT601-USB-Bridge-chips-Integration.pdf)

Best Regards, FTDI Community