cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected UART interrupt in STM32G0

vchau.2
Associate III

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   

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

3 REPLIES 3
TDK
Guru

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
Associate III

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
Guru

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".