CyU3PDmaChannelGetStatus | Cypress Semiconductor
I am using the CyU3PDmaChannelGetStatus function to monitor the number of DMA buffers transferred across a DMA channel between a producer socket and a consumer socket. The producer socket receives it data payload via the GPIF II from an FPGA while the consumer socket is an In Endpoint that connects over USB to a host PC. By using the CyU3PDmaChannelGetStatus function I can monitor the number of DMA buffers that have been generated on the producer side by looking at the prodXferCount variable returned by this function. Also I can monitor the number of consumer buffers that have been sent over the In endpoint to the PC by checking consXferCount. The problem I am seeing is that the producer buffer count increments ok whenever data is sent to the producer socket but the consumer socket increments by 1 buffer count even though no data has been sent to the PC. What seems to be happening is that as soon as the producer socket fills a single DMA buffer this is then sent to the consumer socket even before the PC has requested data from this endpoint. For example if the producer socket DMA channel is 8 buffers of 1024 deep then whenever I fill this the prodXfer count increments by 8, however if |I look at consXferCount I notice this has incremented by 1
even though no transfers to the PC have taken place.
Is there a way to prevent the consumer socket count incrementing until the PC reads data from it?