-->
Page 1 of 1

Immediate execution after flashing new application

PostPosted: Fri Jul 17, 2015 11:39 pm
by kolban
I seem to be finding that immediately after flashing an application into the ESP8266 it starts running. I would have expected that after flashing the device would be in some kind of halted state waiting for a restart. Here is my loose thinking ... in order to flash the device, we need to pull GPIO 0 low. Now imagine I actually wired it to ground and flashed my application into the ESP8266 and is starts running. Now let us further assume that my logic made GPIO 0 an output pin and set its logic level to high. Would this not create a short or otherwise damage the device?

Re: Immediate execution after flashing new application

PostPosted: Sat Jul 18, 2015 12:52 am
by lethe
Yes, that's why you should never connect GPIOs directly to VCC or GND. Always use pull-up/down resistors.
When the pin is connected to GND, there might be an internal current limiting resistor, but you really should not rely on that. The datasheet does not mention anything like that and also does not provide an equivalent circuit schematic.

Re: Immediate execution after flashing new application

PostPosted: Sat Jul 18, 2015 2:39 pm
by kenn
kolban wrote:I seem to be finding that immediately after flashing an application into the ESP8266 it starts running. I would have expected that after flashing the device would be in some kind of halted state waiting for a restart. Here is my loose thinking ... in order to flash the device, we need to pull GPIO 0 low. Now imagine I actually wired it to ground and flashed my application into the ESP8266 and is starts running. Now let us further assume that my logic made GPIO 0 an output pin and set its logic level to high. Would this not create a short or otherwise damage the device?


Well, your application could test GPIO0 before using it as an output.

Initially I was using a jumper to pull GPIO0 low to flash, but then I simply added a second pushbutton besides the reset button on my dev board. To flash, I hit both buttons and release the reset first. So I won't have an issue with that.

Given that you have several in/out pins to use, it's usually possible to assign GPOI0 to a use that's compatible with it's second role as the flash signal. And the resistor is a good idea in any event.