I was able to unbrick my XIAO BLE sense with OpenOCD using a raspberry pi as SWD debugger / programmer.
I just set up a fresh Raspberry PI OS on a Raspberry PI Zero W, and installed openocd (“sudo apt install openocd”), wired the XIAO BLE sense to the Raspberry PI (see below), and executed the following command:
sudo openocd -f interface/raspberrypi-native.cfg -c “transport select swd” -f target/nrf52.cfg -c init -c “reset init” -c halt -c “nrf5 mass_erase” -c “program Seeed_XIAO_nRF52840_Sense_bootloader-0.6.1_s140_7.3.0.hex verify” -c reset -c exit
The connections between Raspberry PI and the XIAO ble sense were made as follows:
- GPIO 11 (header pin number 23) – TP3 (SWDCLK)
- GPIO 25 (header pin number 22) – TP5 (SWDIO)
- any of the 3.3V pins from the Raspberry PI – 3.3V pin of the XIAO
- any of the GND pins from the Raspberry PI – GND pin of the XIAO
Took only seconds (ok needed a few moments to set everything up) and worked like a charm.
Thanks a lot, and take care when fiddling around with the flash memory.