1 Reply Latest reply on Sep 10, 2020 9:39 PM by HemanthR_06

    Cannot get 2nd DMA channel to work correctly with CX3

    JoMa_292246

      Hello,

      I created a CX3 project using the Eclipse tool for our custom camera. The Eclipse tool created an Endpoint-3 multi-socket DMA channel for the steaming data for our image sensor (I have replaced the manifest constants with the actual values for Super-Speed):

       

      1. dmaCfg.size = 0x8000;
      2. dmaCfg.count = 3;

      status = CyU3PDmaMultiChannelCreate (&glChHandleUVCStream, CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE , &dmaCfg);

       

       

      Because we needed backward compatibility with our previous FX3 products, we created an Endpoint-1 IN and an Endpoint-1 OUT one-to-one socket DMA channel:

       

      dmaCfg_EP1.size = 64;

      dmaCfg_EP1.count = 8;

      status = CyU3PDmaChannelCreate (&glChHandleBulkLpEP1, CY_U3P_DMA_TYPE_MANUAL, &dmaCfg_EP1)

       

      The Endpoint-1 DMA call back function works perfectly until we call CyU3PMipicsiWakeup(). Once making the CyU3PMipicsiWakeup(), the Endpoint-1 DMA callback function works very slowly (like responding after hundreds of milli-seconds, or sometimes just stops responding completely). Currently, our video DMA callback function is not working very well and often times-out and does an Endpoint-3 DMA reset. I’m thinking that these DMA timer resets is what allows the Endpoint-1 callbacks to occasionally work.

       

      How we can get the Endpoint-1 DMA callback to never be called (USB requests to Endpoint-1 hangs) is:

      1. Disable the Endpoint-3 DMA timer reset (the Eclipse manifest constant is "RESET_TIMER_ENABLE").
      2. Do not setup a read buffer for Endpoint-3 (streaming video IN endpoint). I'm assuming this will cause the CX3 Endpoint-3 Producer and Consumer buffers to overflow.
      3. Call CyU3PMipicsiWakeup.

       

      If you do the above three steps, this will cause the Endpoint-1 DMA callback to never happen.

       

      Questions:

      a. When you create different DMA channels, are the separate DMA channels interconnected? In other words, can one DMA channel cause another DMA channel to hang?

       

      b. Is there a proper way to create a second DMA channel with the CX3? We have created multiple DMA channels with the FX3 with no issues.

       

      Thank you.

        • 1. Re: Cannot get 2nd DMA channel to work correctly with CX3
          HemanthR_06

          Hi,

          a. When you create different DMA channels, are the separate DMA channels interconnected? In other words, can one DMA channel cause another DMA channel to hang?

          No, the DMA channels are not interconnected. Please check if there are any blocking calls in any of the DMA callback handlers. Ensure there are no uart debug print APIs called.

           

          After calling CyU3PMipicsiWakeup(), if timer is triggered, then you will have to check why there is no data coming from GPIF for 200ms (which is the time out period of the timer). As part of RESET_EVENT handler, please check if you are also resetting channel corresponding to EP1 - and check if any of the code in here is related to EP1 communication.

           

          b. Is there a proper way to create a second DMA channel with the CX3? We have created multiple DMA channels with the FX3 with no issues.

          There should be no difference in DMA channel creation between FX3 and CX3.

           

          Regards,

          Hemanth