Hello!
We have a project under nRF Connect SDK and Zephyr. It uses Bluetooth central and peripheral role (GATT client and server).
The project works good under SDK v2.7.0.
Now we want to migrate to the newest version, which is v2.8.0. But after compiling the firmware, we get the following error in logs:
[00:00:06.019,000] <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 ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:430 Controller unresponsive, command opcode 0x0c03 timeout with err -11 [00:00:16.022,000] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000002 r2/a3: 0x00000001 [00:00:16.022,000] <err> os: r3/a4: 0x00000003 r12/ip: 0x00000004 r14/lr: 0x0005c2db [00:00:16.022,000] <err> os: xpsr: 0x01000000 [00:00:16.022,000] <err> os: Faulting instruction address (r15/pc): 0x0005c2ea [00:00:16.022,000] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0 [00:00:16.023,000] <err> os: Current thread: 0x2000fe68 (main) [00:00:16.083,000] <err> os: Halting system
The code to initialize Bluetooth:
int ble_service_init(void) { int ret = EXIT_SUCCESS; if (is_init) { goto exit; } //Initialize internal variables memset(&c_filters, 0, sizeof(c_filters)); serv_state = STOPPED; serv_conn = NULL; k_work_init(&d_conn_device.work, d_conn_work); //! Enable BLE stack ret = bt_enable(NULL); if (ret) { LOG_ERR("Failed to enable BLE, code: %d", ret); } if (IS_ENABLED(CONFIG_SETTINGS)) { settings_load(); } struct bt_le_scan_param scan_param = { .type = BT_HCI_LE_SCAN_PASSIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = BLE_SVC_SCAN_INTERVAL, .window = BLE_SVC_SCAN_WINDOW, .timeout = 0 //! Do not stop scann }; struct bt_scan_init_param param = { .scan_param = &scan_param, .conn_param = BT_LE_CONN_PARAM_DEFAULT, .connect_if_match = 1 }; bt_scan_init(¶m); bt_scan_cb_register(&scan_cb); int err = bt_scan_start(BT_SCAN_TYPE_SCAN_PASSIVE); if (err) { LOG_ERR("Scanning failed to start, code: %d", err); } err = bt_scan_filter_enable(BT_SCAN_ADDR_FILTER, true); if (err) { LOG_ERR("Filters cannot be turned on, code: %d", err); return -1; } LOG_INF("BLE initialized"); exit: if (ret == EXIT_SUCCESS) { is_init = true; } return ret; }
The error occurs when calling the bt_enable(NULL); function.
prj.conf file content (all non-bluetooth settings are omitted here):
CONFIG_BT_RX_STACK_SIZE=2048 CONFIG_BT_PERIPHERAL=y CONFIG_BT=y CONFIG_BT_DEVICE_NAME_DYNAMIC=y CONFIG_BT_SMP=y CONFIG_BT_CTLR=y CONFIG_BT_FIXED_PASSKEY=y CONFIG_BT_CENTRAL=y CONFIG_BT_MAX_CONN=3 CONFIG_BT_SCAN_WITH_IDENTITY=y CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1 CONFIG_BT_SCAN=y CONFIG_BT_SCAN_FILTER_ENABLE=y CONFIG_BT_SCAN_ADDRESS_CNT=3 CONFIG_BT_GATT_DM=y CONFIG_BT_GATT_CLIENT=y
From what I have found, the 0x0c03 opcode is a RESET command for a Bluetooth host, and it fails.
I have also tried selecting the bt-ll-sw-split snipped in the build configuration, but it changes nothing.
What am I missing?