I’m using ESP32-C3, ESP-IDF, and esp32-c3-devkitm-1. I run a project example fast prove server example and added the “Store BLE Mesh configuration persistently” to store the joining network data in NVS flash to the project. my problem is after joining the node to the network (my client is nRF Mesh mobile App), everything is correct but when I reset the ESP32 and want to connect to it again the ESP32 reset. and I can not join ESP32 with nRF Mesh Mobile App again. so I have to clear the NVS flash with one button and this function: esp_ble_mesh_node_local_reset(); to do join process again. the reset error is:
E (404909) BT_OSI: osi_alarm_new alarm_cbs exhausted
assert failed: hash_map_set hash_map.c:129 (data != NULL)
Core 0 register dump:
MEPC : 0x403816be RA : 0x40389470 SP : 0x3fcb3490 GP : 0x3fc91000
TP : 0x3fc80d9c T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x0000008e S1 : 0x00000001 A0 : 0x3fcb34cc A1 : 0x3fc928c1
A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x3fc9a000
A6 : 0x7a797877 A7 : 0x76757473 S2 : 0x00000009 S3 : 0x3fcb35d9
S4 : 0x3fc928c0 S5 : 0x3fcb38bc S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
3fcb3490: 0x00000000 0x3fcb38bc 0x3c0f6780 0x4038f1e2 0x3fc93118 0x3c0f6780 0x3fc933d4 0x3c0f6802
3fcb34b0: 0x3fc93128 0x3fcb34c4 0x3fc9312c 0x3c0e4028 0x3fc928c0 0x00393231 0x3fc9dce4 0x65737361
3fcb34d0: 0x66207472 0x656c6961 0x68203a64 0x5f687361 0x5f70616d 0x20746573 0x68736168 0x70616d5f
...
...
...
ELF file SHA256: 19cc199fd03b8d83
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xe (SPI_FAST_FLASH_BOOT)
Saved PC:0x403812e0
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x16b4
load:0x403cc710,len:0x930
load:0x403ce710,len:0x2d28
entry 0x403cc710
I (35) boot: ESP-IDF 4.4.2 2nd stage bootloader
I (35) boot: compile time 14:51:41
I (35) boot: chip revision: 3
I (37) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (44) boot.esp32c3: SPI Speed : 80MHz
I (48) boot.esp32c3: SPI Mode : DIO
I (53) boot.esp32c3: SPI Flash Size : 4MB
I (58) boot: Enabling RNG early entropy source...
I (63) boot: Partition Table:
I (67) boot: ## Label Usage Type ST Offset Length
I (74) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (82) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (89) boot: 2 factory factory app 00 00 00010000 00200000
I (97) boot: End of partition table
I (101) boot_comm: chip revision: 3, min. application chip revision: 0
...
...
...
...
I (909) Mesh: init Bluetooth Mesh.
W (1639) BLE_MESH: bt_mesh_proxy_server_prov_disable, Already
I (1649) Mesh Prov: ESP_BLE_MESH_NODE_PROV_COMPLETE_EVT
I (1649) Prov cmplt: net_index: 0x0000, addr: 0x007e
I (1649) Prov cmplt: flags: 0x0000, iv_index: 0x00000000
I (1659) Mesh Prov: ESP_BLE_MESH_PROV_REGISTER_COMP_EVT, Error Code: 0
I (1669) Mesh Prov: ESP_BLE_MESH_NODE_SET_UNPROV_DEV_NAME_COMP_EVT, Error Code: 0
E (1679) BT_OSI: osi_alarm_new alarm_cbs exhausted
E (1679) BLE_MESH: Alarm not created
W (1689) BLE_MESH: bt_mesh_prov_enable, Already
I (1689) Mesh Prov: ESP_BLE_MESH_NODE_PROV_ENABLE_COMP_EVT, Error Code: -120
after this reseting I see BLE_MESH: Alarm not created again, now if I connect to ESP32 the reset happens again and again...
Regards.
From the documentation what I understood was, when you activated the Store BLE Mesh configuration persistently every time you reset the device when it's booting up again the allocated memory is not released yet, so when it boots again the memory got full and throws the osi_alarm_new alarm_cbs exhausted
What works for me was increasing ALARM_CBS_NUM in alarm.h inside https://github.com/espressif/esp-idf/blob/master/components/bt/common/osi/include/osi/alarm.h#L36 to 80, then rebuild and re-flash