You are here

How to transfer a data with small size? | Cypress Semiconductor

How to transfer a data with small size?

Summary: 1 Reply, Latest post by scutifer on 20 Nov 2014 05:26 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
Winter Lin's picture
2 posts


   I configure FX3 DMA in 1024bytes packet size and burst of 4. And the dmaCfg.size is 1024x4 = 4KB.

If I want to transfer a data from PC to FX3 or FX3 to PC, what's the dedicated API can be use to handle the

transmission of data size less than dmaCfg.size (4KB)?



scutifer's picture
Cypress Employee
134 posts

There are a few ways to do this:


1. if your DMA channel is from GPIF to some other socket, then you can use the COMMIT action in GPIF designer to send the partially filled buffer (less than 4KB in your situation) to the PC

2. if the channel is from USB to some socket, then you should either send a zero byte packet in the last transfer or send a short packet. For example, if you want to only send 3KB, then send 3KB from PC and then send 0 bytes. This last packet will cause the 3KB to be wrapped up on the USB socket.

On the other hand, if you want to send 3.2KB (3276 bytes), then there is no need to send a 0 byte packet because the last packet sent by the PC will be 0.2KB (204 bytes) is a short packet. This short packet will cause the buffer to automatically wrap up

3. for other types of sockets, you need to use the CyU3PDmaChannelSetWrapUp API. This can be used for GPIF and USB sockets too but it is not mandatory as I just explained.


Log in to post new comments.