Bluetooth failure after update
Posted: Tue Jan 10, 2017 5:53 pm
I based a gatt server off of the demo gatt server and it was working fine until I updated the esp-idf yesterday (it had been a few weeks since I updated it last). Something is causing a crash. I get the following error:
Guru Meditation Error of type InstrFetchProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0xffffffff PS : 0x00060d30 A0 : 0x80019128 A1 : 0x3ffd3ca0
A2 : 0xffffffff A3 : 0x3ffbb806 A4 : 0x00000006 A5 : 0x40019138
A6 : 0x3ffbb80d A7 : 0x00000001 A8 : 0x80017920 A9 : 0x00000003
A10 : 0x3ffbb806 A11 : 0x00000007 A12 : 0x4001751c A13 : 0x3ffb8140
A14 : 0x00000005 A15 : 0x17e722cd SAR : 0x00000010 EXCCAUSE: 0x00000014
EXCVADDR: 0xfffffffc LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0xffffffff
I did some debugging and found that the error comes when calling
xQueueSend in btc_task_post
btc_task_post is called from btc_transfer_context
btc_transfer_context is called from esp_bluedroid_enable
which is called from my initialization code:
esp_err_t ret;
esp_bt_controller_init();
ret = esp_bluedroid_init();
if (ret) {
ESP_LOGE(GATTS_TAG, "%s init bluetooth failed\n", __func__);
return;
}
ret = esp_bluedroid_enable();
if (ret) {
ESP_LOGE(GATTS_TAG, "%s enable bluetooth failed\n", __func__);
return;
}
esp_ble_gatts_register_callback(gatts_event_handler);
esp_ble_gap_register_callback(gap_event_handler);
esp_ble_gatts_app_register(PROFILE_A_APP_ID);
esp_ble_gatts_app_register(PROFILE_B_APP_ID);
I tried a few different sdk configurations but couldn't get it to work. Could someone help me with this one?
Guru Meditation Error of type InstrFetchProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0xffffffff PS : 0x00060d30 A0 : 0x80019128 A1 : 0x3ffd3ca0
A2 : 0xffffffff A3 : 0x3ffbb806 A4 : 0x00000006 A5 : 0x40019138
A6 : 0x3ffbb80d A7 : 0x00000001 A8 : 0x80017920 A9 : 0x00000003
A10 : 0x3ffbb806 A11 : 0x00000007 A12 : 0x4001751c A13 : 0x3ffb8140
A14 : 0x00000005 A15 : 0x17e722cd SAR : 0x00000010 EXCCAUSE: 0x00000014
EXCVADDR: 0xfffffffc LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0xffffffff
I did some debugging and found that the error comes when calling
xQueueSend in btc_task_post
btc_task_post is called from btc_transfer_context
btc_transfer_context is called from esp_bluedroid_enable
which is called from my initialization code:
esp_err_t ret;
esp_bt_controller_init();
ret = esp_bluedroid_init();
if (ret) {
ESP_LOGE(GATTS_TAG, "%s init bluetooth failed\n", __func__);
return;
}
ret = esp_bluedroid_enable();
if (ret) {
ESP_LOGE(GATTS_TAG, "%s enable bluetooth failed\n", __func__);
return;
}
esp_ble_gatts_register_callback(gatts_event_handler);
esp_ble_gap_register_callback(gap_event_handler);
esp_ble_gatts_app_register(PROFILE_A_APP_ID);
esp_ble_gatts_app_register(PROFILE_B_APP_ID);
I tried a few different sdk configurations but couldn't get it to work. Could someone help me with this one?