We were using modified 'Slave FIFO' application note design. With this design, we will be performing the DMA channel destroy and create in-between our operation. During these operation, some times we are seeing the below error (but we are seeing it to work for some times as well).
This error states that, some parameters are bad. But, we are calling the same function all the times and working sometimes and not sometimes. So, please let us know what other parameters will cause this issue and probably how to solve this.
CyU3PDmaChannelCreate failed, Error code = 64
/* Create a DMA AUTO channel for U2P transfer.
* DMA size is set based on the USB speed. */
dmaCfg.size = DMA_BUF_SIZE* size ;
dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P;
dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
/* Enabling the callback for produce event. */
dmaCfg.notification = 0;
dmaCfg.cb = NULL;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
tempDmaChannel = CyU3PDmaChannelGetHandle(CY_FX_PRODUCER_USB_SOCKET);
if(tempDmaChannel != NULL)
CyU3PDebugPrint (4, "CY_FX_PRODUCER_USB_SOCKET : %d socket occupied", CY_FX_PRODUCER_USB_SOCKET);
tempDmaChannel = CyU3PDmaChannelGetHandle(CY_FX_CONSUMER_PPORT_SOCKET);
if(tempDmaChannel != NULL)
CyU3PDebugPrint (4, "CY_FX_CONSUMER_PPORT_SOCKET : %d socket occupied", CY_FX_CONSUMER_PPORT_SOCKET);
apiRetStatus = CyU3PDmaChannelGetStatus(&glChHandleSlFifoUtoP, &dmaState, &prodXferCount, &consXferCount);
CyU3PDebugPrint (4, "CyU3PDmaChannelStatus = %d\n", dmaState);
if(dmaState != CY_U3P_DMA_NOT_CONFIGURED)
CyU3PDebugPrint (4, "Dma U2P channel already configured\n");
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP,
if (apiRetStatus != CY_U3P_SUCCESS)
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
Can you please use CyU3PDmaSocketIsValidConsumer and CyU3PDmaSocketIsValidProducer APIs to see if the sockets are in the usable state?
The other parameters that return the error 64 (bad argument) are trival things like size, count, mode etc., Your snippet does not seem to err on this. You can refer to the source code of CyU3PDmaChannelCreate API to see where all it returns this error. The source code is in C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\fx3_sdk_1_3_3_src.zip
- Madhu Sudhan
Hi Madhu Sudhan,
I am not able to find the mentioned function "CyU3PDmaSocketIsValidConsumer" and "CyU3PDmaSocketIsValidProducer". Also, I am not able to find the zip file that you have referred. Please share the same.
FYI: I have created a support case #00285662
Just to add some more info:
I have observed 'Mutex Failure' error during DMA destroy. I presumed that this error is due to calling 'DMA Destroy' in
USBEvent Call Back function. So, I have created an another thread and handled the 'DMA Destroy' with a separate event. Even with this approach, I am observing the 'Mutex Failure'.
Please let me know, how to resolve this issue and when this issue will happen.