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




