This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220SF-LAUNCHXL: UART question

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

Hi team,

My customer has a question about UART usage. As the UART API document says:  UART_readCancel() calls the registered RX callback function no matter how many bytes were received

My customer did some test:

1. The uart_read only read 50 bytes then return;

2.Connected CC3220SF via uart flow control and sent it 108 bytes

3.After receiving 100 bytes[call uart_read two times], delayed 20ms then called the UART_readCancel()

Result: He found the RX callback function was not called. Did the above three steps again, he could receive the lost 8 bytes with new data

why this happen?

  • Hi Viki,

    If I'm understanding the flow correctly, the customer is using UART_read() to read 50 bytes at a time. UART_read() will trigger the RX callback function once the requested amount of data is received, so if if he called it twice and received 100 bytes that seems to be working as expected.

    Did he call UART_read() for another 50 bytes after the first 100 bytes? If he did so, he should have gotten 8 bytes returned once UART_readCancel() is called. However, if he did not call UART_read() a third time, then there would be no pending read to cancel, and so UART_readCancel() will not trigger the callback. Can you clarify if the customer called UART_read() a third time after receiving the first 100 bytes?

    Regards,

    Michael