2025-12-07 11:59 PM - last edited on 2025-12-08 12:20 AM by mƎALLEm
Content:
Hi,
I am using UART on STM32G4 in interrupt mode (RXNEIE + NVIC enabled).
I observed the following situation:
1. A byte is received → RXNE = 1
2. At that moment, UART interrupt is disabled (critical section)
3. Later I re-enable the UART interrupt
4. But the RXNE interrupt does NOT fire, even though RXNE is still = 1
This causes my Modbus task to freeze because no further RXNE interrupts are generated.
-------------------------------------------------------------------------------------------------------------------
My question:
Is this the expected behavior?
i.e.,
Does STM32G4 USART generate the RXNE interrupt only when RXNE transitions from 0 to 1,
and not when RXNE is already 1 at the moment the interrupt is enabled?
I could not find a clear statement about this behavior in the Reference Manual.
If this is the intended design, please confirm, and if possible, point to the exact section in the documentation.
Thank you.
2025-12-08 6:00 AM
No, it’s a level based trigger, not edge based. If RXNE=1 and the interrupt is enabled in the peripheral and in nvic, it’ll trigger or try to.
Probably something else happening.
2025-12-14 3:57 PM
Thank you for the clarification hat makes sense. I’ll re-check my interrupt/flag handling and look for what else could be blocking RXNE servicing on my side.
Thanks again for your help.