NIMBLE stack crashes

Jonas A
Posts: 16
Joined: Tue Mar 09, 2021 11:14 am

NIMBLE stack crashes

Postby Jonas A » Wed Sep 29, 2021 7:38 am

Hi,

I use IDF version 4.3 and uses NIMBLE stack both for central and peripheral role. Sometimes the NIMBLE stack crashes when peripheral is connected and central is trying to connect to a device.

I've registered two different reasons for the NIMBLE stack reset:

0x0c (12) BLE_HS_ECONTROLLER Event from controller is invalid.
0x13 (19) BLE_HS_ETIMEOUT_HCI HCI request timed out; controller unresponsive.

I've attached logs.

What triggers these resets?
Attachments
nimble_stack_reset_reason_12.png
nimble_stack_reset_reason_12.png (206.68 KiB) Viewed 1918 times
disconnect_reason_19.png
disconnect_reason_19.png (176.34 KiB) Viewed 1918 times
disconnect_reason_12.png
disconnect_reason_12.png (198.5 KiB) Viewed 1918 times

Jonas A
Posts: 16
Joined: Tue Mar 09, 2021 11:14 am

Re: NIMBLE stack crashes

Postby Jonas A » Wed Sep 29, 2021 9:24 am

I added a log with debug printouts enabled, seems like assertion fails in ble_gap.c line 1166:


/**
* Called when an error is encountered while the master-connection-fsm is
* active.
*/
static void
ble_gap_master_failed(int status)
{
switch (ble_gap_master.op) {
case BLE_GAP_OP_M_CONN:
STATS_INC(ble_gap_stats, initiate_fail);
ble_gap_master_connect_failure(status);
break;

#if NIMBLE_BLE_SCAN
case BLE_GAP_OP_M_DISC:
STATS_INC(ble_gap_stats, initiate_fail);
ble_gap_disc_complete();
ble_gap_master_reset_state();
break;
#endif

default:
BLE_HS_DBG_ASSERT(0); <-------------------------------------------------------------------------
break;
}
}
Attachments
crash_with_debug_printout.png
crash_with_debug_printout.png (199.65 KiB) Viewed 1882 times

Who is online

Users browsing this forum: Baidu [Spider] and 339 guests