3 Replies Latest reply on Sep 6, 2016 6:55 AM by gokul.prasath.nallasamy

    FX3 | CyU3P Dma Channel Create failed, Error code = 64

    gokul.prasath.nallasamy

      Hi,

         

      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.

         

       

         

      //Error

         

      CyU3PDmaChannelCreate failed, Error code = 64

         

       

         

      //Code Snippet

         


          /* 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,
                     CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
             if (apiRetStatus != CY_U3P_SUCCESS)
             {
                     CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %d\n", apiRetStatus);
                     CyFxAppErrorHandler(apiRetStatus);
             }

         

       

         

      Thanks,

         

      KCNGP