nrf sdk 2.9.2
I wanted to stop Bluetooth activity, so I used `bt_disable`, but a kernel panic occurred.
So I create a simple example to try this function, I still get the same result
[00:00:20.540,679] <err> ipc_service: Endpoint not registered
[00:00:20.540,710] <err> bt_hci_driver: Failed to send (err -2)
ASSERTION FAIL @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:430
[00:00:30.540,924] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x200030d8
[00:00:30.540,924] <err> os: r3/a4: 0x00000003 r12/ip: 0x00000003 r14/lr: 0x0000c6bf
[00:00:30.540,924] <err> os: xpsr: 0x01000000
[00:00:30.540,954] <err> os: Faulting instruction address (r15/pc): 0x0000c6ce
[00:00:30.540,985] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:30.541,015] <err> os: Current thread: 0x200030d8 (BT MESH WQ)
[00:00:30.819,763] <err> fatal_error: Resetting system
[00:00:20.540,710] <err> bt_hci_driver: Failed to send (err -2)
ASSERTION FAIL @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:430
[00:00:30.540,924] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x200030d8
[00:00:30.540,924] <err> os: r3/a4: 0x00000003 r12/ip: 0x00000003 r14/lr: 0x0000c6bf
[00:00:30.540,924] <err> os: xpsr: 0x01000000
[00:00:30.540,954] <err> os: Faulting instruction address (r15/pc): 0x0000c6ce
[00:00:30.540,985] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:30.541,015] <err> os: Current thread: 0x200030d8 (BT MESH WQ)
[00:00:30.819,763] <err> fatal_error: Resetting system
Example code
static void button_handler(uint32_t button_state, uint32_t has_changed)
{
if (has_changed & button_state & DK_BTN1_MSK) {
printk("Button 1 pressed! Triggering shutdown...");
bt_le_adv_stop();
bt_mesh_suspend();
k_msleep(100);
bt_disable();
}
}
static void bt_ready(int err)
{
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}
printk("Bluetooth initialized\n");
err = dk_leds_init();
if (err) {
printk("Initializing LEDs failed (err %d)\n", err);
return;
}
err = dk_buttons_init(button_handler);
if (err) {
printk("Initializing buttons failed (err %d)\n", err);
return;
}
err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init());
if (err) {
printk("Initializing mesh failed (err %d)\n", err);
return;
}
if (IS_ENABLED(CONFIG_SETTINGS)) {
settings_load();
}
/* This will be a no-op if settings_load() loaded provisioning info */
bt_mesh_prov_enable(BT_MESH_PROV_ADV | BT_MESH_PROV_GATT);
printk("Mesh initialized\n");
}
int main(void)
{
int err;
printk("Initializing...\n");
err = bt_enable(bt_ready);
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
}
return 0;
}
How to fix that?
There is no such problem in sdk 2.5.0
Thank you.
