A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
-
Help!
When I try uploading a sketch using Windows 10, and Arduino 1.8.15 to my Core2 I get the following:
"Connecting...................................____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header"If I just select the "Serial Monitor" while the Core2's plugged in - when I reboot the Core 2, the Serial Monitor shows the bootup text, so the device is definitely connected AND communicating through all the USB ports I tried.
The Core Grey I bought earlier is working fine... it flashes every time without issue.
I've tried the following:
- I've used both USB cables that came with my Core Grey and Core2, and a 3rd party cable. (all three work with my Core Grey)
- I've slowed down/turned off the LIFO stacks in Device Manager for COM4 - where the device appears.
- I've slowed down the connection via Device Manager. (same windows as #2)
- Uninstalled Arduino software, then reinstalled.
- Used Device Manager to uninstall the serial drivers (ticked "From disk" too), then reinstalled by reinstalling the Arduino software.
- Googled online..... only found this for a bare ESP32 board:Â https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/
- Tried the USB 3 laptop socket (blue plastic).
- Tried the USB 2 laptop socket.
- Powered off the laptop and powered back on.
- Removed the Core2 battery, and tried flashing again.
- Tried using the esptool.exe 3.0-dev version on the command line in a temporary batch file. (same message)
Command: "esptool.exe --chip esp32 --port COM8 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 C:....esp32\1.0.6/tools/partitions/boot_app0.bin 0x1000 C:....esp32\hardware\esp32\1.0.6/tools/sdk/bin/bootloader_dio_80m.bin 0x10000 C:....\arduino_build_567398/circles.ino.bin 0x8000 C:....\Temp\arduino_build_567398/circles.ino.partitions.bin" - Tried tapping the Reset button while "Connecting..." is being displayed.
- Arduino settings: Ensured the board is "M5Stack-Core2"
- Arduino settings: Tried 115200 for the upload speed.
- Tried a hub plugged into the laptop.
- Tried an externally powered USB 3 hub.
I've ran out of things to try!
Do I need a new Core2? How do I go about it? I don't want my money back - I love the touchscreen!
-
It turned out to be my Ryzen Swift 3 USB drivers!
After updating them the problem resolved.
-
You're clearly doing everything right—this is a common ESP32 upload issue. Since the Core2 boots and shows output in Serial Monitor, the USB connection works, but upload mode isn't triggering.
Here’s what to try (if you haven’t already):
1. Hold Boot Button (if available): While uploading, hold the reset/boot button until upload starts. Some Core2s need manual bootloader mode. 2. Try 115200 Baud: You've tried this—stick with it; higher speeds can fail on some USB ports. 3. Check CP210x or CH340 Driver: Reinstall the correct USB-to-serial driver for the Core2.
If none of that helps, your Core2’s USB-UART chip might be defective. Exchange it through M5Stack support.
-
Hello @hacxx
please refrain from posting in year old threads which are already resolved. Thank you.
Thanks
Felix