Recently I am focusing on a project, which using CYPRESS fx2.
In fact, it is a very simple project, because the CYPRESS fx2 USB chip function and interface is very flexible, but I also come a puzzle.
The system is a data capture system.
FPGA send the realtime data to the FX2 by Slave mode.
FX2 configure the EP2 as quard buffer, each buffer 512B, and auto in, auto in length is 512B.
Data path from FPGA to FX2 then to PC is pass now, and it working now.
But I come a problem on how to reset the FX2 EP2 buffer.
For example, when PC application need 10M buffer, it will bulk in from EP2 for 10M data, when start bulk, it will ask FPGA start sending data to FX2, but when App receive 10M data, FPGA will still send 512*2 B data to FX2, but these 2K data will not fecth by Ap.
So the next time, PC start bulk in again, the 2K data of the last time will be the first part of the bulk in data.
So I make a vendor request interface, which will invoke the EP2 FIFO RESET function in firmware.
But this function does not take effect.
So does anyone familiar with how to reset(discard) the EP2 quard buffer data, so when I start bulk in again, the data in the EP2 quard buffer will not valid, only when the FPGA really sending the data to the FX2 for the second Bulk in.