Xiao not programming

its detected by arduino ide but hangs on uploading it has a solid led and a pulsating amber led

You can tap reset twice in a row to go to download mode.

I am having alot of problems with uploading to the XIAO. The worst part is that it seems very random when it will flash and when it won’t. Sometimes trying to upload a few times it works after failing and other times it simply will not flash.
I have tried using the reset board by tapping the two tiny little pads to reset it and usually nothing changes. Sometimes when resetting the orange light will flash briefly and turn off so I only have the green power light. Other times the orange led fades in and out. How should the led’s look when its ready to flash?
I have not seen any pattern to when the board will flash and when it wont. Sometimes using the arduino ide works better and other times platformio works better. There is a higher success ratio if I flash in linux and platformio rther than in windows.
This inconsistency is very annoying and the reset mechanism is very awkward to use, especially because over the years my hands are not as steady as they used to be.
Can you recommend anyway to “hack” the reset mechanism so it becomes easier to use?
I really like this tiny yet powerful board and have a few ideas on how to use them but this issue is seriously hampering my attempts to implement those ideas.
The board has pins for SWD is there any chance that the bootloader firmware will be updated to try to fix this that I could then upload to the board with a st-link or jlink?

It’s hard for me to reproduce these issues, but for some user tests, tinyUSB will be more stable if you select it under Tools.Maybe you can try. @sghice

I understand how difficult it can be to reproduce errors like this when we don’t have the same hardware or software. I did however try to flash the board in another computer that had windows 10 reinstalled recently and rather fresh and on that computer I can flash the boards. So at this point I dont know if the hardware in my computer that prevents me from flashing, or if it is my windows installation which is atleast 6 months old. So I’m going to reinstall windows soon on my machine and see if it will solve the problem. I’ll update this thread with my results, then I’ll know which it is and if it is hardware maybe I can send detailed hardware info.

Please let me know if there is any discovery. We also set up stress test environment internally. No problem has been found yet.We really want to solve this problem.

I have the same problem here but but my configuration is with Platformio on a virtual Ubuntu in VMWare.
It seems to upload in 1 out of 2 attempts. It starts to upload and than while flashing I get “SAM-BA operation failed”. After that I get “verify successful”, blablabla… “CPU reset” “Upload error 1” after that my orange led on my XIAO board is breathing every second instead of doing my LED test.
But after trying another time it works perfect, HUH?
I noticed something though, while doing the unsuccessful update I here a beep and see the XIAO is restarting and detected again, while this doesn’t happen with a successful update.
By the way, my XIA is connected through the USB-C port from my laptop.

VMWare intercepting USB is very unreliable, and I’ve had problems communicating with the mature USB to serial chip CP2102.

Hello Baozhu, I have reinstalled windows on my main machine and with only few programs installed it seems to work now. I did notice that after I installed drivers for my new ESP32-S2 board that it seemed to work fine after that but I only tried three times so not a large samplesize. The drivers were for CP210x and FTDIx virtual comport. I however reinstalled since that install was becoming very annoying and because I wanted to get that data to you… I have exported information about my computer from HWiNFO portable but I cannot attach them or upload them through this system. If you want that info pls give me some info on how to send it to you.

baozhu.zuo@seeed.cc Can you send it to me by email?

Done. I’ll update this thread if I encounter problems again.

Thank you very much for your message. I have received your email.In our preliminary analysis, sometimes the Arduino IDE does not send reset signals to the board.It’s strange.

Hi,

I’ve used Arduino Nano many times using the IDE and never had any issues uploading code but I’m new to Seeeduino and can’t get it to work at all. Having followed all of the setup instructions I can find I cannot download any code to the Seeeduino at all. A very simple test sketch ( just prints “Hi…”) compiles OK but refuses to download.

