You are here

How to set up MANUAL_OUT for interrupt endpoint? | Cypress Semiconductor

How to set up MANUAL_OUT for interrupt endpoint?

Summary: 1 Reply, Latest post by Madhu Sudhan on 27 Jan 2014 11:51 AM PST
Verified Answers: 1
Last post
Log in to post new comments.
user_193124556's picture
128 posts


I'm trying to implement the interrupt endpoint for a UVC device, but I can't seem to configure the DMA channel correctly. The API returns error 0x40 (invalid argument) when I call CyU3PDmaChannelCreate(). I have not found any examples in the SDK which actually implement an interrupt endpoint so I am asking here. 

What is the correct way to implement an interrupt endpoint? How do I set up the DMA channel correctly for this, and do I then just use the normal DMA commit API to send data to the interrupt endpoint?



  * Configure the status interrupt endpoint.
  * Note: This endpoint is not being used by the application as of now. This can be used in case
  * UVC device needs to notify the host about any error conditions. A MANUAL_OUT DMA channel
  * can be associated with this endpoint and used to send these data packets.
 CyU3PMemSet((uint8_t *)&epCfg, 0, sizeof(epCfg));
 epCfg.enable   = 1;
 epCfg.epType   = CY_U3P_USB_EP_INTR;
 epCfg.pcktSize = 64;
 epCfg.isoPkts  = 0;
 epCfg.streams  = 0;
 epCfg.burstLen = 1;

 if ((apiRetStatus = CyU3PSetEpConfig(USB_EP_CONTROL_STATUS, &epCfg)) != CY_U3P_SUCCESS) {
 cli_dprintf(CLI_LOG_ERROR, "CyU3PSetEpConfig failed, error code = %d\n",apiRetStatus);

 /* Create a DMA MANUAL_OUT channel for the interrupt endpoint */
 CyU3PMemSet((uint8_t *)&dmaCfg, 0, sizeof(dmaCfg));
 dmaCfg.size = 64;
 dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
 dmaCfg.prodSckId = CY_U3P_CPU_SOCKET_PROD;
 if ((apiRetStatus = CyU3PDmaChannelCreate (&dch_intr, CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaCfg)) != CY_U3P_SUCCESS) {
 cli_dprintf(CLI_LOG_ERROR, "Can't create control status DMA descriptor (0x%x)\n", apiRetStatus);

 /* Set DMA Channel transfer size */
 if ((apiRetStatus = CyU3PDmaChannelSetXfer(&dch_intr, 64)) != CY_U3P_SUCCESS) {
 cli_dprintf(CLI_LOG_ERROR, "Can't set control status transfer length (0x%x)\n", apiRetStatus);


mady's picture
Cypress Employee
964 posts

The below data field is missing.

dmaCfg.count = 1; 

By default, this data field is initialized to zero. So you have to make it as one (or some other number which indicates the number of DMA Buffers to be created).

Log in to post new comments.