Skip to main content
Graduate
November 23, 2025
Solved

NUCLEO Pin reading high even when it's not

  • November 23, 2025
  • 2 replies
  • 224 views

You may encounter an issue when developing for the STM32 microcontroller using STM32 development boards where a pin that is configured for reading on a General Purpose Input/Output (GPIO) reports a high state even when it is not physically connected to any circuit. Pins are not expected to output neither high or low when left floating.  This can lead to significant difficulties when developing for the target. In my specific use case, this behavior resulted in an LED flashing when the jumper was not bridged, leading to confusion and misinterpretation of the system's status.

 

It took me more than a week to understand what was happening because debugging step by step using the STMCubeIDE always resulted in the expected functionality.

 

I believe such an issue can arise due to floating inputs and/or electrical noise, mainly if the board is sitting on an isolator.

To fix this please make sure to implement pull-up or pull-down resistors in your design to ensure that the GPIO pin has a defined state when it is not actively driven by an external signal, or, if you are using a development board (in my case the NUCLEO-F411RE), make sure to connect to common GND.

 

Best,

Alessandro

    This topic has been closed for replies.
    Best answer by TDK

    > Given this, I inserted my board into the breadboard, and the problem got fixed.

    Putting your board into a breadboard which connects adjacent pins is absolutely NOT a good solution or advice which should be given out.

    > General Purpose Input/Output (GPIO) reports a high state even when it is not physically connected to any circuit

    A pin which is floating should not be expected to return low, or high, or any state. Use a pulldown or pullup to set a state when the pin is not otherwise connected. The internal pullups can be helpful here.

    2 replies

    TDKAnswer
    Super User
    November 23, 2025

    > Given this, I inserted my board into the breadboard, and the problem got fixed.

    Putting your board into a breadboard which connects adjacent pins is absolutely NOT a good solution or advice which should be given out.

    > General Purpose Input/Output (GPIO) reports a high state even when it is not physically connected to any circuit

    A pin which is floating should not be expected to return low, or high, or any state. Use a pulldown or pullup to set a state when the pin is not otherwise connected. The internal pullups can be helpful here.

    Graduate
    November 23, 2025

    @TDK thanks for the follow up. 

    I see where you're going with the breadboard. Since i was not using the side pins, this went unchecked. I'll reframe the original with your advice.

    Best,

    Alessandro

    Super User
    November 24, 2025

    @anardinelli wrote:

    You may encounter an issue when developing for the STM32 microcontroller using STM32 development boards


    This has nothing specifically to do with STM32 or ST boards - the same would apply to any digital input.