XIAO BLE (Sense) bootloader bricked, how to restore it?


I think I managed to brick the bootloader by writing to the flash from my application (should have read this before: XIAO BLE Sense persistent data). :wink:

The XIAO BLE sense does not show up anymore as USB device, i. e. there is no serial port or mass storage device showing up, even when the bootloaded is activated via double-pressing the reset button.

How can I flash the original booloader firmware, and where can I find it? (And which hardware is needed for that?)

Best regards and thanks in advance.

Ok I think I can write the bootloader with OpenOCD using just a Raspberry PI over the SWD debug interface (via bottom pads TP1, TP2, TP3 and TP5 on the XIAO BLE).

Anyway, where can I find the original bootloader binary of the XIAO BLE sense?

Seeed_XIAO_nRF52840_Sense_bootloader-0.6.1_s140_7.3.0.hex.zip (197.2 KB)
This is the factory firmware of XIAO BLE.

1 Like

Thanks a lot! I will try burn it with OpenOCD and report back here. :slight_smile:

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. :wink:


Thank you for posting and good job. Will this work for any bootloaders designed for nrf52840? Can I switch from XIAO BLE SENSE Adafruit version 1.0 to MBED version 2.6.1 and vice versa?

Just in case you did not try yet: Yes, I think that should work. You should be able to write any bootloader designed for the nrf52840 with that method.

1 Like

i wonder if this is what happened to my XIAO?

Hello, thanks for the solution, it worked for me too, but with a small change:
i had to add
to /usr/share/openocd/scripts/target/nrf52.cfg
otherwise i got a lot of errors during programming.
I used it with a raspberry pi 4.

I have seen that programming with Arduino Ide (1,8.16) it is overwriting the bootloader each time.
Am I doing something wrong?