XIAO ESP32C3 program upload error

Hello, I just got the XIAO ESP32C3, soldered header pins on, put it in the breadboard, and loaded a basic LED program. It worked. Then I added a potentiometer input in code to programmatically adjust the brightness, and found an error message loading the program.

Sketch uses 246402 bytes (18%) of program storage space. Maximum is 1310720 bytes.
Global variables use 15784 bytes (4%) of dynamic memory, leaving 311896 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port COM3
Connecting...
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 68:67:25:ec:36:a4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600

A fatal error occurred: No serial data received.
Failed uploading: uploading error: exit status 2

There are a variety of different suggestions online for how to fix this, but I am not sure who to believe since they are different. Seeed doesn’t instruct me to have to do any of them, either, on the wiki page Getting Started with Seeed Studio XIAO ESP32C3 - Seeed Wiki . Can anyone please explain why this is happening or what I really should do? Thank you.

Is your XIAO connected to COM3?

Yes, the port is set to COM3 and Arduino IDE is configured with “XIAO_ESP32C3” as the board, after installing the package from the repository. The boards list shows the USB symbol and a check mark. (Thanks for being willing to get involved)

After changing the baud rate, there is no “changed.”

  1. Have you ever been able to upload before? Or has it never happened?
  2. What if I change the baud rate of COM3 to 921600 in advance?
  3. What if I try the FQAs in the wiki in order?
esptool.py v4.2.1
Serial port COM18
Connecting...
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 58:cf:79:f3:36:5c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00046fff...
Compressed 12944 bytes to 9297...
Writing at 0x00000000... (100 %)
Wrote 12944 bytes (9297 compressed) at 0x00000000 in 0.3 seconds (effective 313.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 409.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 474.9 kbit/s)...
Hash of data verified.
Compressed 222608 bytes to 125144...
Writing at 0x00010000... (12 %)
Writing at 0x0001aaad... (25 %)
Writing at 0x00021650... (37 %)
Writing at 0x0002784b... (50 %)
Writing at 0x0002db12... (62 %)
Writing at 0x00033814... (75 %)
Writing at 0x0003b333... (87 %)
Writing at 0x000425c6... (100 %)
Wrote 222608 bytes (125144 compressed) at 0x00010000 in 3.1 seconds (effective 579.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Yes, only the first time I uploaded a program, it worked. The baud rate is pre-set to 921600.

I found there were no direct results for this error and this board. I tried XIAO RP2040 - “An error occurred while uploading sketch” Win 10 which did not work.

Mea culpa. I read the wiki section about " Q1: My Arduino IDE is stuck when uploading code to the board" but I believed that bootloader mode was for flashing the bootloader, not the user program…

Nevertheless, holding “B” while plugging in the device worked.

(I still believe that’s what bootloader mode is for, and I feel that I have sidestepped this issue rather than understanding it, but I’m ok with that.)

1 Like