Channel Sounding: Reflector with Ranging Responder

Overview

Application demonstrates the BLE responser role in an RAP (Ranging Profile) system and the reflector role for Channel Sounding. It can be connected with a BLE requester application (Refer to ras_rreq_initiator). And then indicates channel sounding ranging procedure or sends ranging procedure data according GATT Ranging service control point write commands.

Note

On the ATMBTCSTAG-3405 board, additional board-specific behaviors are enabled by boards/ATMBTCSTAG-3405.conf (power on/off, factory reset, battery report, LED indication, and audio feedback). See Channel Sounding Reflector on ATMBTCSTAG-3405 for the full description.

Requirements

  1. Atmosic EVK <board | serial>

Note

  • Currently, the ATM34/e and ATM53/e series of Atmosic devices are supported.

  • ATM52 does not support channel sounding.

  1. Button

    • Press Button2 to unpair the device.

    Note

    • The default pin for Button2 is P6.

    • Install the JP27 and JP25 jumpers to enable Button2.

  2. Antenna_switch: connect IO to switch antenna as channel sounding enable

  • Need to connect external antenna switch board for EVK

  • For the related pin setting, please refer to the overlay file.

  • If there is no overlay file, the function is disabled.

  • Refer to atmosic,antenna.yaml for below properties.

    • e.g. P5 as antenna switch (JP29 in EVK board).

      In the case, Button1 can not be used, since it is also used with P5.

    / {
     aliases {
      sw0 = &button1;
     };
    };
    &atm_antenna {
     ant-out5-pin = <5>;
     mdm-ant-rx-3to0 = <0x00002000>;
     mdm-ant-tx-3to0 = <0x00002000>;
     mdm-ant-idle =<0>;
     status = "okay";
    };
    
    • e.g. P16 as antenna switch, and antenna0 with P16 high

    &atm_antenna {
     ant-out0-pin = <16>;
     mdm-ant-rx-3to0 = <0x00000001>;
     mdm-ant-tx-3to0 = <0x00000001>;
     mdm-ant-idle =<0x01>;
     status = "okay";
    };
    

Configuration Options

Bluetooth Privacy

Bluetooth privacy is enabled by default. When testing the reflector with an Android phone running the Atmosic Dev Tool application, disable Bluetooth privacy in the build so that the phone can connect to the reflector:

CONFIG_BT_PRIVACY=n

Antenna Configuration

For Channel Sounding, a few antenna combinations are supported as mentioned below.

Note

On ATM34, ATM53/e devices, a 2×2 or 2x1 or 1x1 antenna configuration is supported with CS as an reflector:

# For 2x2 Antenna configuration (ATM53/e only)
CONFIG_ATM_BLE_CS_NUM_ANTENNAS=2
CONFIG_CS_PROC_ANT_CFG_SEL=7 (2x2 2 Antenna on Initiator; 2 on Reflector)

or

# For 2x1 Antenna configuration
CONFIG_ATM_BLE_CS_NUM_ANTENNAS=2
CONFIG_CS_PROC_ANT_CFG_SEL=1 (2x1 2 Antenna on Initiator; 1 on Reflector)

or

# For 1x1 Antenna configuration
CONFIG_ATM_BLE_CS_NUM_ANTENNAS=1
CONFIG_CS_PROC_ANT_CFG_SEL=0 (1x1 1 Antenna on Initiator; 1 on Reflector)

CS Inline PCT (Phase Correction Term) Transfer (CS IPT) Support on ATM53/e

CS IPT is only supported on ATM53/e platform.

To enable CS (Channel Sounding) Enhancement 1 support, which allows the reflector to advertise Inline PCT Transfer (CS IPT) capability to the initiator, add the following configuration option to your project configuration file (prj.conf):

CONFIG_ATM_ENA_LL_FEAT_CS_ENH1=y

This option enables CS Enhancement 1 (CS IPT) at the link layer, allowing the initiator to detect and activate IPT in the CS configuration when both sides support it.

