Hello,
The function UART_ReceiveData performs a non-blocking receive, this means that if you don't wait you will interrupt the receiving process which will end up in a problem. If you don't want to wait, I recommend you using the receive interrupt of the UART.
Best regards,
Victor
OK ,thanks