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

Ahh my bad, I already have it as boards/. That folder is where I have put my xiao_ble.conf file. If I change it to boards/xiao_ble/overlay.conf, it doesn’t get picked up anymore. Same for the pm_static.yml - it only gets picked up if it is in the project root…

1 Like

You are right. I tested and it didn’t work. Despite the docs here, it doesn’t work with the board suffix either. The only way to make it work is to place the file in the SDK board directory:

C:/ncs/v3.0.2/zephyr/boards/seeed/xiao_ble/pm_static.yml

The docs state that PROJECT_ROOT\pm_static_xiao_ble.yml should also work, but nope.

It could be possible to override it in CMakeLists.txt in the project, but it’s complicated.

You don’t have access to BOARD variable before calling find_package, but setting PM_STATIC_YML_FILE after this call is already too late and will not have an effect, so this line will not work as BOARD will be either empty or it would be too late depending on where you put it:

set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}/pm_static.yml)

One can probably hack a custom way to parse .config cache and load it from SB_CONFIG_BOARD, but it doesn’t look very straightforward (the cache file location would depend on --sysbuild/--no-sysbuild, etc).

1 Like

TL;DR:

Place pm_static_xiao_ble_nrf52840.yml file in the app root:

adafruit_boot:
  address: 0xf4000
  end_address: 0x100000
  region: flash_primary
  size: 0xc000
app:
  address: 0x27000
  end_address: 0xec000
  region: flash_primary
  size: 0xc5000
sd_partition:
  address: 0x0
  end_address: 0x27000
  region: flash_primary
  size: 0x27000
storage:
  address: 0xec000
  end_address: 0xf4000
  region: flash_primary
  size: 0x8000
sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000

For sense variant, name the file pm_static_xiao_ble_nrf52840_sense.yml.


Sample build/flash commands for blinky while in c:\ncs\v3.0.2 directory after starting the terminal with nrfutil sdk-manager toolchain launch --ncs-version v3.0.2 --terminal:

west build --sysbuild -p -b xiao_ble zephyr/samples/basic/blinky
west flash -r uf2

If you are not using sysbuild (--no-sysbuild), everything should work out of the box with the current SDK, and the partition information will be provided automatically for the default bootloader (from zephyr\dts\common\nordic\nrf52840_partition_uf2_sdv7.dtsi).

Sample commands to build/flash blinky without any changes using recent SDK versions (3.x):

west build --no-sysbuild -p -b xiao_ble zephyr/samples/basic/blinky
west flash -r uf2

Why _nrf52840 suffix is needed for pm_static.yml

I just found that the SOC qualifier is required for the static partition file name even if it’s not present in the board YAML file identifier.

For example, zephyr\boards\seeed\xiao_ble\xiao_ble.yaml:

identifier: xiao_ble
name: XIAO BLE

For the sense variant in zephyr\boards\seeed\xiao_ble\xiao_ble_nrf52840_sense.yaml:

identifier: xiao_ble/nrf52840/sense
name: XIAO BLE Sense

For the sense, the static partition file should be placed in the app root directory and named as follows:

pm_static_xiao_ble_nrf52840_sense.yml

But for the regular xiao_ble, the file must be named:

pm_static_xiao_ble_nrf52840.yml

Then it’s picked up during the sysbuild:

-- Found partition manager static configuration : C:/ncs/v3.0.2/zephyr/samples/basic/blinky/pm_static_xiao_ble_nrf52840.yml

This requirement is probably coming from the zephyr\boards\seeed\xiao_ble\board.yml file, socs property:

board:
  name: xiao_ble
  full_name: XIAO BLE (Sense)
  vendor: seeed
  socs:
  - name: nrf52840
    variants:
    - name: 'sense'
2 Likes

Hi there,

Wow, that is great info my guy…
I can’t wait to give it another go myself now…LOL :+1:
solid.

Golden NUGGET award :trophy: :1st_place_medal:

Thanks for the contribution, just makes the thread very, very good.

HTH
GL :slight_smile: PJ :v:

This is super helpful, thank you very much!