Transmit and Receive "parallel" on UARTs
Hello,
we have a custom board with a STM32L051R6T6 MCU.
And we try to to receive and to transmit on an UART.
The telegrams have 40bytes lenght and the UART works on 9600 baud. The remote station sends one every 50ms.
If processing of the rx telegram was successful, we want to answer with a 40byte ackknowledge telegram.
Receiving and transmitting are done via interrupt in 40byte blocks.
If I comment out transmit, everything works. every telegram is received and processed.
But when I uncomment transmitting, a lot of rx telegramms are lost.
I also added a timer to debug the amount of time, which the uart needs to transmit (from HAL_UART_Transmit_IT to the HAL_UART_TxCpltCallback). This time is not as long as the time, where no are telegrams received.
I think that its not possible to send and receive parallel. But if tx is finished, should rx not run immediately again? It looks as the UART makes a break after sending.
I think, since rx telegram and tx telegram have the same length, I should maximum miss one rx telegram, not ~ten of them.
Can someone explain this behavior?
Thank you.