Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)
User avatar
By TRIROG
#10394 I'm using EPS12 with the latest NODEMCU firmware and have a switch connected to GPIO2 ... when the switch is closed the GPIO2 is connected to GND via 10k resistor.
What i noticed is that if The switch is closed during power on (i.e. GPIO2 is connected to GND) the module is unable to boot normally (i get bunch of repeated garbage on the serial). If open (pulled up) or left floating boot up is normal.

Now i understand that connecting GPIO0 on bootup puts the ESP in firmware upload mode, but i'cant seem to find anything related to GPIO2?
Does pulling GPIO2 low on restart also put the ESP in firmware upload mode?
Can anyone tell me if any other GPIOs have the same effect on boot mode if connected to ground?

I plan to use the ESP together with the reed switch to sense the state of the garage doors (pulling GPIO low then door is open) and since power outages are quite common aroung here it might happen that the esp will reboot while the door is open and that could cause it to go in the loop which is unacceptable.

Thanks
User avatar
By gerardwr
#10424
TRIROG wrote:Now i understand that connecting GPIO0 on bootup puts the ESP in firmware upload mode, but i'cant seem to find anything related to GPIO2?
Does pulling GPIO2 low on restart also put the ESP in firmware upload mode?
Can anyone tell me if any other GPIOs have the same effect on boot mode if connected to ground?
Thanks

For a regular boot both GPIO0 and GPIO2 need to be floating, or pulled up with a resistor to Vcc. If at a regular boot either GPIO0 or GPIO2 is LOW, it will not boot.

So re. your switch, make sure it is not closed at boot/reboot time. Perhaps you can change the pulldown of the switch to a pull-up to Vcc and handle the change in the software?

Good luck!
User avatar
By TRIROG
#10428 Yeah ... Thought of that... The problem is that there could be an unfortunate ocrurence where the module will reboot but the switch would be closed/open which is unacceptable... Do you happen to know if GPIO 0 and 2 are only such GPIOS that cause such results i.e. module not booting to normal mode if connected to GND.?

What happens if GPIO2 is conncted to GND during boot i guess it's not a firmware upload mode .