When the USB to the GPIF transmission is half the size of the DMA buffer transmission failure

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

cross mob
Anonymous
Not applicable

hi

   

I created a AUTO DMA channel from the USB Endpoint to the GPIF II to transfer data to the FPGA.

   

When I was testing the transformation I found that when the data transfer size is half the DMA buffer the FPGA did not receive data.

   

But When I transfer again all the data(this time and last time)just received by the FPGA.

   

In other case the transfer size is not the half of the DMA buffer the FPGA can receive normal.

   

I try to use the CyU3PDmaChannelCommitBuffer API to commit the DMA channel with the same size but still not working.

   

By the way my test condition is just on the full speed mode(CYUSB3014 Super Speed line have a problem).

   

Is there any other way to avoid this problem?

   

Thank you!

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

Irrespective of DMA Buffer size, if the USB transfer size < DMA Buffer size and a Multiple of Max Packet size (64 for full speed, 512 for high speed and 1024 for super speed), then the buffer will not be wrapped and so you wont receive data on GPIF.

   

So when FX3 received multiples of Max Packet size, it should be told that no more data is left to be received from USB Side.

   

So when sending multiples of Max Packet Size, send a ZLP (Zero length packet) after the actual data packet.

   

Now you will be able to receive the USB Data on the  GPIF.

   

Regards,

   

- Madhu Sudhan

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

Irrespective of DMA Buffer size, if the USB transfer size < DMA Buffer size and a Multiple of Max Packet size (64 for full speed, 512 for high speed and 1024 for super speed), then the buffer will not be wrapped and so you wont receive data on GPIF.

   

So when FX3 received multiples of Max Packet size, it should be told that no more data is left to be received from USB Side.

   

So when sending multiples of Max Packet Size, send a ZLP (Zero length packet) after the actual data packet.

   

Now you will be able to receive the USB Data on the  GPIF.

   

Regards,

   

- Madhu Sudhan

0 Likes
Anonymous
Not applicable

Thank you for your help.
This problem has been solved successfully.

0 Likes