So:
OS is Windows 10 1903
IDE is V1.8.13.
Seeed SAMD Board package is 1.7.8.
Seeeduino is connected and visible on COM6 (I’ve seen it on COM5 on a different USB port too). Board is new and never connected before.
Windows Device Manager says the device is working properly using an MS driver V10.0.18362.1
Green power light is on and amber is flashing steady.
Code compiles (although it’s significantly slower than for an Arduino Nano on the same PC and creates huge object code - for 2 lines of code the sketch compiles to 34196 bytes!) but then fails to upload with “An error occurred while uploading the sketch”.
I’ve tried a double reset and the device was lost from Device Manager. Amber LED Fading off to on and back.
Did a second double reset and it re-appeared on COM7 but still unable to upload. Amber LED now fading on to off and back. Upload said "No device Found on COM7.

Any guidance or suggestions on why code is so large and what I’m doing wrong to upload? I can capture detailed compile and upload debug info if needed.

It doesn’t download in the same way as Arduino Nano.Some computers do have USB port compatibility problems, I suggest you use other computers to test the hardware is normal.

Hi Baozhu

Thanks for the response.

I tried on my laptop and it uploaded first time. I know the Seeeduino used a USB-C connector but is USB 3 only? The failing machine has USB 2 only so this could be a reason.

Having said that, the device is visible on USB 2, configured as a serial device, is visible to the Windows eg COM5, and the Arduino IDE - Board Info reports back correctly (see below) - using the same MS driver on an Intel (Gigabyte) motherboard exactly as per the laptop yet it can’t upload.

BN: Seeeduino XIAO
VID: 2886
PID: 802F
SN: 9511AD735053574C342E3120FF042711 

I can get around this by uploading from the laptop but I’m still curious to understand what the incompatibility is.

Also, the original machine (which is an Intel i7) takes ages and appears to do a significant amount more work to compile than the laptop which is just an i3 and compiles in seconds. The debug logs show the extra work clearly - .txt file of the successful log is 20k vs 193k for the failing machine? I will try re-installing the IDE to clean it up and see if that helps.

Thanks

Hey there Whatnot. I had problems myself and there is something that happens when Arduino tries to flash that can make the flash fail. One thing that helped me was removing “ghost” com ports and devices. If you go into device manager in windows and select view and tick hidden devices and go through the list and right click the grey devices and remove, it may help.

I am facing the same problem. XIAO is truly a groundbreaking products given its size vs cost. However, the bootloader issues are making me doubt its reliability in the field. For me as well, the programming is a 50-50 chance thing. Sometimes it works, sometimes it doesnt !

Do you know if its possible to replace the current bootloader with a more stable one? Like the one used in Arduino (optiboot) or something?

Hi sghice,
Yep, I tried that but it has no effect. When the IDE gets to upload it shows the following:

Sketch uses 40644 bytes (15%) of program storage space. Maximum is 262144 bytes.
    Forcing reset using 1200bps open/close on port COM3
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    PORTS {COM3, } / {COM3, } => {}
    Uploading using selected port: COM3
    C:\Users\...\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM3 -U true -i -e -w -v C:\Users\...\AppData\Local\Temp\arduino_build_443199/DFPlayer_Test.ino.bin -R 

Followed by a long delay and then it fails. I can upload the same code with the same versions of the IDE and libraries on the same version of Windows 10 on my laptop. It uses the same version/date MS driver and works reliably. So the only difference left is that the USB port different hardware. Whether that’s a V2 vs V3 difference or just that Intel ICH10 USB hardware on my desktop is too old I don’t know. Once the code is uploaded, I can re-attach the XIAO to the desktop and the Serial Monitor works perfectly so the Serial via USB is working.
It appears, on my laptop, to mount the XIAO as a USB drive and copy the code that way so it must be a peculiarity of that approach. All the real USB drives I have work fine on both machines.

i face the same problem. It works on my laptop but not on my desktop. It gets stuck in the exact same point as yours. I tried to tinker around it and now my XIAO is bricked :frowning: . its no longer detected by any computer., it doesnt goto bootloader mode, it doesnt reset with the jumper method, only a green led glows… nothing else happens…its bricked :frowning:

Anyone has any experience reviving a dead xiao?

i was able to unbrick mine…using raspberry pi