Introducing an updated Sample set for Xiao nRF54L15 / and NRF CONNECT

I’m running some tests on my machine right now for sdk 3.2.1,
I checked my versions of the samples, I made a bunch of changes to get them to work, here’s an ai analysis of what I had to do:

Changes from Stock SDK (v3.2.1) Summary

Both Samples - Common Changes

1. DK Library replaced with direct GPIO control

Stock uses #include <dk_buttons_and_leds.h> and DK_LED1. Your versions replace this with direct GPIO via <zephyr/drivers/gpio.h>, using GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios) and custom dk_leds_init(), dk_set_led_on(), dk_set_led_off() wrapper functions. This is because the Xiao doesn’t have the DK library’s multi-LED hardware.

2. RF switch configuration added (before bt_enable)

Both samples add manual GPIO2 pin configuration for the Xiao’s RF antenna switch:

gpio_pin_configure(gpio2, 3, GPIO_OUTPUT_ACTIVE);   /* rfsw-pwr = HIGH */
gpio_pin_configure(gpio2, 5, GPIO_OUTPUT_INACTIVE); /* rfsw-ctl = LOW */

This is completely new code not in the stock samples.

3. prj.conf differences

Stock uses:

CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_DK_LIBRARY=y

Your version replaces these with:

CONFIG_GPIO=y
CONFIG_REBOOT=y
CONFIG_BT_LL_SW_SPLIT=n    # Force SoftDevice Controller
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_DEFAULT_LEVEL=3

Stock also has extra RAM-reduction configs your version drops:

CONFIG_BT_RAS_MODE_3_SUPPORTED=n
CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=1
CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=1
CONFIG_BT_CTLR_SDC_CS_STEP_MODE3=n

4. Overlays and Kconfig.sysbuild - Identical between stock and yours (same antenna switch DTS overlay, same sysbuild config).

5. CMakeLists.txt - Identical except stock initiator has project(channel_sound_ras_initiator) vs yours has project(NONE).

Initiator-Only Changes

6. Distance calibration and weighted averaging - This is the biggest functional change. Stock just prints raw distance estimates:

LOG_INF("ifft: %.2f, phase_slope: %.2f, rtt: %.2f meters", ...);

Your version adds ~100 lines of calibration logic:

  • Calibration constants (PHASE_SLOPE_SLOPE, RTT_SLOPE, IFFT_SLOPE, offsets)

  • Weighted averaging (Phase 50%, RTT 25%, IFFT 25%)

  • get_distance() now applies calibration: Actual = (Raw - Offset) / Slope

  • Output shows calibrated values + weighted best estimate

1 Like


This is what I get when I run my modified versions of the samples against sdk 3.2.1.
those are valid distances.

1 Like

Ok, let me fully digest what you have here. Just a quick (odd) update/detour on my side. When I moved back to the reflector to just see what it was doing/saying it was acting dead. TLDR: I oddly couln’t talk to it until I tried flipping it over (instantly worked) on the usb c cable to the mac. First time for that for me.

Anyway, I have them both now flashed, talking and on the mac and now I get an interesting security pairing error which is actually a good thing. They are trying to talk now. I’ll see if your info helps me resolve that, thanks!!!

I just pushed a new commit with updates for the modified channel sounding samples for sdk 3.2.1.

do you recommend that I go back to 3.2.1? I’m on 3.2.2

I’m just too lazy to install 3.2.2 it’ll probably work fine!

1 Like

Ok, I just tried your latest commit. The good news, both reflector and initiator built cleanly with zero effort, just flashed and started. Also the initiator boots and waits similar to my connection waiting before with the vanilla nordic code.

The bad news, I get an error on the reflector (with or without the initiator powered up). It’s a one and done error due to halting which is nice (unlike the earlier infinite loops).

Not sure why some chars seem off a bit? But I assume it’s 115200 since it looks generally very clear.

Are you running the sense or non sense variant of the board? Hardware wise

I’m running the sense version of the board

Ok, same hardware setup for me. So nothing to do with that!

Ah, so I got it to work after removing those two gpio mentioned in the device tree overlay for rf switch control. ??

Let me play around with it, but already I saw some cool distance measuring!! (see below)

Thanks soooo much for all your help Toastee0!!!