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..
  • I have not played with CODED PHY in Zephyr, but you seems to have a good progress on this. Jared, please keep us updated with this so that fellow developers gain from your experience.

  • Hi

    It appears that connectable advertising for CODED PHY is not implemented on Zephyr. I don't think there are any work arounds until this is implemented unfortunately. More updates in the Github issue.

  • Hi

    I didn't have much luck moving forward.

    Some Nordic engineers on the Zephyr repo are convinced I should be able to use it with the Nordic LL. Any way to get more information?

    Thanks!

  • I was instructed to try doing everything manually with the tests/bluetooth/shell example. My attempt looked like this:

    bt init
    bt adv-create conn-scan ext-adv coded
    bt adv-select 0
    bt adv-start
    

    I had to use the adv- commands as they're specific for the new extended API. Unfortunately seems some type of kernel issue with the scheduler. Exactly sure what's going on there.

    Advertiser[0] 0x20003944 set started
    uart:~$ ASSERTION FAIL [!arch_is_in_isr()] @ ../../../../kernel/include/ksched.h:267
    

    I only added a few Lins to the prj.conf:

    CONFIG_BT_LL_NRFXLIB_VS_INCLUDE=y
    CONFIG_BT_LL_NRFXLIB_DEFAULT=y
    CONFIG_BT_MAX_CONN=2

    Building with this:

    west build -b nrf52840dk_nrf52840
  • Hi Jared,
    The guys replying to you in the Zephyr forum are the guys I would have contacted internally too.  cuficarles and vinayak are the experts in this. Lets hope they have time reply in the zephyr forum.

Reply Children
Related