CyU3PDmaChannelGetStatus

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LiMa_282146
Level 4
Level 4
First like given

Hi,

   

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?
 

   

Sodafarl

0 Likes
3 Replies
Anonymous
Not applicable

Hi,

   

Can you please add more information on why you would want it this way so that It is easier for me to  understand what kind of feature you're actually looking at.

   

Regards,

   

Anand

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Hi Anand,

   

I want to implement the CyU3PDmaChannelGetStatus in order to find out if a particular DMA channel is empty. My plan is to compare the prodXfercount and the consxfercount and if they are equal then I know the DMA channel is empty. . if the DMA channel is not empty then I can signal other processes with this information. However if the consxfercount increments by 1 buffer count before the PC has consumed the data then I can't use this method because if I write a buffer to the producer socket then the consumer count also increments by a buffer count  indicating the channel is empty when it is not because the data has not been consumed by the PC.

   

Sodafarl

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Hi Anand,

   

Is there any further information about my question.

   

Sodafarl

0 Likes