ESP32-C3 – Can't Upload Code Locally

Hi,

I’m having an issue with my ESP32 C3 – the device is not being detected properly in Device Manager. When I connect it to my computer, under “Universal Serial Bus Controllers,” I don’t see “USB JTAG/serial debug unit.” Instead, I only see other USB devices like “USB Root Hub” and “Composite USB Device.”

I found a suggestion on this forum to check if “USB JTAG/serial debug unit” appears under “Universal Serial Bus Devices” in Device Manager. If it does, the next step is to right-click and update the driver. Unfortunately, this device doesn’t appear for me, even though I’ve tried using different USB ports (2.0, 3.0, 3.1) and different cables.

Additionally, I tried pressing the RST and Boot buttons to enter programming mode, but that didn’t work either.

I’m also able to upload code via Arduino Cloud, but I cannot do it locally. When I try to upload code locally, I get the error: “Failed uploading: uploading error: exit status 1.”

Has anyone encountered a similar issue? What drivers should I install, or what other steps can I take to get my ESP32 C3 detected properly?

Please enter the bootloader to solve this problem

Enter Bootloader Mode

When you encounter the above two situations, you can try to put XIAO into BootLoader mode, which can solve most of the problems of unrecognized devices and failed uploads. The specific method is:

  • Long press the “BOOT BUTTON”.
  • Connect the Seeed Studio XIAO ESP32C3 to your computer while holding the BOOT BUTTON.
  • Release it to enter bootloader mode
1 Like

I know about that; I held this button for ten seconds and for about a minute, but nothing changed.

Sketch uses 266298 bytes (20%) of program storage space. Maximum is 1310720 bytes.
Global variables use 11844 bytes (3%) of dynamic memory, leaving 315836 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port COM4
Connecting…
Chip is ESP32-C3 (QFN32) (revision v0.4)
Features: WiFi, BLE, Embedded Flash 4MB (XMC)
Crystal is 40MHz
MAC: 9c:9e:6e:f7:1d:54
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 921600
Changed.
Configuring flash size…
Flash will be erased from 0x00000000 to 0x00004fff…
Flash will be erased from 0x00008000 to 0x00008fff…
Flash will be erased from 0x0000e000 to 0x0000ffff…
Flash will be erased from 0x00010000 to 0x00053fff…
Compressed 19440 bytes to 12467…
Writing at 0x00000000… (100 %)
Wrote 19440 bytes (12467 compressed) at 0x00000000 in 0.3 seconds (effective 508.2 kbit/s)…
Hash of data verified.
Compressed 3072 bytes to 146…
Writing at 0x00008000… (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 235.1 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 528.2 kbit/s)…
Hash of data verified.
Compressed 277760 bytes to 153583…
Writing at 0x00010000… (10 %)
Writing at 0x0001ba8d… (20 %)
Writing at 0x00023d93… (30 %)
Writing at 0x00029fff… (40 %)
Writing at 0x00030478… (50 %)
Writing at 0x000369fd… (60 %)
Writing at 0x0003d067… (70 %)
Writing at 0x00044e86… (80 %)
Writing at 0x0004b072… (90 %)
Writing at 0x000513e7… (100 %)
Wrote 277760 bytes (153583 compressed) at 0x00010000 in 2.2 seconds (effective 1016.2 kbit/s)…
Hash of data verified.

Leaving…
Hard resetting with RTC WDT…

A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, ‘Urządzenie dołączone do komputera nie działa.’, None, 31)
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: Troubleshooting - ESP32 - — esptool.py latest documentation

Hold the button and unplug the USB cable.
Hold the button and plug in the USB cable.
Let go of the button.

you dont have to push the button that long… just when applying power as cobra states

try searching your setup code for Serial!

1 Like

tell us a little about yourself friend… you post alot thanks!

1 Like

Still the same, I tried your method and simply clicked connect for a shorter moment instead of 10 seconds and still the same.

Hi there,

So close any other programs that are open using the port. Try that.
HTH
GL :slight_smile: PJ :v:

the C3 in particular is very funny… I myself have been using it lately and had problems
with the little buttons.

here are some ideas…
sometime you have to press… reset… hold… press boot… hold… release reset while holding boot… last release boot.

also i have noticed SOMETIMES you cannot do this with power applied… also it doesnt want to work if installed in an apparatus like expansion board.

it doesnt make sense… maybe the strapping pins, but i tried several times inside the expansion board and no go… remove from expansion board and works fine.

seems to be a problem when working with UART serial
somehow if you are using UART0 it redefines something that interfears with sketch upload

also reduce usb serial to 19200 max or lower

If you can use Arduino OTA update… try that while prototyping

Get you one of these

If you can prototype with XIAO SAMD , it is easy to double click the reset button on the expansion board and get into boot mode and also the yellow led will breath to show it is ready

just a few ideas

Hi there,

Here is my approach Mind you it has never let me down…
A. Reboot everything
B Only open one Arduino IDE window, DON"T connect the Xiao yet.
C Set the board type and before choosing the com port , connect the Xiao. note the new one and pick that port. In your code use 9600 baud if you select some debug option above none or basic it will tell you when it is in Download waiting…YMMV Open the serial monitor.
If nothing is on the display or its outputting garbage. manually press and HOLD the reset , then press and HOLD the boot button, then release the reset. (you should get a message on the port telling you it’s "ready/waiting for download ",if everything is checking out.

HTH
GL :slight_smile: PJ :v:

you can try just flashing straight away after entering the manual BL mode :+1:

1 Like

I updated Windows to see if it would solve the issue with the error that appears when uploading code to the ESP32-C3. I uploaded some random code to test it, but the problem still occurs.

Despite this, the code works fine, and the serial communication (Serial Monitor) also works without any issues. The error 1 still appears when uploading the code, but after uploading, the transmission works correctly. I don’t even have to press the boot or RST buttons.

I’m wondering what might be causing this error and how to fix it. Has anyone encountered a similar issue? Do you have any ideas on what else to check?

Thanks in advance for your help!

after it says hard reset… i have noticed i power cycle may be needed to start the new program running

Also are you sure you are using XIAO ESP32C3