
I admit I’ve never encountered this problem before. You may want to test this setup first on a breadboard to make sure it works for your ESP32 development board. To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 uF electrolytic capacitor between the EN pin and GND. There is a way to fix this once for all – no need to hold down the “BOOT/FLASH” button anymore.

But having to worry about this every time you want to upload new code can be tedious, specially when you’re testing and debugging your code. One of the ways to solve this is holding-down the “ BOOT/FLASH” button in your ESP32 board while uploading a new sketch at the same time. This means that when you try to upload a new sketch to your ESP32, the Arduino IDE fails to connect to your board, and you get the following error message: Holding the BOOT/FLASH button

Some ESP32 development boards (read Best ESP32 boards) don’t go into flashing/uploading mode automatically when uploading a new code. Learn how to fix the Fatal Error Occurred: “ Failed to connect to ESP32: Timed out waiting for packet header” error when trying to upload new code to your ESP32 board once for all.
