nRF52840 HCI USB / SDC – How to configure per-connection event length and scheduling

Hi Nordic team,

I am using the nRF52840 HCI USB project as the controller firmware, with a Linux device acting as the Bluetooth host.

My application has multiple BLE connections, and each connection has a different expected data/sample rate. Therefore, my desired behavior is to give each connection an appropriate amount of radio time while keeping the connections efficient and predictable.

For example, I would like to have something conceptually similar to:

Connection A: 22.5 ms interval, 12.5 ms event length   -> high sample rate
Connection B: 22.5 ms interval, 7.5 ms event length   -> medium sample rate
Connection C: 22.5 ms interval, 2.5 ms event length   -> low sample rate

The important requirement is that the connection interval can be the same, while the amount of radio time allocated to each connection is different according to its data-rate requirement.

With another HCI USB controller, my application achieves the expected aggregate and per-device sample rates. With the nRF52840 HCI USB firmware, however, I see scheduling-related problems:

  • the aggregate/initial sample rate fluctuates instead of being stable;
  • the actual sample rate of individual devices is sometimes lower than the expected rate;
  • the problem becomes more apparent when multiple connections with different data-rate requirements are active.

I suspect this is related to how the SDC scheduler allocates radio time between connection events.

I understand that:

sdc_hci_cmd_le_conn_update()

is associated with the specific connection handle, so the standard connection parameters can be changed independently for each connection using LE Connection Update (0x2013).

However, I am not sure how:

sdc_hci_cmd_vs_event_length_set()

works in this respect — specifically, whether the event length is also associated with an individual connection handle or whether this is a global SDC/controller setting.

I am also using:

CONFIG_BT_CTLR_SDC_CONN_EVENT_EXTEND_DEFAULT=y
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT_OVERRIDE=y
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=7500

Main question

What is the recommended way to achieve a different connection event length for each connection, and how does the SDC scheduler behave when multiple connections have the same connection interval but different event lengths?


I would particularly appreciate an explanation of the SDC scheduling behavior in this scenario and the recommended Nordic configuration/API for achieving per-connection event lengths.

  • Hi, 

    What NCS version are you using?

    With another HCI USB controller, my application achieves the expected aggregate and per-device sample rates.

    What do you mean by "another HCI USB controller"? Is it the Zephyr Bluetooth LE Controller?

    Regards,
    Amanda H.

  • Hi

    I am using nRF Connect SDK (NCS) version 3.0.0.

    The other HCI USB dongle I mentioned is a controller from another manufacturer. It is not Zephyr-based, so I am not comparing two Zephyr controller implementations. I am using it only as a reference because, with that controller, the same Linux host/application and BLE connection setup achieves the expected aggregate and per-device sample rates.

    The nRF52840 is running the Nordic HCI USB / SDC controller firmware, with the Linux system acting as the Bluetooth host.

  • So sdc_hci_cmd_vs_event_length_set() sets the event length globally, but this is cached when the connection is set up (when issuing a command to create a connection or starting a connectable advertiser). Also, for this case, the same value needs to be passed to sdc_hci_cmd_vs_central_acl_event_spacing_set() .

     

    So before setting up Connection A, you would want to call sdc_hci_cmd_vs_event_length_set() and sdc_hci_cmd_vs_central_acl_event_spacing_set() with 12500 , then before setting up Connection B call sdc_hci_cmd_vs_event_length_set() and sdc_hci_cmd_vs_central_acl_event_spacing_set() with 7500 and finally, before setting up Connection C call sdc_hci_cmd_vs_event_length_set() and sdc_hci_cmd_vs_central_acl_event_spacing_set() with 2500.

     

    What this will do is instruct the controller to place the connections acl_event_spacing apart and allow event_length for transmissions.

Related