Seeeduino Xiao dead/unable to upload sketches after code upload (SOLVED)

Here’s what happened

  1. I upload sketch
  2. Board no longer appears via usb (no com port when plugged in)
  3. I try to get to bootloader mode and the Xiao pops up as a storage device
  4. I upload bootloader file from the Xiao github half following this video
  5. File disappears and new files (CURRENT.UF2, INDEX.HTM and INFO_UF2.TXT appear as in video
  6. Does not work and stays in bootloader mode.

Im confused and have now wasted hours on this fruitless venture.

Here’s how I solved it:

  1. Go into bootloader mode as is listed on the official wiki

  2. Install Circuit Python by dragging the UF2 file onto your Xiao (I found that windows would lock up when trying to do this so you might have to use linux as I did (I used Ubuntu 18.04 on the Jetson Nano))

  3. Upload an arduino sketch to revert from circuit python

Basically, thank you Adafruit for having decent software with an easy ability to revert that fixed previously faulty software (I assume)

More detail for anyone who had the same hell figuring this out. So I can’t avoid blaming the board for allowing code to brick it in such a manner, but here’s the error in my code that led to it being bricked.

I think I was calling Serial.print before Serial was available. Somehow this did not play nicely and caused the board to stay stuck, unable to connect with Serial for sketch uploads even in bootloader mode.

Ther fix as described was to install cyrcuit python then follow their uninstall instructions of simply uploading a sketch. There might be another way but this is what worked for me. Yes I tried all the files from the Xiao bootloader wiki section. None worked (even after I realized that the UF2 file was the only relevant one). Only circuit python worked.

I imagine this is due to a bug somewhere in the code for this board but this is the depth at which I can give you information.