can XferData() receive partial BULKIN Packet ?

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

cross mob
GlWa_4148656
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi all

Our FPGA may send variable length data(4B~16kB, integral multiple of 4Bytes) to FX3 in which firmware runs as slave FIFO mode, host app invoke XferData() to initiate a BULKIN transfer for reading data stored in FX3.

At each BULKIN event initiated by host, a certain len parameter must be passed into XferData() refer to Cypress CyAPI Programmer's Reference, for example 16384, if actual length of packet which sent by FX3 is shorter than 16384(ie partial packet), will XferData() receive the short length packet and return ture or return false for time-out? if this function can receive short packet, where can i get the actual length after the XferData() executed ?

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

The behavior is expected. You can refer to following lines of below KBA:

In this configuration, the buffer would be committed to GPIF when any of the following conditions are met:
a. Entire 16 KB buffer is filled by USB.
b. A partial packet is received from USB (Note: When this happens the amount of data filled in the buffer will not be a multiple of
1024 bytes for USB 3.0 and 512 bytes for USB 2.0).
c. A zero-length packet is received from USB.

KBA: https://community.cypress.com/t5/Knowledge-Base-Articles/Data-sent-from-Host-over-USB-is-not-Committ...

Above KBA is for transfer direction Host PC to FX3. But above quoted lines applies to FX3 to Host as well. Above lines should be interpreted as - Xfer data returns in the mentioned three conditions - a. entire requested data is obtained from fx3 b. short packet is received (not max pkt size multiple) c. ZLP is received

Hope it is clear.

Regards,

Hemanth

View solution in original post

1 Reply
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

The behavior is expected. You can refer to following lines of below KBA:

In this configuration, the buffer would be committed to GPIF when any of the following conditions are met:
a. Entire 16 KB buffer is filled by USB.
b. A partial packet is received from USB (Note: When this happens the amount of data filled in the buffer will not be a multiple of
1024 bytes for USB 3.0 and 512 bytes for USB 2.0).
c. A zero-length packet is received from USB.

KBA: https://community.cypress.com/t5/Knowledge-Base-Articles/Data-sent-from-Host-over-USB-is-not-Committ...

Above KBA is for transfer direction Host PC to FX3. But above quoted lines applies to FX3 to Host as well. Above lines should be interpreted as - Xfer data returns in the mentioned three conditions - a. entire requested data is obtained from fx3 b. short packet is received (not max pkt size multiple) c. ZLP is received

Hope it is clear.

Regards,

Hemanth