Custom ESP-12F board doens't reset while flashing

I designed a custom board with an ESP-12F and a CP2104. Everything works perfectly except the reset of the MCU during flashing. I have to hold down the reset button and roll my finger to the boot button and hold it like that until it starts flashing. Then, I have to press reset one more time when it’s done flashing before my new firmware will actually start. If I don’t, I get

"/usr/bin/python" "/home/marcel/.platformio/packages/tool-esptoolpy@1.30000.201119/esptool.py" --before default_reset --after hard_reset --chip esp8266 --port "/dev/ttyUSB1" --baud 115200 write_flash 0x0 .pio/build/nodemcuv2/firmware.bin
esptool.py v3.0
Serial port /dev/ttyUSB1
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

I tried the different settings for the reset method: Espressif 8266 — PlatformIO latest documentation

I’ve been double and triple checking everything. As far as I can tell, I connected nDTR and nRTS correctly through transistors to nRTS and GPIO0.

Everything looks identical to this NodeMCU schematic except for some 10k vs 12k resistors and the 470p cap on RST. Could that really make such a difference? And of course they use a CH340G while I use CP2104.

Here’s my KiCad files: GitHub - youdbetterrun/youdbetterrun-pcb: PCB for the project You'd Better Run.

Add the capacitor you omitted between the Reset pin and GND.

You have a global net label and net label of the same name (RST) so they are shorted together.
You probably have other similar mistakes on the other pages.

Thanks for the answer

You have a global net label and net label of the same name (RST) so they are shorted together.

I have a net label RTS and a hierarchical label RST. RTS != RST.

I would have notice during routing if my BJT were shorted :wink:

You probably have other similar mistakes on the other pages.

Why do you assume that?

Thanks for the response. I tried adding a capacitor between RST of the ESP and GND, but the same behaviour.

GPIO2 - I believe that has to be pulled-up.

Thanks for the answer. I tried a 10k pullup to 3.3V but same thing. That also wouldn’t make sense that I can get it working using the RST and BOOT buttons.

GPIO0 and 2 are "Boot pins".

Yep I see that now but it’s still not working

There is something of a discussion about how the reset works in this discussion:

https://electronics.stackexchange.com/questions/473443/esp32-dev-board-dtr-rts

The last post suggests placing the 10uF capacitor between the GPIO0 line and ground and a 100nF between RESET (EN) and ground to create the correct delay on each pin.
It also has a link to the Espressif schematic.

The term is 'strapping pins' and they define behavior at boot when pulled LOW vs (HIGH or Free-floating) and the same goes for GPIO 1 aka Tx.

But since the OP can get it to work by keeping GPIO 0 LOW and reset, the issue must be in the automated reset system somehow.

What i did notice is the lack of the 470R resistor between GPIO 0, your 'boot' button and GND. Like that you may burn GPIO 0 by accident if it is in output mode and 'HIGH' and you press that button.

That may be relevant though i guess they are interchangeable.

Best advice i can come up with is using a oscilloscope or logic analyzer to figure out what happens with the !DTR & !RST outputs.

A-Beginner's-Guide-to-the-ESP8266.pdf (2.8 MB)
"Pg. 18 of 64" ?

gippity say -- The EN (CH_PD) pin needs to rise after VCC, or at least not too early. If it comes up too fast, the chip may not reset properly.
Fix: Add an RC delay to EN—e.g., 10kΩ pull-up with a 1µF cap to GND gives ~10ms delay. This ensures EN rises after VCC stabilizes.

Sorry for the delay. Finally took my scope out.

Yellow is RST. Blue is io0.


It really looks like the reset line is not getting pulled down enough.

Here, yellow is RTS and blue is DTR. They are both fully pulled down.

I think my transistor pinout is wrong.

I referenced something like this:

But the surface mount component I’m using has this:

So base and emitter swapped

That variation for a TO-92 package is new to me. But yes that would explain things.

Does seem that way.

By some miracle, I had some S8050 with legs in a drawer. I bodged them on, and it’s working perfectly now