Skip to main content
Graduate
October 4, 2023
Solved

Unexpected UART interrupt in STM32G0

  • October 4, 2023
  • 2 replies
  • 1341 views

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.
    Best answer by TDK

    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.

    2 replies

    TDKAnswer
    Super User
    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.

    vchau.2Author
    Graduate
    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)

    Super User
    October 4, 2023

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