Page 1 of 1

Problem flashing ESP32 C3

Posted: Fri Feb 28, 2025 1:48 pm
by Edward W
We are using an ESP32 C3 SoC using the ESP-IDF toolchain. (esp-idf-v5.2.1)

I find that I keep bricking the devices with no good reason for it (I was only creating an app that transmitted data on the UART). Basically, after the application has been uploaded, it's impossible to ever flash the device again.

If I put a serial sniffer on the device to look at the debug output during boot:

When it is allowed to boot normally, I see

Code: Select all

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x4004c0dc
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff (repeats indefinitely and reboots)
If I put it into boot mode (pull down GPIO 9, pull up GPIO 8 and GPIO 2), I see:

Code: Select all

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0x1 (SPI_DOWNLOAD_BOOT)
wait spi download
Then, if I use idf.py (which calls esptool.py) to flash, I see:

Code: Select all

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x1 (SPI_DOWNLOAD_BOOT)
Saved PC:0x40052148
wait spi download
But the laptop side fails with the error:

Code: Select all

esptool.py v4.8.1
Serial port COM10
Connecting....

A serial exception error occurred: Write timeout
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
This behaviour is reproducible on three PCs, with three different USB cables so I don't think the issue is environmental

I have exactly the same issue with four of these boards. They just refuse to flash any more.

Is there any way to reset them using a jtag or some hard reset mechanism?

Thanks