Zephyr samples not working on NRF5280 board

I bought some Xiao BLE boards and I’m trying to get the Zephyr
examples working. I’m following the instructions at
Getting Started with Seeed Studio XIAO nRF52840 Series | Seeed Studio Wiki

I’m using version 2.7.0 of Nordic’s Connect SDK.

I have the basic BLE board - not the Sense board. When I enter
the bootloader and mount the drive, it’s named “XIAO-SENSE” not
“XIAO-BLE” as some documentation says it should be.

Here’s how I build the test program:

west build -p always -b xiao_ble samples/basic/blinky

I’ve also tried hello_world:

west build -p always -b xiao_ble samples/hello_world

Both complete without errors. I then mount the board, and copy
the file:

cp ./build/blinky/zephyr/zephyr.uf2 /media/jtm/XIAO-SENSE

or

cp ./build/hello_world/zephyr/zephyr.uf2 /media/jtm/XIAO-SENSE

After writing the file to flash, the board appears to reset and
then nothing happens. No LEDs blink, no USB serial port is enumerated.
If I reset (pressing the button only once), the board enters the
bootloader.

Any idea what the problem could be?

Hi there,
Have you tried with an older SDK , toolchain 2.6.0 ?
It works(blinky) in PlatformIO and Nrf_SDK with both Xiao BLE & Xiao Sense versions.
I used Uf2 file drag and drop after Build.
HTH
GL :slight_smile: PJ :v:

1 Like

I was able to get those samples working with SDK 2.6.0 and toolchain 2.7.0.

Thanks!

2 Likes

sweet, Please mark that as the solution , so others can find it later…
Thanks for contributing.
GL :slight_smile: PJ :v:

I’ve also had more success with the Zephyr bluetooth samples (in /zephyr/samples/bluetooth) than with the Nordic samples (in /nrf/samples/bluetooth). I wasn’t able to get any of the Nordic sample programs to work. No idea why that is yet.

I found this after banging my head against the same problem for over an hour (2.6.0 indeed does work) — and v2.7.0 not working at all, is a serious problem. I hope it will be fixed.

Sounds like this solution worked for others. However, I ran into this, started with an older NRF SDK 2.5.3 , and immediately found any program I flashed would cause the device to no longer seem to be alive (no LED indicators, no com ports discovered, no other expected functionality). I also switched to 2.6.0 eagerly in hope it would help with the BLE Sense. No luck. Same result.

I also followed a few details here for zephyros, to set the BOOT DELAY: XIAO BLE (Sense) — Zephyr Project Documentation

So question:

Thanks in advance. I have had previous experience with the BMD-30 series of chips with custom boards and no issues using the same samples.

HI there,

So , lots in this and too this right here…LOL
Over all if I understand and I had this as well in the NRF SDK builds also, The MCUBoot allows these options but you have to do it in the menuconfig first. Zephyr is similar.
I need to revisit with the latest NRF_SDK installed.
but in a nutshell

Recovery Steps:

  1. Flash back Seeed’s UF2 bootloader with SWD and J-Link.
  2. Always add USB/CDC config to prj.conf.
  3. Add BOOT delay + logging in Zephyr to avoid “dead” board symptoms.
  4. Be cautious with full-chip erase when moving between toolchains.

I’d call the “silent bricking trap” that happens when:

  • You flash a Zephyr app that doesn’t include USB support (so no serial/CDC shows up),
  • You remove or overwrite the UF2 bootloader with no way to re-enter it,
  • And the program starts immediately without a BOOT delay or button check.

What’s Actually Going Wrong?

  1. No USB CDC Output:
  • By default, Zephyr apps do not enable the USB console unless configured.
  • So after flashing a minimal Zephyr app, no COM port appears—even if the board is working.
  1. UF2 Bootloader is Overwritten or Inaccessible:
  • The original Seeed UF2 bootloader (from Arduino) gets wiped when flashing a full Zephyr application via SWD or USB DFU.
  • Without the bootloader, there’s no easy double-tap reset recovery.
  1. No Visual Indicator or Boot Delay:
  • Zephyr doesn’t enable the RGB LED or BOOT pin delay by default.
  • The board looks dead unless debugging with a J-Link or similar.

Always Add USB Support in Zephyr Configs

Include this in your prj.conf:

CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_CDC_ACM=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_USB_DRIVER_LOG_LEVEL_DBG=y
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_BACKEND_UART=y

Optionally:

CONFIG_BOOT_DELAY=1000  # Allow time for USB CDC to enumerate before logs

And in overlay-usb.conf:

CONFIG_USB_DEVICE_PID=0x0004
CONFIG_USB_DEVICE_VID=0x2FE3

