How to properly re-enable UART after an overrun failure?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 8: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:
- 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.
- Labels:
-
STM32H7 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 11:38 AM
Which chip? The answer will vary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 12:17 PM
I'm working with the STM32H743ZI
