FX3 GPIFtoUSB example and missing GPIF data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
1 Solution
Anonymous
Not applicable

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

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

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

0 Likes

Hi,

I don't think that the time needed to switch between buffers is the problem. These chips are designed for seamlessly switching the buffers around, so it would make no sense to use these chips at all if you need handshake anyways.

The fact that slowing down the data rate does not help, kind of proves this.

I have a similar data loss issue right before the transfer is through and the next one is started:

Cy7C68013 Streamer input transfer ISOC loses data

Have you been able to solve the problem, yet?

You can unmark the other answer from being the correct answer so that maybe someone else is coming and looking at the problem. Having the "answered" tag on the question keeps potential helpers away.

Regards,

Frank

0 Likes