Howdy folks,I understand that to place the ESP8266 into flashing mode, I need to bring GPIO0 low during boot. I am pretty solid on that notion. However, there appears to be a lot of chatter on the signal values needed on GPIO2 and GPIO15 during boot.

My best guesses are:

GPIO2 - This is also UART1 TX which is used during debugging. During flash, it is also outputting the flash progress. As such, it should be left dangling as it is outputing a signal and there is no way to stop it doing that and we do not wish to apply that signal to other components or the power rails.

GPIO15 - This is UART0_RTS which, if I believe is the control pin that is used to signal to a UART that it is allowed to transmit.

What are the signals that are recommended by Espressif to be on these pins during boot in order to allow us to flash new firmware?

kolban wrote:Howdy folks,I understand that to place the ESP8266 into flashing mode, I need to bring GPIO0 low during boot. I am pretty solid on that notion. However, there appears to be a lot of chatter on the signal values needed on GPIO2 and GPIO15 during boot.

My best guesses are:

GPIO2 - This is also UART1 TX which is used during debugging. During flash, it is also outputting the flash progress. As such, it should be left dangling as it is outputing a signal and there is no way to stop it doing that and we do not wish to apply that signal to other components or the power rails.

GPIO15 - This is UART0_RTS which, if I believe is the control pin that is used to signal to a UART that it is allowed to transmit.

What are the signals that are recommended by Espressif to be on these pins during boot in order to allow us to flash new firmware?

Neil

Hi Neil,

The reason that GPIO2 and GPIO15 should be considered with GPIO0 during programming flash, is that:

- GPIO15, GPIO0, GPIO2 forms boot_sel(2:0) to be sampled in during reset and to determin the boot mode

- Programing flash using uart0 requires a boot mode of "boot from uart0" with boot_sel=b001, that is, we need make sure GPIO15=0, GPIO0=0, and GPIO2=1 during reset

- Since GPIO15, GPIO0, and GPIO2 all have internal weak pullups, you could leave GPIO2 dangling to get GPIO2=1, however, you should provide external pulldowns to GPIO15 and GPIO0, so as to get "0"s for these two signals.

That was a great post and cleared things up considerably for me. Thank you so much.

I now realize that the pins GPIO0, GPIO2 and GPIO15 when taken together form a 3 bit number, I am guessing that it is GPIO15 - GPIO0 - GPIO2. So a value of GPIO15=0, GPIO0=0 and GPIO2=1 gives us the binary number 001 (or 1 in decimal). The value of this 3 bit number is used to determine how the ESP8266 boots. If the value is 1, then the device boots from UART ... and hence allows us to flash it.

I had wrongly been assuming that it was only GPIO0 that was being used ... 1 = normal, 0 = flash ... but now I fully understand it is the combination of the three bits.

Since three bits gives us 8 permutations 000 - 111, I am assuming that a boot of 000 means a normal boot from flash memory. I am now wonder what (if anything) the other 6 permutations are defined to mean. But that is another story ...

Later ... AHA!!! I found document 0D and that explains ALL the permutations. AWESOME!!!

Documentation

About Us

Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.