Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By JR Miller
#41810 I found interesting problem, and was looking on these forums to see if common/known problem. I didn't find anything, so maybe something to consider if your module won't start.

I'm using an ESP-07 module. It will not start if the TXD pin is pulled down at reset time!!!

The digital input I use for the TXD pin has a 10K pulldown resistor on it. This, combined with internal pullup of esp8266 puts the voltage on the TXD pin at 0.9V when ESP is in reset. However, when reset is released, it does not start.

If I disconnect the digital input (with pulldown) and reset it starts, then I can attach the input. Works then.

I added a 2.2K pullup resistor on TXD to 3.3V and now it is able to start.

I'm using the default firmware which came on the module: [Vendor:www.ai-thinker.com Version:0.9.2.4]

Have you seen this before? Is the firmware intentionally checking the TXD pin? Or is it something in the boot loader? I'd really like to know why this is happening.

Thanks!
User avatar
By gaber
#41844 TXD that you are using is likely GPIO2 on the chip (pin14).
The boot mode of the device is determined by 3 pins: GPIO0, GPIO2, and MTDO

When the device boots it will print a statement like this:

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

where mode:(x,y)
GPIO2 is <00n> low order bit for x
GPIO0 is <0n0> middle order bit for x
MTDO is <n00> high order bit for x

See this doc:
http://microchip.ua/esp8266/ESP8266_Mod ... 0Guide.pdf

Mode 3: Standalone mode (normal mode):
GPIO2: 1 (has internal pull-up / TX output mode)
GPIO0: 1 (if 0 it would be programming mode, so set it to 1 with external pull-up resistor)
MTDO: 0 (using external pull-down resistor)

Mode 1: UART download mode (programming mode):
GPIO2: 1 (has internal pull-up / TX output mode)
GPIO0: 0 (set to GND to program the ESP8266 SPI flash)
MTDO: 0 (using external pull-down resistor)

Mode 4: SDIO / SPI mode:
GPIO2: X (dont care)
GPIO0: X (dont care)
MTDO: 1

Mode 2: (??) (not sure what this mode is -- likely this is the mode you are going into..)
GPIO2: 0
GPIO0: 1
MTDO: 0

So, the best I can tell, you should just not pull GPIO2 down upon bootup -- it is likely going into some funky mode that is not what you want -- which is mode 3 the flash boot mode most likely or programming mode, mode 1.

-Gabe
User avatar
By JR Miller
#41868 Gabe,

Thank you for your thorough reply. The document you referenced is especially useful.

Actually, I'm not using GPIO2 pin for TXD. It is floating. The TXD I'm using is the U0TXD pin (GPIO1).

But, from the document you attached, they say:
"GPIO0, GPIO2 and U0TXD should be kept high" and " MTDO should be kept low when powering on the chip."

So, they do say the TXD pin needs to be high at startup ... too bad it's not in the datasheet. I guess this isn't normally an issue, since the FTDI chip most people use has pull-ups on its input.

Again, that document is excellent (should be part of data sheet). Also explains why the mode control pins should be pulled up/down with resistors instead of directly connected to VCC/GND.

Good stuff! Thanks
User avatar
By gaber
#41880 Happy to help -- yea it looks like the take-home message is, don't use GPIO2, GPIO0, MTDO, and U0TXD for your design if you want to avoid bootup issues.

GPIO2 has an internal pull-up resistor on it, so if your UART dongle is connected or not to GPIO2 it should be reading high. The UART dongle RX input probably has a pretty large pull-up resistor maybe 100k just to avoid lots of spurious signals coming in on the RX input if you leave it floating. The normal state for UART TX pin is high so it makes sense that the pin is high when used as TX output and also for the boot functionality. So its a bit funky that they have a UART TX output that also has a pull-up resistor on it since typically that is not so normal.