2024-01-21 08:36 PM
2024-01-21 11:45 PM
The code above sends three bytes. The first byte is received by UART but not read from it, so the other bytes are lost. Then you call Receive, which reads the only byte received. So, everything works as expected. Read the description of non-blocking functions, like HAL_UART_Receive_IT(). Call it first, then call Transmit - the bytes sent will be received in the background. Or better - don't use HAL for UART - it doesn't fit any real world scenario. ;)