This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Coded PHY Advertising on nRF Connect SDK

Hey All,

I ran into an issue on the nRF Connect SDK trying to get a nRF52840 advertising using CODED PHY. I figure it's not fully implemented yet are there any updates on timeline for that? I also posted a bug in the Zephyr repo.

Describe the bug
BLE advertising failed to start on a nRF52840 when enabling BT_LE_ADV_OPT_EXT_ADV.

[00:00:00.002,960] <inf> ble_m: BLE Stack Ready!
[00:00:00.002,960] <inf> ble_peripheral: Bluetooth initialized
[00:00:00.002,960] <err> ble_peripheral: Advertising failed to start (err -22)

To Reproduce

  1. Choose any BLE example
  2. Use a compatible board like nrf52840dk_nrf52840
  3. Add CONFIG_BT_EXT_ADV=y to your prj.conf
  4. When initializing struct bt_le_adv_param *adv_param = add these two flags BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV

Looks like this:


struct bt_le_adv_param *adv_param = BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME | BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV, BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, NULL);


For instance, if I used the throughput example in the SDK and try to set BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV as some of the parameters it always return -22. Looking further into it, it appears that CODED PHY advertising is (purposefully?) disabled in valid_adv_param.

Any insight is appreciated!

Parents
  • Update:

    Adding these guys

    # Link Layer
    CONFIG_BT_LL_NRFXLIB_VS_INCLUDE=y
    CONFIG_BT_LL_NRFXLIB_DEFAULT=y
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y
    Seemed to have done the trick.
    Now, I've set my device connectable using this block:
    struct bt_le_ext_adv *adv;
    struct bt_le_adv_param *adv_param =
    BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME | BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV,
    BT_GAP_ADV_FAST_INT_MIN_2,
    BT_GAP_ADV_FAST_INT_MAX_2,
    NULL);
    But on the central device it always shows up as not connectable. I'm getting that info from the scan_filter_match callback.
    static void scan_filter_match(struct bt_scan_device_info *device_info,
    struct bt_scan_filter_match *filter_match,
    bool connectable)
    {
    // int err;
    
    LOG_INF("Filters matched. Connectable: %s",
    connectable ? "yes" : "no");
    
    If I try to auto-connect, the bt_conn_cb callback returns with an error of 2 which means a timeout. I'll fiddle with it more tomorrow..
Reply
  • Update:

    Adding these guys

    # Link Layer
    CONFIG_BT_LL_NRFXLIB_VS_INCLUDE=y
    CONFIG_BT_LL_NRFXLIB_DEFAULT=y
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y
    Seemed to have done the trick.
    Now, I've set my device connectable using this block:
    struct bt_le_ext_adv *adv;
    struct bt_le_adv_param *adv_param =
    BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME | BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV,
    BT_GAP_ADV_FAST_INT_MIN_2,
    BT_GAP_ADV_FAST_INT_MAX_2,
    NULL);
    But on the central device it always shows up as not connectable. I'm getting that info from the scan_filter_match callback.
    static void scan_filter_match(struct bt_scan_device_info *device_info,
    struct bt_scan_filter_match *filter_match,
    bool connectable)
    {
    // int err;
    
    LOG_INF("Filters matched. Connectable: %s",
    connectable ? "yes" : "no");
    
    If I try to auto-connect, the bt_conn_cb callback returns with an error of 2 which means a timeout. I'll fiddle with it more tomorrow..
Children
Related