Page 1 of 1

NIMBLE stack crashes

Posted: Wed Sep 29, 2021 7:38 am
by Jonas A
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?

Re: NIMBLE stack crashes

Posted: Wed Sep 29, 2021 9:24 am
by Jonas A
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;
}
}