FX3: Commit DMA buffer outside DMA callback function

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

cross mob
Anonymous
Not applicable

Hi all,

In my system I have a MANUAL DMA channel from USB to GPIF.

The frames coming in through the USB producer need to be re-clocked. To achieve this we want to:

     1. First store the DMA transfer buffers for a few milliseconds. (Not committing to GPIF)

     2. Set up a GPIO interrupt, triggered from an external input, which occurs every 125us. Register GPIO_Interrupt(uint8_t gpioId); to gpio block.

     3. Use CyU3PDmaChannelCommitBuffer(); inside GPIO_Interrupt(); to release a transfer buffer every 125us:

          GPIO_Interrupt(uint8_t gpioId)

          {

               status = CyU3PDmaChannelCommitBuffer(&handle, count, 0);

          }

    

I'm currently getting an error code: CY_U3P_ERROR_MUTEX_FAILURE,         /**< Failed to get a mutex. */

Questions:

     1. Is it possible to commit buffers in a DMA channel outside of the DMA channel callback function?

     2. Is this the correct configuration to 're-clock' incoming traffic through the DMA channel?

Thanks,

James

0 Likes
1 Reply
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi James,

You get a DMA callback when a buffer gets filled/Host sends a zero length packet or a short packet. So when you get a DMA callback you receive the Handle.

But in the GPIO interrupt callback which handle are you passing to the CyU3PDmaChannelCommitBuffer() API?

Can you share your firmware?

Regards,

Hemanth

Hemanth
0 Likes