Andrea_Nizzola,
@msfujino Would you be able to give me a quick hand?
Since you seemed to be in a hurry to resolve the issue, I posted two solutions.
What were the results?
Andrea_Nizzola,
@msfujino Would you be able to give me a quick hand?
Since you seemed to be in a hurry to resolve the issue, I posted two solutions.
What were the results?
Greetings, if you are still monitoring this feed, would you be so kind as to explain the following? You write
But where do I find the file I am to download? You told me where to place it but I cannot find it. Would you please tell me what the source is? I am certain the information is in your article but it is rather lengthy and I am somewhat dyslexic.
Many Thanks - Baran
The bootloader should be in the following holder
âC:\Users\XXXXXXX\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.4\bootloaders\XIAOM0â
If you have more than one SAMD21, it is very easy to use DAPLink from the link below. It also includes the bootloader files.
âHow to unbrick a dead XIAO using a XIAO(DAPLink) and OpenOCDâ
Also, if you use ST-Link, post #39 at the following link has everything you need.
âHow to unbrick a dead XIAO using ST-LINK and OpenOCD - #40 by msfujinoâ
Make sure your USB cable is a data cable and not just a charging cable
Also try switching cables
Iâve used this guide a couple of times, and provided that the MCU isnât damaged, it works just the way youâd expect. (Sometimes it takes more than one try.)
Hereâs a small improvement. At least in current versions of OpenOCD, the at91samdXX.cfg file allows you to override CPUTAPID directly from your config file. So, instead of modifying the at91samdXX.cfg file and changing XIAO_openocd.cfg to load the modified file, you can insert a line just before, like so:
...
set CPUTAPID 0x0bc11477
source [find target/at91samdXX.cfg]
...
This change allows you to use a stock OpenOCD package, regardless of how youâve installed it.
Many thanks msfujino, that worked at treat! Youâre a star
Thanks for the thread. I got this far, any ideas?
C:\Users\scalv\Downloads\XIAO_BootloaderRescueTool_STLink\XIAO_BootloaderRescueTool_STLink>C:\Users\scalv\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7\bin\openocd -f flash.cfg -s C:\Users\scalv\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7\share\openocd\scripts
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
adapter speed: 400 kHz
none separate
adapter_nsrst_delay: 200
adapter_nsrst_assert_width: 100
Info : Unable to match requested speed 400 kHz, using 240 kHz
Info : Unable to match requested speed 400 kHz, using 240 kHz
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v34 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.564309
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
TargetName Type Endian TapName State
0* at91samd21g18.cpu hla_target little at91samd21g18.cpu halted
target halted due to debug-request, current mode: Thread
xPSR: 0xe1000000 pc: 0xfffffffe msp: 0xfffffffc
target halted due to debug-request, current mode: Thread
xPSR: 0xe1000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
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 31
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure âscriptâ
at file âembedded:startup.tclâ, line 60
in procedure âprogramâ called at file âflash.cfgâ, line 23
in procedure âprogram_errorâ called at file âembedded:startup.tclâ, line 536
at file âembedded:startup.tclâ, line 477
C:\Users\scalv\Downloads\XIAO_BootloaderRescueTool_STLink\XIAO_BootloaderRescueTool_STLink>pause
Press any key to continue . . .
The openocd should use â0.11.0-arduino2â, but your log seems to use â0.10.0-arduino7â.
The folder â0.11.0-arduino2â is located at /.adruino15/packages/Seeeduino/tools/openocd/.
If you have another XIAO_SAMD21, the method in the link below is easy and successful.
There was a mistake in the description of flash.bat. It has been corrected.
XIAO_BootloaderRescueTool_STLink_1.zip (10.5 KB)