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.

CC2340R5: uart buf wiped some bytes before write finish

Part Number: CC2340R5

Tool/software:

Hi All,

My require is read data from uart, then add a header, send the new data back. But the data wiped before uart write finish.

My code like bellow

The program run as 
read:1234...xxx
after add header:ABC1234...xxx
expected receive:ABC1234...xxx
actually receive:ABC1234.

It lost few bytes. if I run program step by step, this won't happen.

Is there any setup can fix this? Or have to add mutex-lock?