You are here

How to suspend a GPIF DMA to USB from a thread | Cypress Semiconductor

How to suspend a GPIF DMA to USB from a thread

Summary: 1 Reply, Latest post by Madhu Sudhan on 10 Sep 2016 03:32 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
yfavre's picture
11 posts

I'm face to priority when I want to use in parallel 2 EPIN:  One is transferring high speed data from GPIF to USB, the other low speed data from UART to USB. Both of them are connected to DMA AUTO but the UART has and AUTO SIGNAL allowing to set a flag (_pktsPendingUart) when a transfer is completed. Within a thread, I read the flag every 40ms and if not set I use the CyU3PDmaChannelSetWrapUp() in order to tell to USB they might be some bytes in the DMA buffer so the host can get it with XferData().

The thing is while the GPIF to USB is sending some data to the host, the DMA UART wrapup or the associated EPIN is stuck since I don't see anymore UART Data Packet on the USB and any XferData() call returns LastError/NtStatus/UsbdStatus = 997/995/0xC001000 on the 1st call and then 997/23/0xC0000011 on the next calls

So I wonder how to suspend the GPIF DMA, force the UART DMA and resume the GPIF in the thread body, something like the code below, BUT IT DOESN'T WORK. Any other method or do I use these functions correctly ?


if (_pktsPendingUart == 0){

CyU3PDmaChannelSetSuspend(&_glChHandleSlFifoGPIFtoUSB, CY_U3P_DMA_SCK_SUSP_NONE, CY_U3P_DMA_SCK_SUSP_EOP);

CyU3PDmaChannelSetWrapUp (&_glChHandleUarttoUsb);


CyU3PDmaChannelResume(&_glChHandleSlFifoGPIFtoUSB, CyTrue, CyTrue);

}//end if

_pktsPendingUart = 0;

CyU3PThreadSleep (40);

}//end while


PS : I've also tried CY_U3P_DMA_SCK_SUSP_CUR_BUF and CY_U3P_DMA_SCK_SUSP_CONS_PARTIAL_BUF rather than CY_U3P_DMA_SCK_SUSP_EOP but nothing is working.

mady's picture
Cypress Employee
955 posts


You can continue data transfer on the other socket even without suspending. (Provided the data on the UART is small). You just have to do the required handling in the host application.


- Madhu Sudhan

Log in to post new comments.