Channel sounding with 2 antennas

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

    struct bt_le_cs_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=y
CONFIG_BT_RAS=y
CONFIG_BT_RAS_RREQ=y
CONFIG_BT_RAS_MODE_3_SUPPORTED=n
CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=1
CONFIG_BT_CTLR_SDC_CS_STEP_MODE3=n
CONFIG_BT_CTLR_SDC_CS_ROLE_INITIATOR_ONLY=y


Reflector -> custom board base on nRF54L15 with two antennas
        const 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=y
CONFIG_BT_RAS=y
CONFIG_BT_RAS_RRSP=y
CONFIG_BT_RAS_MODE_3_SUPPORTED=n
CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2
CONFIG_BT_CTLR_SDC_CS_STEP_MODE3=n
CONFIG_BT_CTLR_SDC_CS_ROLE_REFLECTOR_ONLY=y

cs_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>;
    };

Those are the default configuration, I just changed CONFIG_BT_RAS_MAX_ANTENNA_PATHS to 2 on both side, CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS to 2 on the reflector, added the cs_antenna_switch on the reflector and changed tone_antenna_config_selection to BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A1_B2 on both sides.

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
Parents
  • Hello,

    Can you try the following confituration on both your devices, please:

    For the one with two antennas:

    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2

    For the one with one antenna:

    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=1

    Let me know if that doesn't work.

    If it does not, can you please upload your entire application (or a strip down version), so that I can build it and see what you are seeing?

    One thing that struck me is that you are using P0.0 and P0.1. By default these are the LFXTAL pins. Did you set the device to use the internal RC Oscillator? (I can't tell from the snippets you provided). Is it possible to test with another set of pins, or are they hardwired on your PCB?

    Best regards,

    Edvin

Reply
  • Hello,

    Can you try the following confituration on both your devices, please:

    For the one with two antennas:

    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2

    For the one with one antenna:

    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=1

    Let me know if that doesn't work.

    If it does not, can you please upload your entire application (or a strip down version), so that I can build it and see what you are seeing?

    One thing that struck me is that you are using P0.0 and P0.1. By default these are the LFXTAL pins. Did you set the device to use the internal RC Oscillator? (I can't tell from the snippets you provided). Is it possible to test with another set of pins, or are they hardwired on your PCB?

    Best regards,

    Edvin

Children
  • Hello Edvin,

    Thank you for your time and sorry for the delay, I was out of office.


    The setup I was using already had those configurations but didnt work :

    >>For the one with two antennas:

    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2

    >>For the one with one antenna:

    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=2
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=1


    For the P0.0 and P0.1 pins, they are hardwired in my PCB. I previously confirmed I can set them on and off to select the different antennas. As for the configuration, im using:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n



    Here I can upload the simplest code about channel sounding with two antennas:
    channel_sounding_ras_sample_323_two_antennas.zip
    It it literally the sample code from ncs/v3.2.3/nrf/samples/bluetooth with the only changes being the antennas number in prj.conf and the BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A1_B2 setting in the code.

    When I flash this code on two nRF54L15DK (one initiator, one reflector), the initiator fails after the connection is established when it tries to call bt_le_cs_set_procedure_parameters:

    I: CS security enabled.
    W: opcode 0x2093 status 0x12 
    E: Failed to set procedure parameters (err -22)

    The nRF54L15DK doesnt have a RF switch connected to pins P1.11, P1.12, P1.13 and P1.14 (as specified in nrf54l15dk_nrf54l15_cpuapp.overlay) but that shouldnt be a problem: the channel sounding procedure will just use twice the same antenna, thinking it has switched in between.


    Regards,

    R. Saboret

Related