Nimble crash/panic after calling nimble_port_stop()
Posted: Thu Jul 27, 2023 12:31 am
In my system I have a situation where BLE may need to be shut down very soon after starting (a low power scenario).
The first log output below is from my code just before I call nimble_port_stop().
The stack trace shows a crash from within the nimble port task, nimble_port_run().
Is it not allowed to call nimble_port_stop() at any time? Do I need to check a condition first?
Thanks,
Felix
The first log output below is from my code just before I call nimble_port_stop().
The stack trace shows a crash from within the nimble port task, nimble_port_run().
Is it not allowed to call nimble_port_stop() at any time? Do I need to check a condition first?
Thanks,
Felix
Code: Select all
I (2089) BLE_SPP: Disabling BLE
E (2089) NimBLE: Host not enabled. Dropping the packet!
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4008542a PS : 0x00060c30 A0 : 0x800e45c8 A1 : 0x3ffd7140
0x4008542a: npl_freertos_callout_is_active at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/porting/npl/freertos/src/npl_os_freertos.c:856
A2 : 0x3ffd2038 A3 : 0x3ffd7178 A4 : 0x3ffc296c A5 : 0x3ffd2418
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x3ffd7120
A10 : 0x000053e8 A11 : 0x00000000 A12 : 0x0000ef00 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00002001 SAR : 0x0000000a EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
Backtrace: 0x40085427:0x3ffd7140 0x400e45c5:0x3ffd7160 0x400e4662:0x3ffd7180 0x400e4803:0x3ffd71a0 0x400e480b:0x3ffd71c0 0x40092d2d:0x3ffd71e0 0x400847d9:0x3ffd7200 0x400dbba0:0x3ffd7220
0x40085427: npl_freertos_callout_is_active at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/porting/npl/freertos/src/npl_os_freertos.c:854
0x400e45c5: ble_npl_callout_is_active at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h:300
(inlined by) ble_hs_timer_sched at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs.c:488
0x400e4662: ble_hs_sync at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs.c:367
0x400e4803: ble_hs_start at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs.c:696
0x400e480b: ble_hs_event_start_stage2 at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs.c:596
0x40092d2d: npl_freertos_event_run at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/porting/npl/freertos/src/npl_os_freertos.c:450
0x400847d9: ble_npl_event_run at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h:185
(inlined by) nimble_port_run at C:/Users/felix/esp5/esp-idf/components/bt/host/nimble/nimble/porting/nimble/src/nimble_port.c:255
0x400dbba0: ble_spp_server_host_task at C:/Users/felix/source/Thor/fw-sensor-hub/main/gl_ble_spp_server.c:521 (discriminator 2)