Using CyU3PDmaChannelGetBuffer() when expected .count is smaller than .size | Cypress Semiconductor
Using CyU3PDmaChannelGetBuffer() when expected .count is smaller than .size
I currently have a problem using the CyU3PDmaChannelGetBuffer() method: I have my dmaCfg.size set to 16384 bytes, as i need hand over a buffer as big as possible. However, data from USB is coming in 512-byte packets and the end of a large transfer is not necessarily modulo 32 512-byte packets. In my example, the last buffer should receive 8 512-byte packets, but CyU3PDmaChannelGetBuffer() does always yield CY_U3P_ERROR_TIMEOUT.
How can I get this remainder out of the DMAChannel (i.e. receiving a DMA buffer handle with .size, .count of different size)?
P.S: The other direction, CyU3PDmaChannelCommitBuffer() with .count smaller than .size works perfectly, and I need a similar solution in the other direction...