Page 1 of 1

Confusion about EN and BOOT0

Posted: Mon May 06, 2024 10:02 am
by derveroonibo
Hello,
in the ESP Docs there is a Boot Mode Selection guide. This states that EN needs to be pulled low. Then the boot0 pin is pulled to select either bootloader mode or run mode.
The ESP32 will enter the serial bootloader when GPIO0 is held low on reset. Otherwise it will run the program in flash.
I hooked up a logic analyzer to my ESP32 and observed the EN and Boot0 Lines upon flashing via Arduino IDE.
Here it is very cleary visible that EN is pulled low while boot0 is high. Then EN goes high again. Only after this boot0 goes low. Meaning the logic described in the guide is not correct. The boot0 pin goes low about 0.1 ms after EN goes high. An image is in the attachments.
How is this explainable? Why does the esptool not set the lines correctly yet it still works? Is this fixable somehow? I need a boot0 in the correct level while EN has the rising flank.

Re: Confusion about EN and BOOT0

Posted: Mon May 06, 2024 10:37 am
by ESP_Sprite
Could be a measurement issue. There is a RC network on the EN line (making the signal effectively analog) and the logic level threshold on that pin is a bit weird, probably different from the logical analyser. If you have an oscilloscope, I'd stick that on it.

Re: Confusion about EN and BOOT0

Posted: Mon May 06, 2024 11:41 am
by MicroController
IIRC, taking EN high starts the MCU, which then runs the ROM bootloader, which in turn reads the state of the BOOT pin to determine what to do. So it is safe/recommended to pull the BOOT pin low before pulling EN high, but a small delay (millisecond or so) between EN going high and BOOT going low may also still work as long as BOOT is low when the bootloader actually reads its state.

Or, I may be mistaken: https://esp32.com/viewtopic.php?t=31363#p107753

Re: Confusion about EN and BOOT0

Posted: Mon May 06, 2024 12:13 pm
by ok-home
straping.JPG
straping.JPG (58.74 KiB) Viewed 1033 times

Re: Confusion about EN and BOOT0

Posted: Tue May 07, 2024 6:39 am
by derveroonibo
Thanks for the replies.

I also looked at the levels using the analog channels. It is the same result.

Makes sense that it works if there is a 1 ms delay to read the pin though. The delay shown is only 0.1 ms.

I can use a different solution to my problem that works in both cases.