Skip to main content
vchau.2
Associate III
October 4, 2023
Solved

Unexpected UART interrupt in STM32G0

Hi All,

I'm facing a strange issue on UART, 

I generate the code by CubeMx for UART functionality, UART is working fine but when ever i remove the TTL (Serial to USB) and keep Rx pin float, UART interrupt occurred continuously and main application stopped.

I want to know why interrupt occurred on floating UART pins   

This topic has been closed for replies.
TDK
TDKBest answer
October 4, 2023

Floating pins lead to ambiguous/invalid signals. UART should have a pullup to avoid unknown/invalid states. You can use the internal pullup for this.

Check the relevant flags in the interrupt to see which one it detects, if you want.

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

3 replies

TDK
TDKBest answer
October 4, 2023

Floating pins lead to ambiguous/invalid signals. UART should have a pullup to avoid unknown/invalid states. You can use the internal pullup for this.

Check the relevant flags in the interrupt to see which one it detects, if you want.

"If you feel a post has answered your question, please click ""Accept as Solution""."
vchau.2
vchau.2Author
Associate III
October 4, 2023

My device is battery operated, is it good solution to introduce pull up on UART Rx pin ?

It happening in this microcontroller(STM32G0) only its not happening in other microcontroller(STM32F4, STM32L0)

TDK
October 4, 2023

If your concern is using more power, a pullup on a pin that is otherwise floating uses negligible current.

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