I am getting a bt_hci_core: HCI driver open failed (-11) with a custom board using nrfConnect for VS Code and 2.9.1 toolchain/sdk.
The code is really simple (I'm not using the callback for simplicity):
#define DEVICE_NAME CONFIG_BT_DEVICE_NAME #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1) static const struct bt_data ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR), BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN), }; bool ble_ready = false; void bt_ready(int err) { if (err) { LOG_ERR("Bluetooth initialization failed (err %d)", err); return; } LOG_DBG("Bluetooth initialized successfully"); ble_ready = true; // Add your service initialization code here // For example, register GATT services, characteristics, etc. } //create a service int ble_service_init(void) { int rc = 0; // Initialize Bluetooth rc = bt_enable(NULL); if (rc) { LOG_ERR("Bluetooth init failed (err %d)", rc); return rc; } LOG_INF("Bluetooth initialized successfully"); // Add your service initialization code here // For example, register GATT services, characteristics, etc. return rc; }
I have this call in main before the loop:
ble_service_init();
I have this in the prj.conf:
CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="BLE Test" CONFIG_BT_LOG_LEVEL_DBG=y
I also have a sysbuild.conf with:
SB_CONFIG_NETCORE_HCI_IPC=y
Error log:
00> [00:00:00.252,349] <dbg> bt_hci_driver: bt_ipc_open: 00> [00:00:01.253,356] <err> bt_hci_driver: Endpoint binding failed with -11 00> [00:00:01.253,387] <err> bt_hci_core: HCI driver open failed (-11) 00> [00:00:01.253,387] <err> ble_service: Bluetooth init failed (err -11)
I read these but they didn't really help:
- NCS HCI driver open failed (-11) - I am using nrfConnect for VS code and hitting the "flash" button
- *** Booting Zephyr OS build zephyr-v3.1.0-2256-gdddb5dd6b0de *** Starting Beacon Demo Bluetooth init failed (err -11) [00:00:01.262,176] bt_hci_driver: Endpoint binding failed with -11 [00:00:01.262,207] bt_hci_core: HCI driver open failed (-1 - I've been through the DevAcademy and have had this running on dk's and even on the custom board at one point
- Bluetooth initialization fails - bt_hci_core driver open fails with error -11 - This one is interesting. Don't know about all the clock pieces and don't remember setting this up on any other device