1 Reply Latest reply on Sep 23, 2017 10:21 AM by Madhu Lakshmipathy

    FX3 GPIFtoUSB example and missing GPIF data

    user_1580694

      Hello,

       

      example from EZ-USB FX3 SDK\1.3\firmware\boot_fw\gpiftousb fit close to my application demands - continuously sample GPIF data, and transfer it to PC. But during tests, i am experiencing missing data collected from GPIF interface.

      Tests was performed on FX3 Superspeed Explorer kit. Data for GPIF interface are produced by FPGA connected to kit. It's a simple 14 bit counter at 38MHz clock.

      DMA in the example is set to AUTO mode (MANUAL_DMA definition disabled).

      To minimize errors on my side, for data collecting i use USB control center utility - transfer file-in function. Bytes to transfer is set to 2MB, and result is in the file.

       

      But each 16kB (0x4000) there are missing data.

      Like in the next picture:

      Gpiftousb_data1.png

      In this case it's approximately 26 missing FPGA clocks. Sometimes it rise to more than 400 missing FPGA clocks.

      Because of USB 3.0 connection i am expecting continuous data flow.

      Slowing down GPIF interface by setting clkDiv=8 doesn't help.

      Any hint what am i overlook, or how can improve it?

       

      Best regards,

      Slavomir

        • 1. Re: FX3 GPIFtoUSB example and missing GPIF data
          Madhu Lakshmipathy

          Hi,

           

          The GpifToUsb example is mainly used for testing the maximum throughput. For doing reliable data transfers, this example cannot be used as such.

           

          As you may be aware the data from the GPIF is received by FX3 and stored in its DMA Buffers before sending it to the USB.


          Assume that your example has 4 DMA Buffers, each of size 16K Bytes. Once the data transfer starts, the bytes from GPIF Start filling the 1st Buffer. Once the 1st buffer is filled, FX3's DMA engine takes some finite time (few uS) to make the second buffer ready. In that meantime the data coming from the GPIF will be lost.

           

          So the bytes you have reported to be lost may would have arrived in this buffer switching time.

           

          So we recommend to have a handshake between the FPGA and GPIF in the form of flags. Please refer to the below application note for more details. (Refer to Flag A and Flag B parts especially). The AppNote also comes with example project.

           

          AN65974 - Designing with the EZ-USB® FX3™ Slave FIFO Interface | Cypress Semiconductor

           

          Regards,

          -Madhu Sudhan