1 Reply Latest reply on Apr 6, 2018 3:01 AM by abga

    AN75779 base implementation of UVC camerat gets freeze with BackFlow detect error.

    user_312550701

      Implementation of a UVC camera based on AN75779 is fine with FX3 + sensor. Now adding a FPGA between sensor and FX3 can be running for while then it gets freeze. Checking the FX3 message finds the backflaw detected. Is there any suggestion?

      The new implementation of the camera is: The clocks used in both FX3 and FPGA + sensor are independent and the pclk is 74.25MHz provided by FPGA. The P-port clock inside FX3 is 96MHz. The GPIF II interface is the same as the AN75779. Does it cause problem? If it's so. Why and what does it cause? How to fix it?

        • 1. Re: AN75779 base implementation of UVC camerat gets freeze with BackFlow detect error.
          abga

          Hi,

           

          Buffer overrun/underrun issue in FX3 DMA architecture also known as Backflow

          This issue is often observed in systems where the GPIF II interface which collects the data from external processor / FPGA / Image sensor which has no flow-control. Here the GPIF block in FX3 writes the received data to the internal buffers continuously without checking it availability, so if the USB host is not capable of reading data in a timely fashion buffer over-run will happen in the GPIF socket & it will end up in the buffer loss & DMA channel crash.

           

          Following are some good design practices to avoid backflow issue:

          1. DMA buffering:

                    a, Try to utilize the maximum DMA buffering in many to one DMA architecture.

                    b, Do not use very large DMA buffers, make it a multiple of maxpacketsize * max burst length. i.e. maxpacketzise = 1024, Burst = 16,           Then make the DMA buffer size 16 * 1024 / 16 * 1024 * 2.

                    c, Always use maximum USB 3.0 Bursts.

           

          2. Try to minimize the short packets / ZLPs in the system because this will cause the host application xferdata queue to terminate instantly.

           

          3. It is not recommended to add any delay causing elements (Like Debug prints, Buffer parsing & manipulation) in the DMA callback. If it is necessary do it In the application thread using CyU3PDmaChannelGetBuffer() & CyU3PDmaChannelCommitBuffer() APIs with minimal processing.

           

          4. It is also dependent on the Power modes in the PC & the current CPU load, Always use High Performance mode in PC.

          5. Disabling LPM features improves the system performance,

          6. Always use the latest version of the USB 3.0 host controller drivers,

           

          Hope this will help!!

           

          Thanks & Regards

          Abhinav