2. Enable BOOT Button Behavior

In boards/seeed_xiao_ble.overlay or your app’s overlay:

&buttons {
    boot_button: button_0 {
        gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;  // D7 on Xiao
        label = "Boot Button";
    };
};

If you want to restore the factory UF2 bootloader:

You can use Nrfjprog too,

nrfjprog --eraseall
nrfjprog --program seeed_xiao_nrf52_bootloader.hex --chiperase
nrfjprog --reset

I avoid using the Total -erase though unless I want to remove the BootLoader and try my own, When using west flash or nrfjprog, avoid using --eraseall unless you’re sure. Flashing only the application region keeps the bootloader intact.

  • Use a J-Link for full recovery if the board is silent.
  • Use nrfjprog --memrd 0x00000000 --n 16 to check if anything is flashed.
  • Check west flash runner settings if using Zephyr to ensure no bootloader overwrite.

HTH
GL :slight_smile: PJ :v:

2 Likes

I am going to flag this post as “awesome”. Exactly, bootloader seems to be gone, no way to re-enter it, boot delay should be turned on, however, that made no difference USB isn’t active. And boot button lol ! I think the seeed page XIAO nRF52840(sense) With Zephyr(RTOS) | Seeed Studio Wiki on this topic needs some love to add instructions about running with scissors.

I will dig into this. I had part of my set up right, def missing the button GPIO, and probably some other stuff. I am working in the NRF Connect SDK setup via VSCode, which has some differences but I have to use this to collaborate with my team, who will never be using the command line tools.

1 Like

PJ, a quick one: do I understand correctly, that even when USB support was not added, or boot delay was forgotten, or anything else, as long as you have nrf52840DK connected via SWD to XIAO there’s always a possibility to re-store or re-flash the board? What I mean is that with this setup you can’t really completely brick the XIAO board.

Hi there,

Idunno G, Some users are pretty creative :grin: ,but Yes I have to think it would be harder to do, but easy to unbrick if so. I have sent code to the Xiao connected that ran but only if it was connected to SWD , wouldn’t boot on it’s own but would run from flash even without the bootloader. I have restored a completely bricked Nrf52840 back from the dead with it. :+1: AOK.

HTH
GL :slight_smile: PJ :v:

1 Like

Creative for sure. Following the link for the uf2 bootloader recovery, I used the J-link lite software (there may be a few versions of the software on the system). While the instructions are not exact, select the SWD interface, choose the nrf52 device called: nRF52840_xxAA

and default speed of 4000kHz.

This worked. Recovered. Thank you.

I will work out the default board/project for zephyros so that I can share this once it is figured out.

BTW I am using the Xiao Expansion board and not another NRF52DK to flash. We had to make a few hops to get from the jlink to this board.

1 Like

Seems like a janky feature of NRF SDK for VSCode may lead people to blow away the bootloader. If you click anywhere on or to the right side of the “chip” icon, you will erase all and flash. Otherwise, it will flash. Photo here nRF Connect for VSCode Flash command erase all flash(es), need to erase only "app" sector. - Nordic Q&A - Nordic DevZone - Nordic DevZone

Confirmed, I can get shell_nus flashed and functional via the vscode based project. I will update this issue when I have a configuration that looks reasonable.

1 Like

ok, so this is the extra cruft I added to my prj.conf file

I still need to sort out overlays if I want to use things specific to the board and also the expansion board. These are described on the zephyr xiao sample repo here:


CONFIG_BOOT_DELAY=5000

CONFIG_USB_DEVICE_STACK=y

CONFIG_USB_DEVICE_PRODUCT="Xiao USB"

CONFIG_USB_DEVICE_PID=0x0004

# This value is only for testing and MUST be configured for USB products.

# CONFIG_USB_DEVICE_VID=0x2FE3

CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y

# NU

CONFIG_USB_DEVICE_STACK=y

CONFIG_USB_CDC_ACM=y

CONFIG_SERIAL=y

CONFIG_UART_CONSOLE=y

CONFIG_USB_DRIVER_LOG_LEVEL_DBG=y

CONFIG_LOG=y

# CONFIG_LOG_DEFAULT_LEVEL=3

# CONFIG_LOG_BACKEND_UART=y

Thanks for the assist! I was sure there was something weird I was doing.

1 Like

Hi there,

I know,

I saw a pref somewhere to cause a second are you sure, but I considered it a right of passage … :grin: Welcome to LEVEL 2 :v:

Once you get a few builds , flashing and booting. The real fun begins…
good staying with it though because when the next hardware hits , “you will be seated in the front row…” Oh 'snap that swedish dude might have that copyright :face_with_hand_over_mouth:

HTH
GL :slight_smile: PJ :v: