While working on a small example project with an ESP32, I encountered an issue with button detection on pin 34. Despite multiple attempts to troubleshoot, the button simply wouldn't work as expected. Finally, I added an external pullup resistor—and voilà, it worked perfectly!
Curious about the cause, I did some research and discovered an important detail: only GPIOs that can function as both input and output support software-configurable pullups. GPIO pins 34 to 39, however, are input-only and therefore require external pullups for proper operation.
According to some Github issues, I'm not the first person this has happened to, so I’m leaving this note here as a reminder for future projects.
If you’re using GPIO 34-39, don’t forget to add external pullups!
For more details, check out the official ESP-IDF documentation.