sendEP0Data() returns CY_U3P_ERROR_DMA_FAILURE | Cypress Semiconductor
sendEP0Data() returns CY_U3P_ERROR_DMA_FAILURE
I have a device which sends data over 2 SuperSpeed bulk pipes. Each pipe is fed via its own DMA thread.
I am running into a problem USB Setup callback: sometimes sendEP0Data() returns CY_U3P_ERROR_DMA_FAILURE and I have no clear understanding for both the cause and how to recover. This problem occurs quite often when talking to some host controllers (uPD720200) and very seldom (never) with others.
I tried suspending DMA channels while doing sendEP0Data() similar to how it is done in cyfxgpiftousb.c example even though the example does it only for USB-2.0 without much success. One problem is that I do not know how long to wait for my DMA channel callback to be called after CyU3PDmaChannelSetSuspend(). In my case DMA might not happen for quite long time and I cannot afford to have one of the pipes suspended while waiting for the callback on another pipe.
In any case, is it really necessary to do CyU3PDmaChannelSetSuspend()? What are other probable causes for CY_U3P_ERROR_DMA_FAILURE? How can one recover from this condition? In my case when it happens once all subsequent CyU3PUsbSendEP0Data() fail.