XIAO issues uploading using Arduino IDE

Good day. I have committed to using these nice little boards for my LED applications. However I have been having issues uploading my sketches reliably.

One moment I upload and it gives me the Java error dump, I click upload again, and it goes into an infinite port seeking. Then I click upload about 1 to 20 times more with the Java or infinite port seeking until it gives up and actually finds the correct port and uploads.

I find unplugging the USB cable and plugging it back in makes the success rate a little bit faster. But this has really slowed down my prototyping speed.

Here is a section of the successful upload:

Forcing reset using 1200bps open/close on port COM37
PORTS {COM1, COM37, } / {COM1, COM38, } => {COM38, }
Found upload port: COM38

The odd thing here is in the drop down menu, it only shows me port 37, but then finds the next incremental port and successfully uploads. When it goes into the infinite port seeking error, it just looks for 37. I wonder if there is a way I can force it to choose the next port up?

Here it is when it fails:

Forcing reset using 1200bps open/close on port COM37
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
PORTS {COM1, COM37, } / {COM1, COM37, } => {}
Uploading using selected port: COM37
C:\Users<>\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM37 -U true -i -e -w -v C:\Users<>\AppData\Local\Temp\arduino_build_449872/Claw_LEDs_2BTNS_Music_Xiao.ino.bin -R

And here is the Java error:

Forcing reset using 1200bps open/close on port COM37
processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2061)
at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port ‘COM37’.
at processing.app.Serial.touchForCDCReset(Serial.java:107)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
… 5 more
Caused by: jssc.SerialPortException: Port name - COM37; Method name - openPort(); Exception type - Port busy.
at jssc.SerialPort.openPort(SerialPort.java:164)
at processing.app.Serial.touchForCDCReset(Serial.java:101)
… 6 more

I am using Arduino IDE 1.8.16
Latest board as of this writing.

I tried plugging into different USB ports on my pc, ensuring the controller is getting enough voltage. Because I use LEDs there are times it may drop the voltage too low.

I have ready thru the forums here and some people have had issues, but really there doesn’t seem to be a clear fix for this issue. Is this just an inherent flaw that we have to live with? Or is there some special thing I gotta do to make this reliable? Maybe not use the Arduino IDE?

I am experiencing the exact same issue… Following the topic.

There’s the problem, right there, the port is busy.

There’s also mention of COM1 … is your board actually on COM37 or is that another device? -I’m sure you’ve checked this already, but I just want to do a belt and braces check?

Sometimes it helps to unplug the USB cable from the computer, wait until the “bling” noise and then plug it back in again. After you’ve done this, set the XIAO into boot mode by shorting the reset pins. When that has been done successfully,a new FileExplorer window should pop up and you should see your XIAO as a USB device.

Check the port number, and upload.

Personally I find using VisualCode and PlatformIO much better than the Arduino IDE, and a plus is that it shows you what COM ports are open, so when you connect your XIAO you can see exactly what COM port it is using.

I hope some of that helps.