ESP32 runs program only after EN pressed.

hra.leinonen
Posts: 3
Joined: Wed Aug 25, 2021 7:56 am

ESP32 runs program only after EN pressed.

Postby hra.leinonen » Wed Aug 25, 2021 8:05 am

Hi all,

I have strange problem.

I have 2 Elecrow ARS01119B - ESP-WROOM-32 boards and I can upload my code if I press boot button and it is ok.
However my code won't start to run when I take power (USB) off and put it back on. Only way to get code running is
to press EN button. Any suggestion what I can do to prevent that forced EN press?

Best regards,

Ville

martinius96
Posts: 34
Joined: Thu Dec 13, 2018 1:39 am

Re: ESP32 runs program only after EN pressed.

Postby martinius96 » Wed Aug 25, 2021 1:44 pm

Problem is same at most popular Devkit ESP32 boards.
There are used 2 capacitors for EN and Boot signal with same characterstics.
So when you plug on ESP to USB, there is for small duration of time GND signal at EN and BOOT (because capacitors are charging).
This state is known as DOWNLOAD state. If you press BOOT and EN button in same time, you will set ESP32 to download mode.
Output in Serial looks like (In Arduino IDE you can't see it, because if you open Serial monitor it will reset ESP32):

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x0 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_FEO_V2))
waiting for download
You can use other ESP to read its HW Serial to see that output in it's console.
In this mode ESP32 is locked until you reset it manually via EN button, there is no timeout of some mechanism like that that will let you run code without reset.

So fast solution is: Use different capacitor for one of signals or remove capacitor from BOOT, or add 10K resistor between BOOT (GPIO 0) and Vcc. If you use any of these methods, it will run your program when you plug it to usb without need of resetting ;) .

peterwong
Posts: 1
Joined: Sun Oct 08, 2023 10:09 pm

Re: ESP32 runs program only after EN pressed.

Postby peterwong » Sun Oct 08, 2023 10:13 pm

thank you for this post! i had exactly the same issue with an old DevkitC board i was using, and adding in the 10k resistor between GPIO 0 and 5V cleared it right up. :mrgreen:

ebinmjohnson
Posts: 2
Joined: Tue Jun 11, 2024 8:27 am

Re: ESP32 runs program only after EN pressed.

Postby ebinmjohnson » Tue Jun 11, 2024 9:17 am

Is there any alternative solutions rather than hardware approach like the resistors or removing capacitors? Thanks in advance.

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 runs program only after EN pressed.

Postby ESP_Sprite » Tue Jun 11, 2024 10:03 am

Like what? Given that you're software isn't even starting up, this is not something you can solve in software.

ebinmjohnson
Posts: 2
Joined: Tue Jun 11, 2024 8:27 am

Re: ESP32 runs program only after EN pressed.

Postby ebinmjohnson » Tue Jun 11, 2024 10:10 am

I was wondering if anything can be done in bootloader, during booting, or in configuration files. Like disabling the download mode, I donno if this is possible.

peterdrinnan
Posts: 2
Joined: Wed Jun 26, 2024 4:02 am

Re: ESP32 runs program only after EN pressed.

Postby peterdrinnan » Wed Jun 26, 2024 4:16 am

"Add a 10K resistor between BOOT (GPIO 0) and Vcc." - This worked for me. Previously wasted time with a capacitor between EN and ground, and also a 100k resistor between GPIO 0 and 3.3v. Nothing worked until I connected the 10k resistor between GPIO 0 and VCC (5v).

Who is online

Users browsing this forum: No registered users and 41 guests