ESP8266 Boot Mode Selection

Angus Gratton edited this page Jan 9, 2017 · 1 revision

ESP8266 Boot Mode Selection

Guide to selecting boot mode correctly on ESP8266.

On many development boards with built-in USB/Serial, this is done for you and esptool.py can automatically reset the board into bootloader mode. For other configurations, you will need to follow these steps:

Required Pins

The following ESP8266 pins must be pulled high/low for either normal or serial bootloader operation. Most development boards or modules make these connections already, internally:

GPIO Must Be Pulled
15 Low/GND (directly, or with a resistor)
2 High/VCC (always use a resistor)

If these pins are set differently to shown, nothing on the ESP8266 will work as expected. See this wiki page to see what boot modes are enabled for different pin combinations.

GPIO2 should always use a pullup resistor to VCC, not a direct connection. This is because it is configured as an output by the boot ROM. If GPIO15 is unused then it can be connected directly to ground, but it's safest to use a pulldown resistor here as well.

Select bootloader mode

The ESP8266 will enter the serial bootloader when GPIO0 is held low on reset. Otherwise it will run the program in flash.

GPIO0 Input Mode
Low/GND ROM serial bootloader for esptool.py
High/VCC Normal execution mode

Many configurations use a "Flash" button that pulls GPIO0 low when pressed.

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:

ESP8266 Pin Serial Pin
CH_PD ("enable") or nRESET RTS
GPIO0 DTR

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 ESP8266 in reset. If you've wired RTS to the ESP8266 then you should disable RTS/CTS "hardware flow control" in the program. Development boards like NodeMCU use additional circuitry to avoid this problem - if both RTS and DTR are asserted together, this doesn't reset the chip.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.