ESP32C3 Upload Write Timeout

Using XIAO ESP32C3 uploading new code using esptool on windows has stopped working with the error:
serial.serialutil.SerialTimeoutException: Write timeout
On a mac, the error is slightly different
A fatal error occurred: Failed to connect to ESP32-C3: Wrong boot mode detected (0x2)! The chip needs to be in download mode.

I had been developing with this board for a few days just fine before this, but after the last flash, which appeared to be successful and the program runs correctly, I’m no longer able to upload a new version. The strange thing is that the serial monitor connects just fine and I can see my applications logged outputs, so reading is just fine.

I’ve tried a number of things to solve, none are successful:

  • Different cable, different port, restart computer
  • connect / disconnect lipo battery to board.
  • try different computer and operating system entirely, see above for error.
  • connect in bootloader mode by holding down boot when connecting cable. (this is now the only way the com port appears)
  • Re-flash factory firmware using EspRFTestTool. I had done this about a week ago no problem. I did it again, and first attempt had a write error, but the second attempt reported to have succeeded fully. The device com port only appears in bootloader mode, which I think is normal after flashing new firmware. However, all subsequent attempts to flash the firmware again have failed, and this has had to effect on the write error when flashing with esptool.

Is there anything else I can try or is this board toast? And if it is toast, what could have caused the issue / how might I prevent this from happening again? It happened while iterating on relatively minor code changes regarding driving a LED strip, no hardware changes occurred to cause this.

Please make sure that you’re in the correct boot mode when uploading code to your XIAO ESP32C3.

Hi there, Sounds like the softdevice is nurfed, Reflash the bootloader.
my .02
GL :slight_smile: PJ