NUCLEO Pin reading high even when it's not
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
