Question
STM32 HAL_UART Receive
Posted on July 11, 2016 at 20:15
We are using HAL_UART_Receive function as mentioned below in the code for testing:
while(__HAL_UART_GET_FLAG(&huart1,UART_FLAG_RXNE)== RESET){};
{
for (uint8_t i=0; i < 5 ; i++)
{
HAL_UART_Receive(&huart1,RData,RdSize1,Timeout_test1);
RxDataStr = RxData[i];
}
}
RData is defined as uint8_t RData[5];
When we send the data for example ''Test1''. I can see only 1st character from the data. I debugged through the code and it seems that Timeout is occurring and it is not going through the HAL_UART_Receive loop to receive the rest of the data. Please help!