I'm wondering the best way to handle a partial data transfer on the PC side? On the FX3, my DMA callback gets executed during a partial buffer like it should and performs the proper steps however, on the PC side I don't know the proper way to handle data xfer. I always get out of sync. I don't know what the size of the data xfer is and what to put in "bytes" length to xferdata function on the PC side. Is there away to stuff the buffer on the FX3 side so the buffer is always the same size? What is the best way to handle this situation?
Thanks a ton for the help!
If the data that device is sending is less than the Xfer call, then to finish the Xfer, the device needs to send a ZLP (Zero Length packet). On detecting a ZLP, the host will finish the Xfer call so you do not need to worry about the size of data coming from the device
Thank-you for your help! I'm wondering, does the CyU3PDmaSocketSetWrapUp (CY_U3P_PIB_SOCKET_0); function do what your talking about or do I still need to send a ZLP? Or both?
You need to send a ZLP. The CyU3PDmaSocketSetWrapUp will only commit the buffer, so you need to send a ZLP after that to indicate the host the end of transfer