AUTOIN, synchronous slave fifo enters stall state | Cypress Semiconductor
AUTOIN, synchronous slave fifo enters stall state
I'm working on my own streaming application (we're collecting high speed serial bitstream, converting it to parallel, and shipping it up USB). We have an FPGA doing the serial->parallel conversion, doing its own internal FIFOing, and feeding the FX2 slave interface as a master. (8 bit bus, synchronous--i think--, 40Mhz IFC clock sourced by the FPGA, SLWR pulsed when there's data to feed, etc).
When I use the cyconsole, my device shows up, reports my in end points, and is able to read 512 bytes when I do a bulk in.
I can write an application using CYApi to repeatedly do XferData() 512 bytes at a time. My data stream is fast enough, however, that the FX2 fifo gets full and I'm forced to drop data. (I manage about 4MB/s)
So, I switched to overlapped IO (BeginXfer, WaitForXfer, FinishXfer) again with 512 bytes, and I can manage about 8MB/s, but I'm still being forced to drop data (we generate about 10MB/s).
So I started using large transfers (32KB, for example), at this point FX2/FPGA operate for a short time, and then would fall over and enter a stall state. I don't know if this is normal or not.
I suspect this is when the FX2 FIFO becomes empty (which only happens when I'm transferring enough data out of the system that I can drain the FX2 FIFO and the 4KB fifo on the FPGA) and I'm not doing something right at that point.
TL;DR: what can cause a bulk in endpoint in AUTOIN Slave FIFO mode to enter stall state? I would have expected the endpont to NAK until data became ready, not stall. (full disclosure, I haven't examined the USB bus, but when I get the URB stat after the pipe locks up it says stalled)
I can post the entirity of my slave.c and my win32 C simple streaming source code on monday when I get into the office.