Can't program XIAO nrf52840 Sense using NRF connect SDK in vscode

Hi there,

and Welcome here…

So this is a common misconception about the builds, and boot loaders
If you’re using Zephyr/NCS to build UF2 files, they won’t work with Adafruit’s bootloader out of the box. The memory layout and expected image headers don’t match.

  • Using a Xiao BLE (nRF52840) with Adafruit bootloader v0.9.2
  • Building a Zephyr app (like blinky) using nRF Connect SDK v3.0.0
  • Using --no-sysbuild
  • Successfully copies the .uf2 to the bootloader, but nothing runs
  • Device can still re-enter bootloader, so not bricked

Your options:

  • Either switch back to the original Seeed/Nordic bootloader (or no bootloader at all) and flash using nrfjprog or west flash
  • Or build with Arduino/CircuitPython if you want to stick with the Adafruit UF2 bootloader

TL;DR: Adafruit UF2 bootloader is not compatible with Zephyr builds unless you do extra steps.

Use nrf52840dk_nrf52840 + Custom Partitioning (Advanced)

To make Zephyr firmware compatible with Adafruit’s UF2 bootloader:

  • Use nrf52840dk_nrf52840 as the board target
  • Add a custom pm_static.yml or partition overlay to match Adafruit’s bootloader layout
  • Or better: Use MCUboot as the secondary bootloader to package the app

But this is non-trivial.

I have a video and demo on here doing exactly that with the DK and the nRF52840 Xiao via SWD, use the search and “Nordic” key word it’s in the list returned.
This is very good to know how it works, check out the Nordic Tech ed Webinar on “Builds & Boot loaders” they have recently updated them so worth it’s weight in GOLD and it’s free. :+1:

HTH
GL :slight_smile: PJ :v:

of all of it related to Xiao , The " pm_static.yml " is the Secret :shushing_face: learn it , know it LOVE it!