Hi,
I am currently testing the channel sounding capabilities of nRF54L15 with zephyr on NCS 3.2.3.
I used the sample code from nrf\samples\bluetooth\channel_sounding_ras_initiator and reflector and it works well but only use one antenna from both sides.
In my setup, I have one nRF54L15DK as initiator and one custom board as reflector using nRF54L15 and a RF switch (QPC6044 switching in less than 240ns).
I want to use the two antennas connected to my RF switch, but I dont manage to make a working configuration: if i set BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A1_B2 in the initiator, i get this error:
bt_hci_core: opcode 0x2093 status 0x12 BT_HCI_ERR_INVALID_PARAM
app_main: Failed to set procedure parameters (err -22)
Here's my setup:
Initiator -> nRF54L15DK
_create_config_params config_params = { .id = CS_CONFIG_ID, .mode = BT_CONN_LE_CS_MAIN_MODE_2_SUB_MODE_1, .min_main_mode_steps = 2, .max_main_mode_steps = 5, .main_mode_repetition = 0, .mode_0_steps = NUM_MODE_0_STEPS, .role = BT_CONN_LE_CS_ROLE_INITIATOR, .rtt_type = BT_CONN_LE_CS_RTT_TYPE_AA_ONLY, .cs_sync_phy = BT_CONN_LE_CS_SYNC_1M_PHY, .channel_map_repetition = 1, .channel_selection_type = BT_CONN_LE_CS_CHSEL_TYPE_3B, .ch3c_shape = BT_CONN_LE_CS_CH3C_SHAPE_HAT, .ch3c_jump = 2, };
const struct bt_le_cs_set_procedure_parameters_param procedure_params = { .config_id = CS_CONFIG_ID, .max_procedure_len = 1000, .min_procedure_interval = realtime_rd ? 5 : 10, .max_procedure_interval = realtime_rd ? 5 : 10, .max_procedure_count = 0, .min_subevent_len = 16000, .max_subevent_len = 16000, .tone_antenna_config_selection = BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A1_B2, .phy = BT_LE_CS_PROCEDURE_PHY_2M, .tx_power_delta = 0x80, .preferred_peer_antenna = BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1, .snr_control_initiator = BT_LE_CS_SNR_CONTROL_NOT_USED, .snr_control_reflector = BT_LE_CS_SNR_CONTROL_NOT_USED, };
CONFIG_BT_CHANNEL_SOUNDING=yCONFIG_BT_RAS=yCONFIG_BT_RAS_RREQ=yCONFIG_BT_RAS_MODE_3_SUPPORTED=nCONFIG_BT_RAS_MAX_ANTENNA_PATHS=2CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=1CONFIG_BT_CTLR_SDC_CS_STEP_MODE3=nCONFIG_BT_CTLR_SDC_CS_ROLE_INITIATOR_ONLY=yReflector -> custom board base on nRF54L15 with two antennas
nst struct bt_le_cs_set_default_settings_param default_settings = { .enable_initiator_role = false, .enable_reflector_role = true, .cs_sync_antenna_selection = BT_LE_CS_ANTENNA_SELECTION_OPT_REPETITIVE, .max_tx_power = BT_HCI_OP_LE_CS_MAX_MAX_TX_POWER, };
const struct bt_le_cs_set_procedure_parameters_param procedure_params = { .config_id = 0, .max_procedure_len = 1000, .min_procedure_interval = 1, .max_procedure_interval = 100, .max_procedure_count = 0, .min_subevent_len = 1000, .max_subevent_len = 75000, .tone_antenna_config_selection = BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A1_B2, .phy = BT_LE_CS_PROCEDURE_PHY_2M, .tx_power_delta = 0x80, .preferred_peer_antenna = BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1, .snr_control_initiator = BT_LE_CS_SNR_CONTROL_NOT_USED, .snr_control_reflector = BT_LE_CS_SNR_CONTROL_NOT_USED, };CONFIG_BT_CHANNEL_SOUNDING=yCONFIG_BT_RAS=yCONFIG_BT_RAS_RRSP=yCONFIG_BT_RAS_MODE_3_SUPPORTED=nCONFIG_BT_RAS_MAX_ANTENNA_PATHS=2CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2CONFIG_BT_CTLR_SDC_CS_STEP_MODE3=nCONFIG_BT_CTLR_SDC_CS_ROLE_REFLECTOR_ONLY=ycs_antenna_switch: cs-antenna-config { status = "okay"; compatible = "nordic,bt-cs-antenna-switch"; ant-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>; multiplexing-mode = <0>; };My switch works as I can advertise on the different antennas by setting P0.0 or P0.1 to high. I can also use channel sounding just fine with just one antenna path by keeping this configuration and only setting BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A1_B1. I tweaked the settings to allow more time per subevent or a larger procedure interval but i never get past the error coming from bt_le_cs_create_config. I also tried using NCS 3.1.1.
I saw on the channel sounding page that up to 4 antennas paths are supported. If you have any example code working, it would be greatly appreciated.
R. Saboret