cancel
Showing results for 
Search instead for 
Did you mean: 

Does USART RXNE interrupt trigger only on a 0→1 transition of RXNE flag? (STM32G4)

cuong
Associate II

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.

2 REPLIES 2
TDK
Super User

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.

If you feel a post has answered your question, please click "Accept as Solution".
cuong
Associate II

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.