2 Replies Latest reply on Aug 31, 2017 10:05 AM by Michael.Eick_1680671

    USB CDC using DMA

    JacobLerenius

      I have a CY8C5868AXI-LP032 application where I transfer packets to the PC over a CDC USB interface. It works fine both with the standard API and when I enable CDC API and use that API. It works with Manual (Static Allocation) as well as DMA (Manual Buffer Management), both of these have identical performance numbers (~850us to transfer 128bytes where 10us is needed for the USBFS_LoadInEP(EP2, *txBuffer, length); to execute). When changing to DMA with Automatic Buffer Management, nothing works anymore. I have followed the setup I found in examples and the datasheet (http://www.cypress.com/file/139686/download) but I have not been able to find an example project with CDC using DMA. Any hints on what I am doing wrong? Also, calling USBFS_LoadInEP should not take long when using DMA, right?

        • 1. Re: USB CDC using DMA
          JacobLerenius

          Tried example 3 in AN56377 but no data is sent. I attach the project. I use the CyConsole to test. If I change to Manual (Static Allocation) or DMA (Manual Buffer Management), it works when changing to a pointer instead of using NULL in USBFS_LoadInEP(EP1, USBFS_NULL, sizeof(EP1_RAM)). Also, the Streamer application AN56377 is pointing to does not appear to work either, shows success even when no data is sent.

          • 2. Re: USB CDC using DMA
            Michael.Eick_1680671

            I am also observing that the generated CDC API by PSoC Creator does not work when activating DMA(Automatic Buffer Management).

            It seems like the API can be patched easily. Basically:

            - do _LoadInEP(epNumber, NULL, length); after _LoadInEP(epNumber, pData, length);

            - do _EnableOutEP(epNumber); after _ReadOutEP(epNumber, pData, length);