Hi, Many thanks for the guide. I was unable to get the batch script work with the flash.cfg. flash.bat returned errors suggesting that the device couldn’t be found/wasn’t attached to my st-link v2. At this point I assumed I had destroyed the device but I found the following command line call to openocd that does:
.\openocd -f interface/stlink.cfg -c “transport select swd” -f target/nrf52.cfg -c “init;halt;nrf5 mass_erase;program Seeed_XIAO_nrf52840_bootloader-0.6.2_s140_7.3.0.hex verify reset; exit”
Brief Instructions:
- I used a ST-link v2. Connect 3v to the 3v pin on the xiao. Connect GND to a GND pin on the xiao. Connect SWDIO and SWCLK to the solder pads on the back of the device (I melted the GND pad off, but using a GND pin works just fine).
- Download and install openocd in a directory on your windows machine. Google will tell you how.
- Go to openocd/bin and place the .hex file for the latest bootloader in the same location as the openocd.exe file. I found it in the arudino ide as instructed here but there were several locations ala Google.
- Modify the command to reflect the actual name of the bootloader file in the step above.
- Open a command prompt. Go to the directory openocd\bin.
- Cut and the paste the command line call (modified as required), and hit return.
I don’t know why the flash.cfg didn’t work. I did try to use transport select swd instead of transport select ha_swd and was told that me device (a st-link v2) didn’t support it.