Getting channel sounding start_simple_cs_test working in zephyr bluetooth shell

How can you get the simple channel sounding test going with the bluetooth/cs shell commands?  

I've got the shell working over UART and devices talking with each other but can never get passed:


Received subevent results.
Subevent Header:
- Procedure Counter: 0
- Frequency Compensation: 0x0000
- Reference Power Level: -61
- Procedure Done Status: 0x00
- Subevent Done Status: 0x0f
- Procedure Abort Reason: 0x00
- Subevent Abort Reason: 0x02
- Number of Antenna Paths: 1
- Number of Steps Reported: 3
Subevent results contained step data:
- Step mode 0
- Step channel 52
- Step data hexdump:
00000000: 02 7f 01 f0 58 |....|
Subevent results contained step data:
- Step mode 0
- Step channel 9
- Step data hexdump:
00000000: 02 7f 01 f0 58 |....|
Subevent results contained step data:
- Step mode 0
- Step channel 62
- Step data hexdump:
00000000: 02 7f 01 f0 58 |....|
uart:~$

This is aborting for reason 0x02, i.e. BT_HCI_LE_CS_PROCEDURE_ABORT_REASON_TOO_FEW_CHANNELS.  I've tried messing with the internals to get more channels enabled than the default to wind up with a config something like this:


- ID: 0
- Role: Initiator
- Main mode: 2 (PBR)
- Sub mode: 1 (RTT)
- RTT type: AA only
- Main mode steps: 2 - 3
- Main mode repetition: 3
- Mode 0 steps: 3
- CS sync PHY: LE 1M PHY
- T_IP1 time: 60
- T_IP2 time: 30
- T_FCS time: 80
- T_PM time: 20
- Channel map: 0x1FFFFFFFFFFFFC7FFFFC
- Channel map repetition: 3
- Channel selection type: Algorithm #3b
- Ch3c shape: Hat shape
- Ch3c jump: 2

but it just never works.  Perhaps I'm missing something with the sequence of shell commands--the commands are all there, but there aren't any examples of actually using anything.  So I've worked out the following sequence:

bt init

bt connect-name MY_REFLECTOR

bt security 2

cs read_remote_supported_capabilities

cs set_default_settings true false 0x01 -20

cs security_enable

cs default_config initiator local-remote

cs create_config 0 local-only initiator pbr-rtt aa-only

cs set_procedure_parameters

cs start_simple_cs_test 0

Has anyone got the CS start_simple_cs_test actually working and can you specify how you managed to do so/anything you see in the above I'm doing wrong.

Thanks,

PatD

  • Hi Pat

    Sorry, I'm still looking into this and will get back to you on what should be done to remedy the BT_HCI_LE_CS_PROCEDURE_ABORT_REASON_TOO_FEW_CHANNELS error message.

    Best regards,

    Simon

  • Thank you for looking into this.  

    If you look into cmd_create_config() (in zephyr/subsys/bluetooth/host/shell/cs.c) you'll find a bug in the test for argv[2] (it's checking "local-only" twice, rather than "local-remote" in the second case), which makes me uncertain how much this code has actually been used.

    If you can get a working sequence going, it would be much appreciated. 

  • Hi again

    It seems like the main point of confusion here is regarding the Subevent Abort Reason and the Procedure Abort Reason. In the specification these aren't split, but the abort is rather split into two fields in the abort_reason. One for the subevent and one for the procedure. These values should be based on the procedure_ and subevent_done_status which you shared:

    The subevent seems to be aborted due to an unspecified reason (0x2) which points to there being no CS_SYNC (mode-0) received. This checks out with the subevent performing 3 mode-0 steps before aborting. Can you show how you've set up the CS_SYNC procedure in your application so we have more to go on?

    Best regards,

    Simon

  • I'm unclear on what you're asking.

    The applications I'm using are
      * nrf/samples/bluetooth/channel_sounding_ras_reflector on one side and
      * zephyr/subsys/bluetooth/host/shell/cs.c on the other (basically https://docs.zephyrproject.org/latest/connectivity/bluetooth/bluetooth-shell.html with CS enabled).

    What I'd like is just for you to describe a single sequence in the bt shell that will allow a

        cs start_simple_cs_test 0

    to work beyond the couple of mode-0 steps I've described above.  Has anyone managed to ever use this code to do this and run a sounding test and, if so, how exactly?  

    (note, I've also tried with both sides running the bt shell, but that's just more variables and things to do--if this is required, please let me know what to do on both ends).

  • Hi

    Sorry, I guess that description was a bit overly technical.

    I don't have a sample on how to do so, and as far as I know we haven't done this yet, no. Can you share a snippet of your code showing how the channel sounding synchronization is done on your end and we will try to see what needs to be done here.

    Best regards,

    Simon

Related