ESP32-S3 serial exception error when uploading

Hello

I recently ordered an XIAO ESP32-S3 board by seed studio. I am a cyber security student and I am looking to make a wireless rubber ducky. This board seemed perfect since it is so small, wifi capable and has USB solder pads. But I can't upload code to it. I did all the necessary setup. I followed these steps: Getting Started with Seeed Studio XIAO ESP32S3 Series | Seeed Studio Wiki
However after the upload is done it gives me a serial exception error. Under serial ports in device manager it shows up as simply "USB serial device" which leads me to belive that it is not being properly recognized. Here is the entire output:

Sketch uses 313516 bytes (9%) of program storage space. Maximum is 3342336 bytes.
Global variables use 20268 bytes (6%) of dynamic memory, leaving 307412 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port COM20
Connecting...
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: 98:3d:ae:e5:e1:4c
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 0x0005cfff...
Compressed 20160 bytes to 12987...
Writing at 0x00000000... (100 %)
Wrote 20160 bytes (12987 compressed) at 0x00000000 in 0.4 seconds (effective 445.4 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.6 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 472.4 kbit/s)...
Hash of data verified.
Compressed 313632 bytes to 167715...
Writing at 0x00010000... (9 %)
Writing at 0x0001bdd5... (18 %)
Writing at 0x0002853c... (27 %)
Writing at 0x0002dc6d... (36 %)
Writing at 0x00033962... (45 %)
Writing at 0x000393e6... (54 %)
Writing at 0x0003e972... (63 %)
Writing at 0x00044509... (72 %)
Writing at 0x0004a469... (81 %)
Writing at 0x00054fe1... (90 %)
Writing at 0x0005ae70... (100 %)
Wrote 313632 bytes (167715 compressed) at 0x00010000 in 2.5 seconds (effective 1016.3 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: OSError(22, 'The I/O operation has been aborted because of either a thread exit or an application request.', None, 995)
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
Failed uploading: uploading error: exit status 1

I followed the link displayed in the error message but it did not contain any useful information as far as I can tell. I tried to do a firmware update from Arduino IDE but it shows "No supported board connected". Does anyone know what is causing this problem and how to fix this?

Thank you in advance

Your topic has been moved. The Nano ESP32 category is only for problems with the Arduino Nano ESP32, not for other ESP32 based boards.

I can't help you with the issue.

Does the error occur with a simple "Blink" sketch that doesn't use serial?

Or you may need to check the settings under Tools.

Although I am using a Mac in my case, I will share the settings under Tools for your reference.

It can be a bad/incompatible data cable. Some micro-USB cables are power only and lack data lines. Try using a different high-quality, data-capable USB-C cable.

I very much doubt that the cable is the problem - it uploaded and verified correctly.

After "Hard resetting" the code start executing which is when the error occurs. My first guess would be a problem in the actual code, which we do not have, unless it is just the blink program.

This shows that the USB is connected properly and your sketch is uploaded successfully.

When your sketch runs, an error occurs and the USB is disconnected. That's why you can not find the USB device on your PC.

Now is the time to decide whether to share your sketch or debug it yourself.

Yes it occurs in any code regardless if it uses serial or not. I used the same Tool settings which is the default for this board.

As a same XIAO user, only I can suggest you to go back to the basics.

Disconnect all GPIO connections, connect only the USB to your PC, set the board type correctly, and run the "Blink" sketch.

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}

If you get an error, I think there may be something wrong with your XIAO.

If there is any exception caused by your code the ESP32 will try to print the error codes to your standard device - the monitor. If there is a problem with the connection, possibly partly due to the error, you will get the message you currently see.

SEEED have a support forum for their XIAO boards, they might know the issue your having;

https://forum.seeedstudio.com/c/products/xiao/91

Many results will be hit when you google for "The I/O operation has been aborted because of either a thread exit or an application request".

After some googling, seeing threads like this, I reported the following issue for the core:

Generally, esp32 3.2.0 core uses 4.9.dev3 version of esptool, that disguise itself as 4.8.1. That was not helpful in debugging :stuck_out_tongue:

It seems that whatever reset strategy / delays this version uses of esptool uses, it does not like our XIAO board. esptool v5.0.dev0 worked fine for me - it used RTS pin reset, it seems.