ESP32-WROOM-32D does not always reset on power-up

anees.ahmad.jaffer
Posts: 11
Joined: Wed Sep 13, 2023 11:12 am

ESP32-WROOM-32D does not always reset on power-up

Postby anees.ahmad.jaffer » Thu Nov 23, 2023 11:05 am

I have made a board using the ESP32-WROOM-32D N16 module. I have flashed it with code. When pugged into the laptop via USB, the UART kicks in and resets the board, and the code runs without needing to manually press the reset button. When powered on via and external power supply, it requires you to press the reset button before the code runs. The code should immediately execute. This does not happen reliably; sometimes it works, sometimes it doesn't. My initial PCB prototype had a capacitor value of 0.1uF on the RC delay circuit on the EN pin, same as the official schematic. This did not work, so I hand soldered a THT 10uF capacitor in parallel to that. After doing that modification, the board reliably booted correctly, executing the code when powered on.

For my next revision of the board, I changed the 0.1uF capacitor to a 10uF SMD component. Now I have the problem mentioned above, where it does not always execute the code on power up. I have measured the voltage level on the EN pin. This RC delay circuit has a total rise time of about 6ms.
Screenshot (164).png
Screenshot (164).png (246.65 KiB) Viewed 12323 times
Here is my schematic. Please note that the resistors on the GPIO pins are 0 ohm resistors, which I used in case I need to debug and disconnect any of the pins from the rest of the board.
Screenshot (166).png
Screenshot (166).png (314 KiB) Viewed 12323 times

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

Re: ESP32-WROOM-32D does not always reset on power-up

Postby ESP_Sprite » Thu Nov 23, 2023 12:34 pm

Do you happen to have a capacitor to ground (possibly because you want to debounce the button) on GPIO0?

anees.ahmad.jaffer
Posts: 11
Joined: Wed Sep 13, 2023 11:12 am

Re: ESP32-WROOM-32D does not always reset on power-up

Postby anees.ahmad.jaffer » Thu Nov 23, 2023 1:57 pm

I do. It is 0.1uF. Here are the rest of the schematics
Screenshot (167).png
Screenshot (167).png (309.06 KiB) Viewed 12265 times

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

Re: ESP32-WROOM-32D does not always reset on power-up

Postby ESP_Sprite » Fri Nov 24, 2023 2:28 am

Yeah, remove that. Likely it's empty when you boot up and it is only charged by the internal pullup on GPIO0, so there's a high chance the ESP32 comes out of reset and sees GPIO0 low, causing it to boot into download mode rather than start your application.

Franco
Posts: 104
Joined: Thu Dec 10, 2015 1:11 pm

Re: ESP32-WROOM-32D does not always reset on power-up

Postby Franco » Fri Nov 24, 2023 10:36 am

Apart from the topic, for the next revision of the pcb, you may want to update the module to the current revision, which is the the ESP32-WROOM-32E

anees.ahmad.jaffer
Posts: 11
Joined: Wed Sep 13, 2023 11:12 am

Re: ESP32-WROOM-32D does not always reset on power-up

Postby anees.ahmad.jaffer » Mon Nov 27, 2023 9:23 am

ESP_Sprite wrote:
Fri Nov 24, 2023 2:28 am
Yeah, remove that. Likely it's empty when you boot up and it is only charged by the internal pullup on GPIO0, so there's a high chance the ESP32 comes out of reset and sees GPIO0 low, causing it to boot into download mode rather than start your application.
Thanks for the suggestion. I found a timing diagram in the datasheet. What I understood from it was that IO0 must be kept high for at least 1ms while EN is low. Let's assume both IO0 and EN start to charge up at the same time. For EN, on the oscilloscope, I measure a total rise time from power on of about 6ms. For IO0, using the internal (weak) pullup of 45k ohms and my capacitor of 0.1uF, I calculate the time constant to be 4.5ms. To be considered high, V_IH must be 0.75*VCC (according to the datasheet). This happens at t = 1.4*RC, or 1.4 time constants, which is 6.3ms. This does explain why it doesn't boot from SPI code on power up. This also explains why it is able to boot correctly on subsequent power ups, because the IO0 capacitor is already charged.

Extended question, why does the datasheet say to put a capacitor on IO0. Keep in mind my capacitor on EN is 10uF, 100 times the recommended amount (the recommended value did not work for me)

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

Re: ESP32-WROOM-32D does not always reset on power-up

Postby ESP_Sprite » Tue Nov 28, 2023 1:56 am

anees.ahmad.jaffer wrote:
Mon Nov 27, 2023 9:23 am
Extended question, why does the datasheet say to put a capacitor on IO0.
Where do you see this?

anees.ahmad.jaffer
Posts: 11
Joined: Wed Sep 13, 2023 11:12 am

Re: ESP32-WROOM-32D does not always reset on power-up

Postby anees.ahmad.jaffer » Tue Nov 28, 2023 9:11 am

Not on the chip/module datasheet (https://www.espressif.com/sites/default ... eet_en.pdf), but on the devboard schematic: https://dl.espressif.com/dl/schematics/ ... v4-sch.pdf. This is also where I got the value for my first RC delay circuit (R=10k, C=0.1uF), which didn't work. Then I used 10uF which worked most of the time

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

Re: ESP32-WROOM-32D does not always reset on power-up

Postby peterdrinnan » Thu Jun 27, 2024 3:53 am

I had this issue with just 1 esp32 wroom dev board. It was the only board I have seen with that issue after using dozens of esp32 wroom boards. The fix was fairly simple and seems to be reliable. The unit has been powered down/up dozens of times in the last few days. Just bridge the vin (5v) to GPIO 0 with a 10kohm resistor.

Here is a diagram to clarify:

Image

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

Re: ESP32-WROOM-32D does not always reset on power-up

Postby ESP_Sprite » Fri Jun 28, 2024 1:36 am

peterdrinnan wrote:
Thu Jun 27, 2024 3:53 am
I had this issue with just 1 esp32 wroom dev board. It was the only board I have seen with that issue after using dozens of esp32 wroom boards. The fix was fairly simple and seems to be reliable. The unit has been powered down/up dozens of times in the last few days. Just bridge the vin (5V) to GPIO 0 with a 10kohm resistor.
Odd, maybe there's some conductive crap somewhere on the PCB that forms some resistance between GPIO0 and ground. One remark, though: better run the resistor between 3.3V and GPIO0; the GPIOs on the ESP32 aren't rated to be 5V-compatible.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], kaxx1975, Majestic-12 [Bot] and 207 guests