A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
-
- Posts: 5
- Joined: Mon Sep 19, 2022 11:50 am
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Hi,
I'm woking on a project with a custom board based on ESP32, I attach the schematics project. When I try to load the program into the board, I get the following error:
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header.
I'm using an USB to UART converter, connecting the TX pin converter to RX custom board and RX pin to TX, both GNDs are also connected. In order to make the board enter to boot mode, I connect GPIO0 and GPIO2 directly to GND, but I can't load the program anyway.
Board is powered through Ethernet cable PoE correctly and I think connections are correct. Can someone help me?
Thanks,
Alberto
I'm woking on a project with a custom board based on ESP32, I attach the schematics project. When I try to load the program into the board, I get the following error:
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header.
I'm using an USB to UART converter, connecting the TX pin converter to RX custom board and RX pin to TX, both GNDs are also connected. In order to make the board enter to boot mode, I connect GPIO0 and GPIO2 directly to GND, but I can't load the program anyway.
Board is powered through Ethernet cable PoE correctly and I think connections are correct. Can someone help me?
Thanks,
Alberto
- Attachments
-
- schematics.pdf
- (166.95 KiB) Downloaded 168 times
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
For one, the NCP161 can only deliver 450mA, which is a bit on the low side, be mindful that if you run into brownout issues, that may be an issue. That shouldn't stop you from being able to program the chip, though.
Basic tests: Is your 3.3V line active and stable? Can you scope out the 40MHz crystal, is it oscillating? Can you use a standard terminal on your serial-to-USB converter, see if there is any bootup chatter when you reset the ESP32?
Basic tests: Is your 3.3V line active and stable? Can you scope out the 40MHz crystal, is it oscillating? Can you use a standard terminal on your serial-to-USB converter, see if there is any bootup chatter when you reset the ESP32?
-
- Posts: 5
- Joined: Mon Sep 19, 2022 11:50 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Hi,
Thanks for reply. The 3.3V line is stable as shown here: 40 MHz crystal seems to be oscillating too: Related to your last question, I'm not able to use a standard terminal on my serial-to-USB converter unfortunately.
Thanks for reply. The 3.3V line is stable as shown here: 40 MHz crystal seems to be oscillating too: Related to your last question, I'm not able to use a standard terminal on my serial-to-USB converter unfortunately.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
You sure that's actually a 40MHz signal? From the picture, it could just as well be noise.
How do you mean ''Im not able to use a standard terminal on my serial-to-USB converter unfortunately.'? Simply download something like putty or teraterm, point it at the serial port the ESP32 is on, set it to 115200 baud, 8 data bits, no parity, one stop bit, and see if you get something when you reset the chip.
How do you mean ''Im not able to use a standard terminal on my serial-to-USB converter unfortunately.'? Simply download something like putty or teraterm, point it at the serial port the ESP32 is on, set it to 115200 baud, 8 data bits, no parity, one stop bit, and see if you get something when you reset the chip.
-
- Posts: 5
- Joined: Mon Sep 19, 2022 11:50 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
You're right, crystal signal seems to be noise. That's the cleanest signal I could obtain, but that's not a 40 Mhz frequency signal:
To use the standard terminal, I've implemented this setup:
I use USB to UART converter (left) to flash the custom board. To see the messages in Putty, I used an ESP32 development board (right) to see which messages are received from custom board (I used an ESP32 instead of another converter because I don't have more converters). For this, I connect TX USB to UART converter to RX custom board, and TX board to RX ESP32.
When I open Putty, I don't receive any message from custom board, only messages that come from ESP32, because when I press enable button in order to work as a converter any message is displayed.
To use the standard terminal, I've implemented this setup:
I use USB to UART converter (left) to flash the custom board. To see the messages in Putty, I used an ESP32 development board (right) to see which messages are received from custom board (I used an ESP32 instead of another converter because I don't have more converters). For this, I connect TX USB to UART converter to RX custom board, and TX board to RX ESP32.
When I open Putty, I don't receive any message from custom board, only messages that come from ESP32, because when I press enable button in order to work as a converter any message is displayed.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Well, without 40MHz, you're not gonna get much serial output. Also, why are you using both an ESP32 as well as an USB-to-serial converter? If you connect the USB-serial to the UART0 RX and TX pins on your custom board, you should be able to use that both as a terminal as well as a programmer.
However, you need to figure out why the chip isn't generating a clock. Looking at your schematic again, it looks like at least your reset circuit is not according to the datasheet/hardware reference manual: I'd expect an 10K to 3.3V and a 100nf-1uf capacitor to ground connected to the CHIP_PU pin. Without this, the ESP32 should still start to work if you manually press the reset button, though.
However, you need to figure out why the chip isn't generating a clock. Looking at your schematic again, it looks like at least your reset circuit is not according to the datasheet/hardware reference manual: I'd expect an 10K to 3.3V and a 100nf-1uf capacitor to ground connected to the CHIP_PU pin. Without this, the ESP32 should still start to work if you manually press the reset button, though.
-
- Posts: 5
- Joined: Mon Sep 19, 2022 11:50 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
I'm using both ESP32 and USB-to-serial converter because if I only use converter I can't make it work as a programmer and terminal. As putty is using the converter port, if I try to flash the program CPU can't access converter port because it is already opened:
serial.serialutil.SerialException: could not open port 'COM5': PermissionError(13, 'Acceso denegado.', None, 5)
Anyway, if I open putty connecting only converter and custom board no message is displayed.
I pressed the reset button but I still can't flash the program. I measured the other clocks signal and they all look like the one I attached previously, same frequency. In this case I think I'm just measuring noise and I'm not able to measure clock signal correctly. The PCB design was validated before in previous manufacturings and code configuration hasn't changed, but probably I'm missing something. If it can help, I also attach the project folder.
Thanks.
serial.serialutil.SerialException: could not open port 'COM5': PermissionError(13, 'Acceso denegado.', None, 5)
Anyway, if I open putty connecting only converter and custom board no message is displayed.
I pressed the reset button but I still can't flash the program. I measured the other clocks signal and they all look like the one I attached previously, same frequency. In this case I think I'm just measuring noise and I'm not able to measure clock signal correctly. The PCB design was validated before in previous manufacturings and code configuration hasn't changed, but probably I'm missing something. If it can help, I also attach the project folder.
Thanks.
- Attachments
-
- DigitalReaderV1.zip
- (49.12 KiB) Downloaded 154 times
-
- Posts: 5
- Joined: Mon Sep 19, 2022 11:50 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
I’ve been able to upload the firmware to the custom board, there was a problem with a diode. When I open serial monitor to see messages, I see there is a problem with ESP32 and LAN8742:
Do you know why this happens? Maybe a hardware issue?
Do you know why this happens? Maybe a hardware issue?
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Suggest you start a new topic for that.
Who is online
Users browsing this forum: No registered users and 105 guests