cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

IzMa_4105896
New Contributor

I'm using CyU3PUartTransmitBytes function to do register-based transfers on an FX3.  CyU3PUartTransmitBytes is passed a count parameter ("number of bytes to be transferred") and returns "number of bytes that are successfully transferred".  How to handle the situation where the number of bytes successfully transferred is not the same as the number of bytes to be transferred?  Will CyU3PReturnStatus_t != CY_U3P_SUCCESS if not all the data is successfully transferred? 

0 Likes
1 Solution
YashwantK_46
Moderator
Moderator

Hi,

CyU3PUartTransmitBytes() returns "the number of bytes that are successfully transferred" but the status of this API is either 'success' or 'timeout'.

So, if there is some problem and the number of bytes that are transferred successfully doesn't match the number of bytes to be transferred (count), the API will return status = timeout and the return value = number of bytes transferred successfully, which is same as (CyU3PReturnStatus_t != CY_U3P_SUCCESS).

So, in order to handle such a situation, the API has to be called again but with an updated pointer to the data and the count size according to the data that is left to be sent in the previous operation.

Regards,

Yashwant

View solution in original post

0 Likes
1 Reply