I am exploring the possibility of using ncs v2.8.0 for Mesh with Coded PHY on the nRF52840dk/nRF52840 board. I know this is not officially supported.
I started with the mesh_provisioner sample and added the following CONFIGs to my prj.conf to activate logging by RTT and what I think is needed for coded phy:
CONFIG_LOG=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_BT_PHY_UPDATE=y CONFIG_BT_EXT_ADV=y CONFIG_BT_HCI_MESH_EXT=y CONFIG_BT_CTLR_ADV_EXT=y CONFIG_BT_CTLR_PHY_CODED=y
I also updated my adv_ext.c:
void bt_mesh_adv_init(void) { struct bt_le_adv_param adv_param = { .id = BT_ID_DEFAULT, .interval_min = BT_MESH_ADV_SCAN_UNIT(ADV_INT_FAST_MS), .interval_max = BT_MESH_ADV_SCAN_UNIT(ADV_INT_FAST_MS), // #if defined(CONFIG_BT_MESH_DEBUG_USE_ID_ADDR) // .options = BT_LE_ADV_OPT_USE_IDENTITY, // #endif .options = BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV, }; . . . }
And adv.c:
static void bt_mesh_scan_cb(const bt_addr_le_t *addr, int8_t rssi, uint8_t adv_type, struct net_buf_simple *buf) { // if (adv_type != BT_GAP_ADV_TYPE_ADV_NONCONN_IND) { if (adv_type != BT_GAP_ADV_TYPE_EXT_ADV) { return; } . . . } int bt_mesh_scan_enable(void) { struct bt_le_scan_param scan_param = { .type = active_scanning ? BT_LE_SCAN_TYPE_ACTIVE : BT_LE_SCAN_TYPE_PASSIVE, .interval = MESH_SCAN_INTERVAL, .options = BT_LE_SCAN_OPT_CODED | BT_LE_SCAN_OPT_NO_1M, .window = MESH_SCAN_WINDOW }; . . . }
I noticed I was missing some logs on RTT so I added a k_msleep(5000); after printk("initializing"); right in the beginning of the main function.
Then I started seeing the warning and error at the end of the next log:
Initializing... [00:00:05.007,324] <inf> fs_nvs: 2 Sectors of 4096 bytes [00:00:05.007,324] <inf> fs_nvs: alloc wra: 0, fe8 [00:00:05.007,354] <inf> fs_nvs: data wra: 0, 0 [00:00:05.007,415] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision: fe 2c f9 6a 7f 36 22 2e a0 79 c0 40 be 2c 03 20 |.,.j.6". .y.@.,. 40 c2 f3 32 |@..2 [00:00:05.009,338] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002) [00:00:05.009,368] <inf> bt_hci_core: HW Variant: nRF52x (0x0002) [00:00:05.009,399] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906 [00:00:05.009,582] <inf> bt_hci_core: No ID address. App must call settings_load() Bluetooth initialized Mesh initialized Loading stored settings [00:00:05.270,202] <inf> bt_hci_core: Identity: D2:8E:FC:17:F6:A4 (random) [00:00:05.270,233] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059 [00:00:05.270,263] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x104e Created CDB [00:00:05.270,690] <inf> bt_mesh_main: Primary Element: 0x0001 [00:00:05.282,287] <wrn> bt_hci_core: opcode 0x2041 status 0x12 [00:00:05.282,318] <err> bt_mesh_adv: starting scan failed (err -22) Provisioning completed Configuring self... Configuration complete Waiting for unprovisioned beacon... Waiting for unprovisioned beacon...
I'm worried I'm missing something, this doesn't happen without the changes for the Coded PHY mesh. Should I change something else?