ESP32 Custom PCB Programming Issue

julcatsi
Posts: 3
Joined: Sat Nov 20, 2021 10:34 pm

ESP32 Custom PCB Programming Issue

Postby julcatsi » Sat Nov 20, 2021 11:01 pm

Hello everyone,

This is my first time making a PCB for an esp32-c3 module and I have experience making PCBs with atmega chips. I had a very basic pcb made recently to test the most basic version of the board I could. I attached the schematic to this post. I soldered the board to headers and placed it onto a breadboard. I am using an external usb to serial converter to communicate with the board.

I hook up the RX, TX, GND, 5V, and EN pins to the respective pins on the usb to serial chip (EN to RST). I am able to receive serial messages from the esp32 board at 115200 baud rate. The board constantly says "invalid header: 0xffffffff" which from what I have researched is normal for a new chip. This lets me know that the communication to the board is correct.

I am using the Arduino IDE with the expressif esp32 board modules. I left the settings at default and have tried each of the esp32 boards.

How I am attempting to program the board I push boot and en so that the board says over serial:
"Build:Feb 7 2021
rst:0x1 (POWERON),boot:0x0 (USB_BOOT)
wait usb download"

Then I upload a blank sketch to the board. The terminal shows:
"esptool.py v3.1
Serial port COM4
Connecting........_____....._____....._____....._____....._____....._____....._____

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

From what I have read online this seems to be an issue with the chip receiving the reset pulse to start programming.

I have looked into adding another capacitor from EN to gnd but I am not able to identify what is wrong with the boards I have made. One thing that I did not copy from the standard esp32 dev boards is the auto program as I do not need it for my application. Is that section of the schematic required for programming the board even with the use of buttons?

Let me know if anyone has advice on how to proceed to get my boards to work.

Thanks,
Attachments
ESP32C.pdf
(118.14 KiB) Downloaded 435 times

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

Re: ESP32 Custom PCB Programming Issue

Postby ESP_Sprite » Mon Nov 22, 2021 2:55 am

First of all, your 3.3V LDO is waaay too wimpy to power the C3. Not sure if that's your issue here, but it'll bite you in the backside when you continue for sure. Make sure to have a LDO that can provide at least 500mA.

How do you use the buttons to go into download mode? If you do this on a terminal, do you see the ESP32C3 go into download mode?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 Custom PCB Programming Issue

Postby chegewara » Mon Nov 22, 2021 5:49 am

I just tested C3 and from your logs i can say you have problem with pin GPIO8, which is strapping pin.

Code: Select all

ESP-ROM:esp32c3-20200918
Build:Sep 18 2020
rst:0x1 (POWERON),boot:0x0 (USB_BOOT)
wait usb download
As you can see boot: 0x0 is when GPIO8 is LOW and datasheet says it should be HIGH in download mode (page 14):
https://www.espressif.com/sites/default ... eet_en.pdf

In addition this info is important too (also page 14):
The strapping combination of GPIO8 = 0 and GPIO9 = 0 is invalid and will trigger unexpected behavior.

julcatsi
Posts: 3
Joined: Sat Nov 20, 2021 10:34 pm

Re: ESP32 Custom PCB Programming Issue

Postby julcatsi » Tue Nov 23, 2021 2:30 am

Hi chegewara,

Thanks for the speedy reply. I now see the strapping pins in the datasheet. I see that the data sheet pull gpio9 up in the auto program circut. Either way I tried the respective pins to either gnd or 3.3v.


When I only connect GPIO8 to HIGH I get the following message upon BOOT and EN:
Serial:
20:40:48.165 -> rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/1))
20:40:48.165 -> waiting for download

This was not able to get the board to download my program.
I believe I need to get boot:0x3 as that is what I need for my other esp32 boards but I am not sure what is required for this board,

Again, during this process I am holding boot (GPIO9 to low).

I also tried GPIO2 to HIGH along with GPIO9 and I got the following message:
Serial:
20:43:51.285 -> rst:0x1 (POWERON),boot:0x7 (DOWNLOAD(USB/UART0/1))
20:43:51.285 -> waiting for download

Do you know what set of pins is required to get it to accept programming or if I need to bring each pin up or down in an order.

Also for reference I am just connecting wires and no resistors to pull the pins up or down which I believe is correct.

Thanks,

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 Custom PCB Programming Issue

Postby chegewara » Tue Nov 23, 2021 3:36 am

I believe you should not compare esp32 and C3 logs in download mode.
In my case, C3 devkit, when i use buttons to enter download mode it is boot: 0x4.

This is all i can help you with, sorry, maybe someone else can see something i dont.

julcatsi
Posts: 3
Joined: Sat Nov 20, 2021 10:34 pm

Re: ESP32 Custom PCB Programming Issue

Postby julcatsi » Wed Nov 24, 2021 4:05 am

Hello,

I found the last issue with it. I was using an Arduino Uno programming chip (the chip from the arduino uno with the microprocessor removed) and I was able to communicate over serial but for some reason I could not program the esp32 chip. I removed the esp32 module from my esp32dev board and I was able to correctly program the esp32C chip with that as a programmer. I am not sure if this is because of the auto program circuit or the particular usb to serial converter on the board but I am happy it is working. Using an esp32 as a programmer works well for my application.

Thanks,

In summary for other people with this issue,
Make sure Pin 8 is pulled high, pin 9 is connected to boot, and I recommend using an esp32 with the module removed to program a esp32C module if you are having issues programming your board.

A symptom I saw that indicated I had to try another programming chip was that the esp32 took a long time to connect (....._____......____) see attached picture.
Attachments
Esp32 Error Message.png
Esp32 Error Message.png (193.25 KiB) Viewed 15443 times

maximus
Posts: 1
Joined: Wed Dec 08, 2021 3:37 am

Re: ESP32 Custom PCB Programming Issue

Postby maximus » Wed Dec 08, 2021 3:44 am

The ESP32-C3 datasheet lists GPIO8=0 and GPIO9=0 combination as invalid but I consistently get following with this boot combination:

Code: Select all

ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0x0 (USB_BOOT)
wait usb download
In this mode I am able to program the ESP32-C3 using the internal USB Serial/JTAG Controller. Is the datasheet incorrect here?

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

Re: ESP32 Custom PCB Programming Issue

Postby ESP_Sprite » Wed Dec 08, 2021 6:50 am

The nomenclature 'invalid' should be read as 'unsupported' here. In your particular situation, in your particular chip, it does happen to give a valid download mode. However, we don't guarantee 1. that it actually works as you'd expect it, and 2. that this mode will be there and keep doing the same in future chips, so don't go depend on it in any way, shape or form.

Who is online

Users browsing this forum: No registered users and 84 guests