2020-07-30 08:30 AM
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:
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.
2020-07-30 09:36 AM
First you need to clear overrun flag. for STM32 L4 serie ORECF bit in usart ICR register must set. find equivalent register for your MCU.
2020-07-30 09:39 AM
Hi prain,
Thanks for the reply. The HAL is already clearing that bit. I am thinking of maybe clearing the entire ICR register.
2020-07-30 10:27 AM
some times ago, I encountered a similar problem with SPI fifo buffer in stm32f7 MCU. The only way I found to reset peripheral was disabling its clock in RCC and then reinitialize it. maybe it could be better that ST provide fifo flush command for serial peripherals.
2020-07-30 11:38 AM
Which chip? The answer will vary.
2020-07-30 12:17 PM
I'm working with the STM32H743ZI