Such as，Is like, XferData this function will return to FALSE
xferdata is a synchronous call i.e. the program execution waits for the function call to complete before executing the next line of code. So I'm a little confused by what you're describing. Please provide more information about the scenario.
Also are you using multi-threading which is leading to this simultaneous transfer scenario?
One threading carry data to endpoint 0x81 with the Xferdata function,the Other threading operat control endpoint 0x01.if work in usb3.0 mode,it is work okey.But work in usb2.0 mode,Xferdata return false,GetLastError return 995.
Error code 995 means
The I/O operation has been aborted because of either a thread exit or an application request.
Do you have a CATC capture of what is happening on the bus?
What is the difference in your code between USB3.0 and USB2.0?
My code between USB3.0 and USB2.0 is same.
capture img data threading for endpoint 0x81:
threading for control endpoint 0x01:
In USB2.0, After succeeding in catching a period of time,XferData return false.
The FX3 codeses are as follows:
if (usbSpeed == CY_U3P_SUPER_SPEED)
epCfg.burstLen = 16;
/* Create a DMA MANUAL channel for U2P transfer.
* DMA size is set based on the USB speed. */
dmaCfg.size = 16384;
dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
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 = CY_U3P_DMA_CB_PROD_EVENT;
dmaCfg.cb = CyFxSlFifoUtoPDmaCallback;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP,
if (apiRetStatus != CY_U3P_SUCCESS)
CyU3PDebugPrint (1, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
/* Create a DMA MANUAL channel for P2U transfer. */
dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET;
dmaCfg.cb = CyFxSlFifoPtoUDmaCallback;
Whether my code has a problem？
What is the amount of data that you're requesting and the timeout value being used?
Are you using a larger timeout value for the USB2.0 communication?
The timeout is default value.
What is the transfer size??
The bulk endpoint transfer 256 kbyte once,control endpoint transfer 64 byte once.
Please try splitting the 256KB transfer into smaller chunks.
This is a useful article on recommended buffer lengths from the host controller side in windows http://msdn.microsoft.com/en-us/library/windows/hardware/ff538112(v=vs.85).aspx