How to properly re-enable UART after an overrun failure?
There is a scenario in my application where a UART FIFO overrun can occur. The application can handle dropped packets, so this is not a concern. The issue is that when an overrun occurs, the UART stops interrupting when new bytes fill the HW FIFO. I have looked at the reference manual and it seems that once the UART HAL IRQ handler clears the ORE flag, everything should be back to normal. What is required to bring the UART back to interrupting on received bytes?
I have tried the following:
- Re-enable the UART
- Re-enable the UART receive interrupts
- Empty the FIFO when an overrun interrupt fires
I have seen other threads discuss this a little, but it is not clear what needs to happen to re-enable to UART to interrupt when a byte arrives or interrupt when the receive fifo threshold arrives, after an overrun interrupt failure.