How to receive residual data in FX3 cyusb3014?

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

cross mob
Anonymous
Not applicable

Hi, dear friends,

   

    I met a problem in FX3 to receive residual data in FX3: in order to achieve high speed, I set a large transfer data length for XferData() function, such as 1024*128, but at the end of the data transfer, there will be a little amount of data smaller than 1024*128. So when XferData() time out and meet error, I call XferData()again and try a smaller data length , but It's will never succeed and can't receive the data tail . But if I set a smaller data length all the time, I can receive the tail.

   

    Does anybody know how to solve this problem? Thank you very much and best wishes.

0 Likes
3 Replies
Anonymous
Not applicable

It seems like the residual data you have in this scenario is a multiple of endpoint max pkt size (1024 for superspeed).

   

In such cases, if you setup XferData with len greater than the exact amount of data, it will not return.

   

This is as per usb protocol and you need to append the residual data in the Fx3 with a ZLP (zero length packet). The ZLP will cause any XferData() call to return without timeout error.

0 Likes
Anonymous
Not applicable

Hi,

   

  i may have the similar issue above. Does "the exact amount of data" you referred in line 3 mean 1024 or burst_length*1024?

0 Likes
Anonymous
Not applicable

Thank you very much and I will try it.

0 Likes