Can't write Program on my XIAO

Kindly please help.
I am unable to write new programs even though recovering the bootloader on my xiao.

I bought 5 xiao’s.
Three of them died before I had programmed them 10 times.
(one was dead just write sample blink program without any circuit connection.)

I have re-written the bootloader using SEGGER J-Flash Lite V7.66c and J-Link for the 3 broken xiao.

After the recovering bootloader, the xiao USB devices are recognized by both Arduino IDE and PlatformIO.
But when I try to write the program, I get the following error.

If you know how to recover, kindly please let me know.

=======error log by platformIO=======
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Atmel SAM (7.1.0) > Seeeduino XIAO
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES:

  • framework-arduino-samd-seeed @ 1.8.1
  • framework-cmsis @ 2.50400.181126 (5.4.0)
  • framework-cmsis-atmel @ 1.2.2
  • tool-bossac @ 1.10700.190624 (1.7.0)
  • toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 27 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- DFRobotDFPlayerMini @ 1.0.5
    |-- Servo @ 1.1.8
    |-- SoftwareSerial
    Building in release mode
    Checking size .pio/build/seeed_xiao/firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [= ] 8.8% (used 2892 bytes from 32768 bytes)
    Flash: [= ] 5.5% (used 14480 bytes from 262144 bytes)
    Configuring upload protocol…
    AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba
    CURRENT: upload_protocol = sam-ba
    Looking for upload port…
    Using manually specified: /dev/cu.usbmodem145401
    Forcing reset using 1200bps open/close on port /dev/cu.usbmodem145401
    Waiting for the new upload port…
    Uploading .pio/build/seeed_xiao/firmware.bin
    No device found on cu.usbmodem145401
    *** [upload] Error 1
    =======

Followings are my environment.
Mac mini (2018) core i5 macOS Monterey v12.4
ArduinoIDE 1.8.19
VS code 1.68.1 + PlatformIO core 6.0.2

One of them just died before being programmed 10 times? Is it still under warranty? If yes, I think you’d better mail them for a replacement. Hope somebody from seedstudio will look into your matter.

Do you have a Windows computer on hand? My suggestion is to use a Windows computer to see if the three xiao that cannot upload programs are available on win first. Some time ago we had problems with xiao uploading programs on mac.

1 Like

Thanks tepalia02 for your kind response.

Hi, Citric. I find your comment is correct!!

I borrowed windows 10 from my father-in-law.
Then I wrote a program on the dead xiao with ArduinoIDE on win10, and it worked. (2/2)

After that, xiao came back to life and was successfully written with mac as well.

The remaining problem is that I have to borrow windows from my father-in-law every time xiao dies.
I hope there is some way to recover the program on mac only…

Thanks a lot !!

Can you run Windows in virtual environment (VM) on MAC? You my also be able to use the “online version of the Arduino IDE”.

Thanks fe7565.
As you mentioned, windows VM on Mac could be another solution. though it cost me and may not work on M1/M2 chip.

I found another computer “Raspberry pi4” on my hand which may run Arduino IDE.
I’ll try the same first.

Thanks and Regards,

Finally I could know that Raspberry pi 4 + 32bit raspberry pi OS + PlatformIO can recover the dead XIAO also.

Thanks for all advice.

Another way to recover is to use the free nRF Connect from Nordic and Segger J-link Edu-mini ($20). With the Segger edu-mini you will need to make sure you supply an external 3.3V to the board you are trying to fix because the Segger edu-mini does not do that after the board is erased. Nordic has their chips go to 1.8V by default when you remove the firmware.

To revive the dead board after making all the wiring connections: go in nRF Connect under “Programming” and click to choose the J-link Device on top left. It will show up on the right side box. Load in the left side box the firmware from Seeed. Then “ERASE ALL”. After that, click on “Erase and Write” and it will burn it on the chip. Takes about 30 seconds for the entire thing once you connect all the wiring.

1 Like

We are doing our best to find this problem, it is not clear whether it is a system or xiao problem, as we have not encountered this situation with the xiao we have.

Thanks again fe7565.

I installed nRF Connect 3.11.1 macOS and connect my J-Link device. but unfortunately nRF Connect refused my device. It may caused my J-Link is not official product. (I bought it from AliExpress and was really cheap).

I’ll try again if I can get the official J-Link edu-mini.

Thanks.

Thank you for your comment, Citric.

I found issue is reproduced when I connect Xiao via bass-powered USB hub.
And it may not reproduce when I connect Xiao directly to Mac-mini by type-c to type-c connector.

Hope this info could help to understand this issue cause.

1 Like

Yes, I have a fake Segger as well and does not work. Hard to find the Segger mini-edu it seems, may need to buy the larger Edu which I think is around $60. Also, some used the $2 ST-Link V2 or Black Magic Probe (Black Magic Probe - JeeLabs) The Raspberry pi may seem the easiest/cheapest after the Segger edu-mini.

Thanks again fe7565 !
I’m really helped by your detailed information.

Once mini-edu stock is back, I’d like to buy one.