跳到主要內容

#003 ESP get into bootloader automatic

I came across a serial pin problem in my record:

I used pin2, and in a way it could work, as long as it's TX and won't be pull high when boot.

But it seems to be better to use other pins


Select bootloader mode

The ESP32 will enter the serial bootloader when GPIO0 is held low on reset. Otherwise it will run the program in flash.
GPIO0 InputMode
Low/GNDROM serial bootloader for esptool.py
High/VCCNormal execution mode
GPIO0 has an internal pullup resistor, so if it is left unconnected then it will pull high.
Many boards use a button marked "Flash" (or "BOOT" on some Espressif development boards) that pulls GPIO0 low when pressed.
GPIO2 must also be either left unconnected/floating, or driven Low, in order to enter the serial bootloader.

Other Pins

As well as GPIO0 and GPIO2, the following pins influence the serial bootloader mode:
GPIOMeaning
12 (MTDI)If driven High, flash voltage (VDD_SDIO) is 1.8V not default 3.3V. Has internal pull-down, so unconnected = Low = 3.3V. May prevent flashing and/or booting if 3.3V flash is connected and pulled high. See ESP32 datasheet for more details.
15 (MTDO)If driven Low, silences boot messages from normal boot. Has internal pull-up, so unconnected = High = normal output.

Automatic bootloader

Automatic bootloader

esptool.py can automatically enter the bootloader on many boards by using the RTS and DTR modem status lines to toggle GPIO0 and EN automatically.
Make the following connections for esptool.py to automatically enter the bootloader:
ESP32 PinSerial Pin
ENRTS
GPIO0DTR
Note that some serial terminal programs (not esptool.py) will assert both RTS and DTR when opening the serial port, pulling them low together and holding the ESP32 in reset. If you've wired RTS to the ESP32 then you should disable RTS/CTS "hardware flow control" in the program. Development boards (including all Espressif boards) usually use additional circuitry to avoid this problem - if both RTS and DTR are asserted together, this doesn't reset the chip.

留言

這個網誌中的熱門文章

Heltec ESP32+OLED+Lora, hardware testing

micro SD card for ESP32, on lolin32 with OLED and heltec 32 lora oled

AIS0. understanding AIS NMEA 0183: How it's coded