ESP32 won't start or upload when a part is on GPIO 0, 2, 5, 12 or 15

  • ESP32

You may see

invalid header: 0xffffffff
flash read err, 1000
Invalid header

Why it happens

  • GPIO 0, 2, 5, 12 and 15 are checked at start-up.
  • GPIO 12 held HIGH at start-up makes the board feed its memory chip 1.8 V instead of 3.3 V, so it can't start.

How to fix it

  1. Unplug the wires on GPIO 0, 2, 5, 12 and 15 and press EN (reset). If it starts, one of them was the cause.
  2. Move that part to a safe pin such as 4, 13, 14, 18, 19, 21, 22, 23, 25, 26, 27, 32 or 33, and change the number in the code.
  3. An LED with a resistor to GND on these pins usually causes no trouble; a pull-up, relay or sensor might.

It worked if: The board starts and uploads with everything connected.

From the official documentation. Pins and the GPIO 12 rule from Espressif. Sources: Espressif esptool: boot mode selection, Espressif: ESP32 GPIO notes.

Didn't help? Search another error or ask us.