3 Replies Latest reply on Mar 8, 2017 8:58 PM by nisa

    CyU3PDmaChannelGetBuffer  for Composite Device times out

    priyanob_2031756

      Hi,

         

      I am making an USB Composite device (UVC + CDC). The device got registered properly and among the two, camera is working successfully. However, when I opened the serial port (CDC) it does not read anything.

         

      In the firmware, there is a thread which acquires USB buffer and commits it. The function CyU3PDmaChannelGetBuffer returns with CY_U3P_ERROR_TIMEOUT always.

         

      I have tried different sizes and buffer count for DMA during the channel create.

         

      I have gone through some other posts regarding the DMA time out. However, I did not get any solid solutions from them.

         

      I am using CX3 Denebola with OV5640 sensor.

         

      Attaching the sources.

        • 1. Re: CyU3PDmaChannelGetBuffer  for Composite Device times out
          nisa

          I saw the firmware which you have attached. I do not see any DMA channel for UART. Can you tell me which endpoint and which channel you are using for UART?  I see in the cyfxusbuart file of your project you are having channel from SPI to USB, but I do not see anything related to UART. Also, I see two set of descriptor files in your project. Can you check if you are getting input signals on UART lines. I see there are many changes in the USBUART file which may not be proper. Please use the default USBuart example firmware in the FX3 SDK.

          • 2. Re: CyU3PDmaChannelGetBuffer  for Composite Device times out
            priyanob_2031756

            Hi Nishanth,

               

            The CDC device, in my project has a different purpose. Even though it registers as an USB-Serial, the data towards the host end point is coming from SPI port (and not from UART). UART is used as normal debug port here.

               

            The descriptor file which is actaully being used is of UVC's.

               

            And, this problem is only occuring in Windows 7. It worked good for me in Linux and Windows 10. However, I am clueless about this problem.

            • 3. Re: CyU3PDmaChannelGetBuffer  for Composite Device times out
              nisa

              1) I see in your sendSamples function that you are doing a CyU3PDmaChannelGetBuffer from channel "glChHandleCPUtoUSB". I suppose it should be "glChHandleSPItoCPU" as SPI is the producer. Can you check and confirm if this is intentional?  Please check and update us.

                 

               

                 

              2) As you say that CyU3PDmaChannelGetBuffer has timed out, this means that the handle does not have any data. Please check the source of data. I see that you are continuously calling this GetBuffer API and waiting for 1000ms to get the buffer available. But, abetter way can be to call this function when the buffer is full .This can be done by setting a manual channel and in the DMA callback you can call the GetBuffer API.