This has started happening to me as well. It started last night and into today. So far a reboot using the reboot pins have fixed the issue. It is only when I try to upload some code I created using the Tiny RTC. Even the set or Read example code will cause it to happen.
This is a very real problem and SeeedStudio need to jump on this immediately. I have lost 8-parts and numerous circuit boards, not to mention the missed delivery schedules I have encountered.
Port loss or brick issues have been repeatedly talked about in forums. But for some reason I haven’t seen Seeed’s views or information on this topic. I think that the priority of this problem is low because it can be solved by rewriting the bootloader.
Hey, our Seeed,
We users would like to know Seeed’s view on this issue.
I have the same problem with the XIAO. It changes the port between 8 and 9 every time I want to upload something. For example when I click upload it changes from 9 to 8 so it fails, then upload again, it changes back to 9, fail again, so only works at the third time if I am lucky.
I’m having a similar problem with bricking the Xiao (posted an explanation today). Resets & double resets don’t recover. I look but don’t find a method to reload the bootloader. I see a partial explanation in this forum but it is far from complete. Is there a better process posted somewhere ? If so please point me.
Maybe this post will be helpful.
Well, I’ll have another look at it . The bootloader file called out there doesn’t show up on GitHub & I don’t see it elsewhere. Got a location for it ?
To rewrite the bootloader, you need to use a debugger like ST-Link or JLink, not just a USB-TTL converter. The link below describes how to use XIAO as a debugger. Is it helpful?
The bootloader file should be on your PC.
Found the file, ordered the programmer, looking at the rest. Yes helpful. Thank you.
I’m seeing a different directory structure from my downloaded OpenOCD (Sourceforge). Also https://gnutoolchains.com/arm-eabi/openocd/ called out doesn’t seem to have what is needed either. I’m tired, enough for tonight.
For OpenOCD, download the pre-build version of “openocd-20211118.7z” from the link, not from Sourceforge.
Got it. Went thru the process, seemed to go OK. Now gotta either wait for the programmer or decide to use another XIAO as per your suggestion. But probably not tonight.
The XIAO does not go into bootloader mode. Reset or double reset results in a fast LED blink. Hope that doesn’t prevent this reload from working.
My first post, which hasn’t showed up yet, describes what led up to the Com port on 2 XIAO going bad. Still don’t understand why that was. A glitch is understandable but not twice.
I have also made XIAO bricks several times. When I checked this flash memory using ST-Link, the boot loader 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 sketches 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.
So what is the root cause of sketches overwriting the bootloader area ? Doesn’t selecting Xiao as the device type define memory areas ? Are you suggesting that writing memory areas unintentionally (for instance overwriting array bounds) is at play ?
Which post are not showing up ? Those that describe how I bricked the part ? I’ve been assuming they have not been cleared cause I’m a new member.
Seems that just having an infinite loop in my setup code is enough to make the USB port malfunction. These are horrible boards to develop code on. Constantly having to reset and set the port again in the IDE.
I’ve used several different Arduino and ESP boards on many projects over the last couple of years. None have been as misbehaved. This is only my second project with a Xiao and I’m on high alert. I may have done something silly here but the number of cases of unexplained ‘bricks’ from many others is a concern. Haven’t seen similar things in these numbers on other forums with other boards.
Your post will not appear on the pages below.
However, if you use the search function to search for “xiao port”, you will find two posts.
Managing memory boundaries seems to be the programmer’s responsibility. The link below is an example of a sketch that will definitely make a brick.
trouble getting the st-link to be recognized
I didn’t remember very clearly, but you might have to install the device driver “WinUSB” in order to use ST-Link with OpenOCD.
Although it is not an English site, the following will be helpful.
I found a driver and re ran with these results :
Licensed under GNU GPL v2
For bug reports, read
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 400 kHz
Info : STLINK V2J17S4 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.122449
Info : at91samd21g18.cpu: Cortex-M0+ r0p1 processor detected
Info : at91samd21g18.cpu: target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for at91samd21g18.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x00000288 msp: 0x20002dd8
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000288 msp: 0x20002dd8
** Programming Started **
Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
Error: SAMD: NVM programming error
Error: Failed to erase row containing 00000000
Error: SAMD: failed to erase sector 0 at 0x00000000
Error: failed erasing sectors 0 to 38
embedded:startup.tcl:1029: Error: ** Programming Failed **
in procedure ‘script’
at file “embedded:startup.tcl”, line 26
in procedure ‘program’ called at file “XIAO_openocd.cfg”, line 15
in procedure ‘program_error’ called at file “embedded:startup.tcl”, line 1094
at file “embedded:startup.tcl”, line 1029
Also loaded STM 32 ST-Link utility hopeing to get some clarification. Is that utility proper for this application. It’s having some trouble too. Loaded but won’t run. Missing msf140.dll.