Filter Ranging Data

To enable filtering of ranging data reported by the RAS server, add the following configuration option to your project configuration file (prj.conf):

CONFIG_RAS_FILTER_RD=y

This option enables:

  • Support for the RAS Set Filter control point command

  • Filtering of Mode 2 ranging data fields, including:

    • Antenna Permutation Index (bit 0)

    • Phase Correction Term (bit 1)

    • Quality Indicator and Extension Indicator (bit 2)

Note

CONFIG_RAS_FILTER_RD=y is typically paired with CONFIG_ATM_ENA_LL_FEAT_CS_ENH1=y when using CS reflector CS IPT, so that the initiator can request filtering of the Phase Correction Term from the ranging data:

CONFIG_ATM_ENA_LL_FEAT_CS_ENH1=y
CONFIG_RAS_FILTER_RD=y

Testing

To test the reflector, connect it to an initiator. The initiator can be another compatible EVK running the ras_rreq_initiator application or a mobile phone with Channel Sounding initiator functionality. Use a phone and application that support the required Channel Sounding functionality; phone capabilities and application availability may vary by model and software version.

Connect the initiator EVK UART0 to the Atmosic CS Plot Tool at 2000000 baud to view the distance result. A mobile phone can also be used as the initiator for the phone-specific flows described below.

Default configuration (without Inline PCT)

  1. Build and flash the reflector using the default target below.

  2. Run the initiator on another compatible EVK and connect its UART0 to the Atmosic CS Plot Tool at 2000000 baud.

  3. Scan for Atmosic_RRSP, connect and pair with the reflector, and start a Channel Sounding session in the initiator application.

  4. Verify the distance result in the Atmosic CS Plot Tool.

Android phone test

For testing without Inline PCT Transfer, an Android phone with initiator functionality can be used with the Atmosic Dev Tool application. Build the reflector with Bluetooth privacy disabled so that the phone can connect:

west build -p always -b <BOARD> openair/applications/ras_rrsp_reflector \
    --sysbuild -T applications.ras_rrsp_reflector.atm -- -DCONFIG_BT_PRIVACY=n

Scan for Atmosic_RRSP, connect and pair with the reflector, start a Channel Sounding session, and verify the distance result in the phone application.

Inline PCT Transfer (CS IPT) configuration

CS IPT is only supported on ATM53/e platform.

For Inline PCT Transfer testing, build the reflector with the applications.ras_rrsp_reflector.atm.ipt target and build the initiator with its corresponding applications.ras_rreq_initiator.atm.ipt target. Run the initiator on another compatible EVK and connect its UART0 to the Atmosic CS Plot Tool at 2000000 baud. Alternatively, a compatible iPhone with initiator functionality can be used with a Core Bluetooth Channel Sounding application.

Building and Running

This application is built from openair/applications/ras_rrsp_reflector.

Build command:

west build -p always -b <BOARD> openair/applications/ras_rrsp_reflector --sysbuild -T applications.ras_rrsp_reflector.atm

Build with Inline PCT Transfer (CS IPT) support:

CS IPT is only supported on ATM53/e platform.

west build -p always -b <BOARD> openair/applications/ras_rrsp_reflector --sysbuild -T applications.ras_rrsp_reflector.atm.ipt

Build with MCUboot command: Run the following command to build the MCUboot and application

west build -p always -b <BOARD>@mcuboot openair/applications/ras_rrsp_reflector --sysbuild -T applications.ras_rrsp_reflector.atm.mcuboot

Build with OTA command: Run the following command to build the application and MCUboot with -DEXTRA_CONF_FILE="basic_ota_bt.conf" to enable OTA function

west build -p always -b <BOARD>@mcuboot openair/applications/ras_rrsp_reflector --sysbuild -T applications.ras_rrsp_reflector.atm.mcuboot.ota

Flash command:

west flash --no-rebuild --device <DEVICE_ID> --jlink [--erase_all]