I use FX3 connected to FPGA throw GPIF2 interface in synchronous slave mode.
For my application I use 3 endpoints :
> 0x01 : Burst Configuration Writes
> 0x81 : Burst Configuration Reads (or test)
> 0x82 : Burst Streaming
Every reads on 0x81 is preceded by a write operation on endpoint 0x01 and its length is known in advance.
Reads on endpoint 0x82 don't have predictable length so FPGA generate a ZERO-LENGTH every 20 ms in order to complete the current transaction and wake up the host.
Here is my code on host side to start the transaction :
size = 4096 * 256;
m_stream_endptstream.xferbuff = (PUCHAR)buff;
m_stream_endptstream.xfersize = (LONG)size;
m_stream_endptstream.xferlast = 0;
m_endptstream_in->TimeOut = 100;
m_stream_endptstream.context = m_endptstream_in->BeginDataXfer(m_stream_endptstream.xferbuff, m_stream_endptstream.xfersize, &m_stream_endptstream.ov);
And to finish :
if(!m_endptstream_in->FinishDataXfer(m_stream_endptstream.xferbuff, m_stream_endptstream.xferlast, &m_stream_endptstream.ov, m_stream_endptstream.context))
I need to use asynchronous transfer in order to process previous data blocks during read.
When connection between host and device is composed by a single USB3.0 cable (or even with an front panel extender), WaitForXfer is woken up by Zero-Length packet (or when XFerSize is reached) everytime. (see USBlyzer_SingleCable_NoError)
When I add a HUB (Hub controller is GL3520 from Genesys) between Host and Device WaitForXFer does often fail to wakeup on ZeroLength Packet (see USBlyzer_failure_HUB). When this failure occurs, endpoint is blocked, does not react on XFerSize reached and can only be recovered by a Reset().
In that HUB configuration, if I decide to add an extra thread to generate periodic transactions on Endpoint 0x01 and 0x81, previous failure occurrence is significantly reduced from 1 over 3 without extra activity, to 1 over more than 1000 with extra activity. (see USBlyzer_HUB_ExtraTransaction)
Does anyone ever meet this issue ?
Is there any explanation to that ?
Thanks for any returns,