Question
Receiving data from USART
I am trying to use asynchronous USART on stm32L4R5ZI nucleo board for sending and receiving data. Following is related part of code.
while (1)
{
HAL_GPIO_TogglePin(LD2_GPIO_Port,LD2_Pin); //Toggle LED
HAL_Delay(1000); //Delay 1 Seconds
for(i = 0; i < 5; i++)
{
USART1->TDR = p[i];
while((USART1->ISR & 0x40) == 0);
}
while ((USART1->ISR & 0x20) == 0);
uint32_t receivedByte = (uint32_t)(USART1->RDR);
}Problem is that I am able to send data to PC but I am not able to receive data. What can be the problem?
