cancel
Showing results for 
Search instead for 
Did you mean: 

RTOF: Receiver timeout - UART

Luke_abc
Associate III

Hi,

HAL Version used - 1.10.0

I am using RTO interrupt to identify if the transmitter has finished sending a packet. 

In the IRQ handler "void HAL_UART_IRQHandler(UART_HandleTypeDef *huart)", this is considered as an error and it is aborting the ongoing DMA transfer from the UART peripheral to the memory. This is causing issues on our side.

 

Luke_abc_1-1696761236413.png

The same is also posted here.

https://community.st.com/t5/stm32-mcus-embedded-software/is-implementation-of-rtof-support-botched-in-hal/m-p/166118

Why is this implemented it in this way ? Are we not supposed to use RTOF to identify if the transmitter has finished transmitting the packet ?

 

 

10 REPLIES 10
Piranha
Chief II

UART is a stream based interface, not message based. It just sends a stream of bytes. There is no concept of beginning and end of a message. The only thing UART guarantees is the order of bytes. It doesn't guarantee delivery, correctness and generally also the pauses between bytes. Though, if both ends are under your control, then you can force the pauses to be meaningful for message delimiting or something else. Therefore messages, checksums etc. have to be implemented as a higher level protocols and processing layers in software.

And the HAL is a broken bloatware. Use a decent code instead:

https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx