You are here

FX3 MANUAL DMA COMMIT DELAY | Cypress Semiconductor


Summary: 3 Replies, Latest post by PRAG on 18 Sep 2014 12:52 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
Oussamaab's picture
1 post


I'm currently using two manual DMA (DMA IN and DMA out) between CPU and GPIF ii to extchange data with an FPGA and I'd like to reduce the latency. As a first test, I  looped the manual dma commit buffer function and I found a delay of about 70 us between successive transmissions. My loop function approximatively looks like this : 



apiRetStatus = CyU3PDmaChannelGetBuffer (&glChHandleCPUtoGPIF, &outBuf_p, CYU3P_NO_WAIT);



apiRetStatus = CyU3PDmaChannelCommitBuffer (&glChHandleCPUtoGPIF, length , 0);



So, the question is, how can I reduce this latency ? Any idea to reduce even by a little this delay is welcome.


Thank you,

scutifer's picture
Cypress Employee
134 posts

 The simplest change here would be to move your commit code to the DMA callback. Do the first commit to the CPU-to-GPIF channel on the user thread and do the successive ones on the DMA callback for that channel.


Register a callback with CONS_EVENT as the notification. This event is raised when your device on GPIF reads out the previously committed buffer. Here, you'd then commit a new buffer.


This reduces latency because the DMA callback is run in the DMA thread's context which has the highest priority.

user_354537326's picture
69 posts

Hi Scutifer,


I am not able to understand this concept clearly. I need to commit large amount of data and need to know the fastest way to do this.



Gokul Prasath N

PRAG's picture
Cypress Employee
173 posts



Take a look at the cyfxbulksrcsink example project that is available in the SDK. There is a Manual_out DMA channel from CPU to IN endpoint in this example. A callback is registered during channel creation. And all available buffers are initially filled and committed.

From there on, each time a CONS_EVENT is received in the DMA callback (indicating that a buffer has been flushed out of the endpoint), that buffer is re-committed.

The only change in your code would be the consumer socket. You would employ GPIFII socket as the consumer, not the endpoint.



Log in to post new comments.