Page 1 of 1

ESP32 Custom PCB not starting up except when U0RXD is pulled up or down externally

Posted: Mon Jul 27, 2020 3:42 am
by amrbekhit
Hello all,

I've designed a custom 2-layer PCB using an ESP32-D0WD V3. I'm using a MircroMatch connector as a programming interface, routing the EN, BOOT and UART pins there. I'm having an issue whereby the boards will fail to start up normally, unless the U0RXD pin is pulled up or down via a resistor or I connect my programmer (basically an FT232R) to the programming connector. Once connected, the board works perfectly fine, with WiFi output power even exceeding the output power of a commercial ESP32-WROOM module by 10-20dBm (as measured by my smartphone).

Without this resistor or without connecting the programming cable, the board can very often fail to startup, and even if it starts, touching the pins of the programming connector can cause it to stop working. With the resistor, touching the connector has no effect on the performance of the board and it continues to operate just fine. I'd like to point out that this only works with the U0RXD pin - applying this resistor to any of the EN, BOOT or U0TXD pins does not solve the issue.

I haven't found anything in the datasheets regarding U0RXD - from what I can tell, there should be an internal pull-up resistor anyway.

Any thoughts on this?

Re: ESP32 Custom PCB not starting up except when U0RXD is pulled up or down externaly

Posted: Mon Jul 27, 2020 9:57 am
by ESP_Sprite
Could it be that there's too much parasitic capacitance on GPIO0 to make the built-in pullup pull the line up in time? How long are your lines, what else is connected to GPIO0?

Re: ESP32 Custom PCB not starting up except when U0RXD is pulled up or down externaly

Posted: Mon Jul 27, 2020 11:24 am
by amrbekhit
ESP_Sprite wrote:
Mon Jul 27, 2020 9:57 am
Could it be that there's too much parasitic capacitance on GPIO0 to make the built-in pullup pull the line up in time? How long are your lines, what else is connected to GPIO0?
Hmm - the trace length is 24mm. You can see a screenshot of the relevant layout below. However, I've tried directly shorting the BOOT pin to 3.3V and the problem is still there. As I mentioned in my first post, it's only by applying a pull-up/pull-down to the U0RXD pin is the problem resolved.
esp32.png
esp32.png (95.25 KiB) Viewed 4558 times

Re: ESP32 Custom PCB not starting up except when U0RXD is pulled up or down externaly

Posted: Tue Jul 28, 2020 1:43 pm
by ESP_Sprite
That is strange for sure... any chance you can capture what the chip sends on U0TXD when this happens?

Re: ESP32 Custom PCB not starting up except when U0RXD is pulled up or down externaly

Posted: Wed Jul 29, 2020 10:47 am
by amrbekhit
ESP_Sprite wrote:
Tue Jul 28, 2020 1:43 pm
That is strange for sure... any chance you can capture what the chip sends on U0TXD when this happens?
Problem solved! Turns out it was a purely software issue - basically I have some code that monitors the serial port and parses the incoming data, but I wasn't adding in checks for unexpected data. Me touching the U0RXD pin was causing random characters to be detected by the ESP32 and causing the code to crash.

I'm using platformio and the ESP32 Arduino framework. Looking at the source code, it looks like the internal pull-up is not automatically enabled by the Serial.begin routine. By adding the necessary software checks and manually enabling the pull-up via pinMode, the problem is completely resolved.

Re: ESP32 Custom PCB not starting up except when U0RXD is pulled up or down externaly

Posted: Wed Jul 29, 2020 2:35 pm
by ESP_Sprite
Good to hear, and thanks for posting what the issue was. I almost started doubting my knowledge that U0RX is not a bootstrap pin...