auto commit for FX3

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

cross mob
MaXi_1246331
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Does the auto commit happen when max packet size is reached or one buffer is full? Is the buffer size and max packet size the same thing? Assume only one buffer is used for a DMA channel and this buffer is committed.  Could the external device write data to this buffer at the same time while host is reading?

0 Likes
1 Solution

Hello,

- Does MaxPcktSize have influence on FX3 to host transfer?

No.

- The splitting of data is not by user, but automatically by the API function the user calls?

The splitting of data is done by the USB stack. The data is split into chunks of MaxPcktSize and then transferred.

- AUTO commit is only related to FX3 to host transfer, not the host to FX3 transfer?

AUTO commit is only between the different blocks of FX3 (say USB to GPIF II, USB to I2C, SPI to USB etc.).

Best regards,

Srinath S

View solution in original post

0 Likes
7 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

- Committing of buffer happens when the size of the buffer mentioned as part of the CyU3PDmaChannelCreate() API is reached. The buffer size and MaxPcktSize need not always be the same.

- With only one buffer being used, the external device cannot write data to the buffer while the host is reading from the same buffer.

Best regards,

Srinath S

0 Likes

If MaxPacketSize is set to1KB, Buffer size is set to 16KB. If external device continue to send data to P port, what happens if the quantity of data reach 1K? I think auto commit will not happen because the buffer size has not been reached. What if the packet end is asserted at the 1004th bytes?

I assume only one buffer just for understanding, not in real use.

0 Likes

Hello,

--> If MaxPacketSize is set to1KB, Buffer size is set to 16KB. If external device continue to send data to P port, what happens if the quantity of data reach 1K?

Data will not be committed to the host because the buffer size has not been reached.

--> What if the packet end is asserted at the 1004th bytes?

Short packet with 1004 bytes will be committed to the host.

Best regards,

Srinath S

0 Likes

If packet end are asserted after sending 1004 bytes from external device, which is larger than the max packet of 1000( lets assume 1K == 1000, I make a mistake previously to think 1K=1000. Now let assume it is true). Then what is the max packet size used for?

0 Likes

Hello,

'MaxPcktSize' is a parameter obtained by the host as part of the desrciptor information and the bytes of data requested/sent from the host cannot exceed this 'MaxPcktSize' value in each transaction.

Let us assume the normal 1K = 1024 bytes and the packet end is asserted after 1028 bytes.

In this case, when 1028 bytes are requested from the host, the USB transfer would be split into two separate transactions of 1024 bytes and 4 bytes. The MaxPcktSize parameter is used by the host to split the transfer into multiple transactions.

Best regards,

Srinath S

0 Likes

Does MaxPcktSize have influence on FX3 to host transfer? I think no according to your explanation.

the splitting of data is not by user, but automatically by the API function the user calls?

AUTO commit is only related to FX3 to host transfer, not the host to FX3 transfer?

Thank you.

0 Likes

Hello,

- Does MaxPcktSize have influence on FX3 to host transfer?

No.

- The splitting of data is not by user, but automatically by the API function the user calls?

The splitting of data is done by the USB stack. The data is split into chunks of MaxPcktSize and then transferred.

- AUTO commit is only related to FX3 to host transfer, not the host to FX3 transfer?

AUTO commit is only between the different blocks of FX3 (say USB to GPIF II, USB to I2C, SPI to USB etc.).

Best regards,

Srinath S

0 Likes