Troubleshooting

The "Wrong boot mode detected" error with an ESP32, especially when using a BOOT button, usually indicates that the board is not in the correct download mode to receive new code. This happens when the ESP32 fails to enter the bootloader or download mode when trying to upload a sketch. Here's a breakdown of common causes and solutions:Understanding Boot Mode Selection:

  • GPIO0 (Boot/Download) Pin:The primary strapping pin for selecting boot mode. It's either pulled to ground or left floating to enter download mode.

  • ESP32-S3:The ESP32-S3 might require manual boot mode selection via the Boot button.

  • Automatic Bootloader:Some ESP32 boards have automatic bootloader selection, which might be triggered by the EN (Enable) button.

  • GPIO2 and Boot Mode:GPIO2 should be either left unconnected or driven low for the serial bootloader to work.

Common Causes and Solutions:

  1. 1. Manual Boot Mode Selection (BOOT Button):

    • Press and Hold BOOT: When you start the upload process in the Arduino IDE or esptool.py, press and hold the BOOT button (or the button labeled as "Download" or "FLASH") on your ESP32.

    • Press and Release RESET: While holding the BOOT button, briefly press and release the RESET button.

    • Release BOOT: After the ESP32 is detected in download mode, release the BOOT button.

  2. 2. Micro SD Card:

    • Remove SD Card: A micro SD card in the ESP32 can interfere with uploading sketches, especially if the boot mode is not correctly initialized.

  3. 3. GPIO2 and Boot Mode:

    • Ensure GPIO2 is Low or Unconnected: GPIO2 should be either left unconnected or driven low for the serial bootloader to work.

    • Try GPIO15: If using GPIO2, try using GPIO15 instead and leaving GPIO2 disconnected.

  4. 4. Incorrect Serial Port:

    • Check Serial Port: Ensure you are selecting the correct serial port in your software (Arduino IDE, esptool.py, etc.).

  5. 5. USB Driver Issues:

    • Driver Update/Reinstall: Outdated or buggy USB drivers (especially for CP2102 or CH340) can cause problems with flashing. Try updating or reinstalling the drivers for your specific USB to UART bridge chip.

  6. 6. Power Supply Issues:

    • Stable 3.3V: Ensure the ESP32 receives a stable 3.3V power supply.

  7. 7. Bootloader Issues:

    • Factory Reset (if needed): If you suspect a corrupted bootloader, you might need to factory reset the ESP32 using a dedicated bootloader or a special tool.

  8. 8. Espressif Documentation:

    • Refer to Documentation: Consult the official Espressif documentation for your specific ESP32 module for more detailed boot mode selection instructions.

By carefully checking these points and following the manual boot mode selection procedures, you should be able to resolve the "Wrong boot mode detected" error and successfully upload code to your ESP32.

Last updated