2 bricked XIAOs

Something very odd happened that I can’t make sense of resulting in 2 bricked XIAOs.

Converting an existing project from Uno to Xiao. I modified an ESP32 IIC HelTec OLED library to properly exist with the Arduino IDE and compile for Xiao with the old project code. It compiled & uploaded OK but just after a good upload the Com port disappeared and would not return (per Win10 Device Manager & Arduino IDE). Had a spare Xiao so I connected that one & the Com port re-appeared. As a test I loaded another unrelated program and ran it on the second Xiao to assure all was well, it was. Uploaded the new project to the second Xiao and the Com port disappeared again never to return. One such
failure could be a glitch, two is a problem somewhere. Reset & double reset result in fast LED flash. Working on reloading the bootloader but the real issue is what happened.

If you have thoughts on why this occurred I’d like to hear them.

I have also made XIAOs bricks several times. When I checked flash memory using ST-Link, the bootloader start address “0x00-0xff” was overwritten with the data “0xff”. I think there was a problem with the sketch I uploaded. For safety, the bootloader part must be protected from overwriting, but XIAO shipped from Seeed is not protected. However, rewriting protects the bootloader area, so the same trouble no longer occurs. (However, the problem with sketch trying to overwrite the bootloader area must be resolved)

PS: Your post is not showing up in the forums. I found it using the search function.