I have a problem with the Endpoint-Timeouts. To send commands to the FX3 I have added two Bulk-Endpoints (0x02 and 0x82 / MANUAL_IN and MANUAL_OUT).
The main loop on the FX3 is very similar to the one in “cyfxbulklpmaninout”.
I am waiting for a command, “doing something”, and sending an answer.
“Doing something” will last some time. To show the problem I have extended this time to 10 seconds.
I have also modified the “USB Control Center” (.NET) and set the timeout for the endpoint from 2 seconds to 20 seconds.
Now I am sending a command (8 Bytes) with the “USB Control Center” to the FX3 and trying to read the answer (128 Bytes). The following happens.
FX3 in USB 2.0 Mode:
- 10 Seconds after sending the command I am receiving the answer.
FX3 in USB 3.0 Mode:
- I am sending the command (EP 0x02)
- I am reading the answer (EP 0x82)
- 20 Seconds after trying to read the answer I am getting an Error (997)
- I am reading the answer again and getting it immediately
The USB 2.0 behavior is what I am expecting. I am starting the transfer with XferData and receiving an answer when it is sent by the FX3. If no answer is sent, I will get the Timeout-Error after 20 seconds.
The USB 3.0 behavior looks to me like XferData is always waiting until timeout occurs, when the data is not already available. Is this the way it should work?
To solve this, I did change the endpoint timeout to 10ms in my application and retrying the transfer in case of a timeout. However with this I have got some lost answers (seen with USB 2.0). Looks to me like an answer may get lost, when it comes almost at the same time when the timeout occurs
Any hints how I can handle this?