In a lot of examples using STM32, HAL, where UART data is received by interrupt the code looks like:
Initially (to start the receiving):
HAL_UART_Receive_IT(&huart1, Rx_data, 1);
When an interrupt receive is complete:
//Interrupt callback routine
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
...
HAL_UART_Receive_IT(&huart, Rx_data, 1);
}
I am wondering, is there a possibility that bytes are lost between the actual receiving and after the (receive complete) callback where the interrupt is started again.
Or is it assumed the interrupt handler above is so short the data will still be in the UART buffer?