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:
status = CyU3PDmaChannelCommitBuffer(&handle, count, 0);
I'm currently getting an error code: CY_U3P_ERROR_MUTEX_FAILURE, /**< Failed to get a mutex. */
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?
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?