DMA flag is not working correct when bulk out a particular length of data. | Cypress Semiconductor
DMA flag is not working correct when bulk out a particular length of data.
I'm working on a project using FX3 device (CYUSB3014), which is mostly based on official slave fifo example. Now, almost every thing works fine. But there is a problem that I can't figure out why. Currently, the firmware has an U2P DMA channel used for bulking out. The DMA channel has 4 DMA buffers and each of them has length of 16384 bytes. The burst length is set to 16. The DMA channel uses U-port input socket 1 as producer socket and P-port socket 0 as consumer socket. FLAGA is bound to that DMA channel. FX3 is connected to an FPGA.
On the PC sides, I use API function XferData(buf, len) to send data to FX3. The problem is when "len" is an integral number of 1024, FLAGA is always 0 (I use SignalTap II to check FLAGA), but function XferData(buf, len) returns true, and the actual transformed length is equal to what I passed to it. However, when "len" is not an integral number of 1024, FLAGA works as expected. How could I solve this problem?