Skip to content

Crash after attempting to connect and bond for more than 3 devices #1060

@ovi1337

Description

@ovi1337

I have currently a project with 5 ESP32 H2 devices, one is the Master and 4 Slaves, all 4 clients should be bonded automatically but it's working just for 3 devices and when it's connecting the 4th device is the Master crashing with the log below.
It's also every time another device which is not connected, so it's not depending to a special device.
The data transfer is also very small and with a delay of 5 seconds, so the stack should'nt be overloaded. These parts are working very well and i'm also not using the delay function at all, so it's not thread blocker in the code.

I hope that someone can help me to solve this issue somehow, because i have no idea why it happens and how i can solve it.

I'm currently trying to solve the issue with these parameters, but it's simply not working:

CONFIG_BT_NIMBLE_MAX_CONNECTIONS=9
CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
CONFIG_BT_NIMBLE_MAX_BONDS=9

The rest of parameters are default.

I'm using:

h2zero/NimBLE-Arduino @ ^2.3.6
Arduino Release v3.3.2 based on ESP-IDF v5.5.1.250929  (pioarduino stable, latest release)

Here is the full log of the connection attempt:

16:16:33.490 > [INFO] 
16:16:33.490 > ═══════════════════════════════════
16:16:33.495 > [INFO] ESP32-H2 BLE Controller v1.1
16:16:33.501 > [INFO] ═══════════════════════════════════
16:16:33.611 > [INFO] Mode: MASTER
16:16:33.611 > [INFO] ═══════════════════════════════════════════
16:16:33.622 > [INFO] Initializing MASTER
16:16:33.622 > [INFO] Device name: ASCevo2_Master
16:16:33.676 > [INFO] Master advertising started: YES
16:16:33.676 > [INFO] Master ready
16:16:33.676 > [INFO] ═══════════════════════════════════════════
16:16:33.693 > 
16:16:33.693 > [INFO] Starting BLE scan for slaves...
16:16:33.693 > [INFO] System ready!
16:16:33.697 > [INFO] Commands: S=Status, C=Scan, R=Reset
16:16:33.709 > [INFO] Queueing connection for 48:31:b7:c5:bf:aa
16:16:33.709 > [INFO] Found new slave to connect to: 48:31:b7:c5:bf:aa
16:16:33.715 > [INFO] New client created
16:16:33.720 > [INFO] Attempting to connect to 48:31:b7:c5:bf:aa...
16:16:33.848 > [INFO] ✓ Client for 48:31:b7:c5:bf:aa connected
16:16:33.848 > [INFO] ✓ Getting service 4fafc201-1fb5-459e-8fcc-c5c9c331914b...
16:16:33.907 > [INFO] ✓ Getting characteristic beb5483e-36e1-4688-b7f5-ea07361b26a8...
16:16:33.966 > [INFO] ✓ Subscribing to notifications...
16:16:34.028 > [INFO] ✓ Successfully connected and subscribed to 48:31:b7:c5:bf:aa
16:16:34.769 > [INFO] [Status] Slaves:1/4 App:NO Heap:147652
16:16:34.769 >   [VL PWM:0/0] 
16:16:36.770 > [INFO] [Status] Slaves:1/4 App:NO Heap:147652
16:16:36.770 >   [VL PWM:0/0] 
16:16:38.771 > [INFO] [Status] Slaves:1/4 App:NO Heap:147652
16:16:38.771 >   [VL PWM:0/0] 
16:16:40.772 > [INFO] [Status] Slaves:1/4 App:NO Heap:147652
16:16:40.772 >   [VL PWM:0/0] 
16:16:41.689 > [INFO] Scan finished.
16:16:41.689 > [INFO] Starting BLE scan for slaves...
16:16:41.724 > [INFO] Queueing connection for 48:31:b7:c5:ad:22
16:16:41.724 > [INFO] Found new slave to connect to: 48:31:b7:c5:ad:22
16:16:41.729 > [INFO] New client created
16:16:41.734 > [INFO] Attempting to connect to 48:31:b7:c5:ad:22...
16:16:41.869 > [INFO] ✓ Client for 48:31:b7:c5:ad:22 connected
16:16:41.870 > [INFO] ✓ Getting service 4fafc201-1fb5-459e-8fcc-c5c9c331914b...
16:16:41.929 > [INFO] ✓ Getting characteristic beb5483e-36e1-4688-b7f5-ea07361b26a8...
16:16:41.987 > [INFO] ✓ Subscribing to notifications...
16:16:42.049 > [INFO] ✓ Successfully connected and subscribed to 48:31:b7:c5:ad:22
16:16:42.773 > [INFO] [Status] Slaves:2/4 App:NO Heap:146432
16:16:42.773 >   [HL PWM:0/0] [VL PWM:0/0] 
16:16:44.774 > [INFO] [Status] Slaves:2/4 App:NO Heap:144008
16:16:44.774 >   [HL PWM:0/0] [VL PWM:0/0] 
16:16:46.775 > [INFO] [Status] Slaves:2/4 App:NO Heap:144008
16:16:46.775 >   [HL PWM:0/0] [VL PWM:0/0] 
16:16:48.776 > [INFO] [Status] Slaves:2/4 App:NO Heap:144008
16:16:48.776 >   [HL PWM:0/0] [VL PWM:0/0] 
16:16:49.692 > [INFO] Scan finished.
16:16:49.693 > [INFO] Starting BLE scan for slaves...
16:16:49.715 > [INFO] Queueing connection for 48:31:b7:c5:ac:37
16:16:49.715 > [INFO] Found new slave to connect to: 48:31:b7:c5:ac:37
16:16:49.720 > [INFO] New client created
16:16:49.725 > [INFO] Attempting to connect to 48:31:b7:c5:ac:37...
16:16:49.864 > [INFO] ✓ Client for 48:31:b7:c5:ac:37 connected
16:16:49.864 > [INFO] ✓ Getting service 4fafc201-1fb5-459e-8fcc-c5c9c331914b...
16:16:49.917 > [INFO] ✓ Getting characteristic beb5483e-36e1-4688-b7f5-ea07361b26a8...
16:16:49.980 > [INFO] ✓ Subscribing to notifications...
16:16:50.043 > [INFO] ✓ Successfully connected and subscribed to 48:31:b7:c5:ac:37
16:16:50.779 > [INFO] [Status] Slaves:3/4 App:NO Heap:141932
16:16:50.779 >   [HR PWM:0/0] [HL PWM:0/0] [VL PWM:0/0] 
16:16:52.779 > [INFO] [Status] Slaves:3/4 App:NO Heap:141920
16:16:52.779 >   [HR PWM:0/0] [HL PWM:0/0] [VL PWM:0/0] 
16:16:54.780 > [INFO] [Status] Slaves:3/4 App:NO Heap:141948
16:16:54.781 >   [HR PWM:0/0] [HL PWM:0/0] [VL PWM:0/0] 
16:16:56.781 > [INFO] [Status] Slaves:3/4 App:NO Heap:141968
16:16:56.781 >   [HR PWM:0/0] [HL PWM:0/0] [VL PWM:0/0] 
16:16:57.696 > [INFO] Scan finished.
16:16:57.696 > [INFO] Starting BLE scan for slaves...
16:16:57.979 > [INFO] Queueing connection for 48:31:b7:c5:8c:f4
16:16:57.979 > [INFO] Found new slave to connect to: 48:31:b7:c5:8c:f4
16:16:57.985 > [INFO] New client created
16:16:57.988 > [INFO] Attempting to connect to 48:31:b7:c5:8c:f4...
16:16:57.999 > assertion:callout
16:16:57.999 > line:651,function:npl_freertos_callout_init
16:16:57.999 > 
16:16:58.050 > assert failed: npl_freertos_callout_init npl_os_freertos.c:651 (0)
16:16:58.056 > Core  0 register dump:
16:16:58.056 > MEPC    : 0x4080c244  RA      : 0x4080c208  SP      : 0x40825f00  GP      : 0x40814784  
16:16:58.183 >   #0  0x4080c244 in panic_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/panic.c:491
16:16:58.183 > 
16:16:58.183 > TP      : 0x408261e0  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
16:16:59.651 > S0/FP   : 0x00000001  S1      : 0x40826072  A0      : 0x40825f64  A1      : 0x40815f45  
16:16:59.651 > A2      : 0x00000001  A3      : 0x00000029  A4      : 0x00000001  A5      : 0x4081a000  
16:16:59.651 > A6      : 0x0000000c  A7      : 0x76757473  S2      : 0x00000085  S3      : 0x40825f58  
16:16:59.651 > S4      : 0x40825f58  S5      : 0x40825f64  S6      : 0x4081a000  S7      : 0x00000000  
16:16:59.651 > S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
16:16:59.651 > T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
16:16:59.651 > MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
16:16:59.651 > MHARTID : 0x00000000  
16:16:59.651 > 
16:16:59.651 > Stack memory:
16:16:59.651 > 40825f00: 0x408261e0 0x4000af8c 0x420b2e50 0x40811d62 0x40828e24 0x00000014 0x00000001 0x40815f44
16:16:59.651 >   #0  0x40811d62 in esp_libc_include_assert_impl at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/src/assert.c:96
16:16:59.651 >   #1  0x40815f44 in __global_pointer$ at ??:?
16:16:59.651 > 
16:16:59.651 > 40825f20: 0x00000044 0x00000001 0x00000000 0x00313536 0x0000db09 0x40815f28 0x420b2e50 0x40815f38
16:16:59.651 >   #0  0x40815f28 in __global_pointer$ at ??:?
16:16:59.651 >   #1  0x40815f38 in __global_pointer$ at ??:?
16:16:59.651 > 
16:16:59.651 > 40825f40: 0x420aab69 0x40815f3c 0x40825f2c 0x40815f40 0x420a9ac0 0x40815f44 0x00000000 0x00000000
16:17:05.193 >   #0  0x40815f3c in __global_pointer$ at ??:?
16:17:05.193 >   #1  0x40815f40 in __global_pointer$ at ??:?
16:17:05.193 >   #2  0x40815f44 in __global_pointer$ at ??:?
16:17:05.193 > 
16:17:05.193 > 40825f60: 0xff000000 0x65737361 0x66207472 0x656c6961 0x6e203a64 0x665f6c70 0x72656572 0x5f736f74
16:17:05.193 > 40825f80: 0x6c6c6163 0x5f74756f 0x74696e69 0x6c706e20 0x5f736f5f 0x65657266 0x736f7472 0x363a632e
16:17:05.193 > 40825fa0: 0x28203135 0x40002930 0x4081a170 0x4000b06c 0x4080d838 0x4000af90 0x40826030 0x4000af90
16:17:05.193 >   #0  0x4080d838 in vPortClearInterruptMaskFromISR at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:514
16:17:05.193 > 
16:17:05.193 > 40825fc0: 0x4081a170 0x00000020 0x40828d80 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
16:17:05.193 > 40825fe0: 0x4081a000 0x4081a000 0x4081d964 0x4082c708 0x4204108a 0x4082c814 0x420b3000 0x40002e08
16:17:05.193 >   #0  0x4204108a in r_ble_ll_conn_auth_pyld_timer_cb at ??:?
16:17:05.193 > 
16:17:05.193 > 40826000: 0x00000001 0x00000000 0x00000020 0x40800d68 0x00000000 0x00000020 0x4082605c 0x40826034
16:17:05.193 >   #0  0x40800d68 in heap_caps_calloc_base at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps_base.c:332
16:17:05.193 > 
16:17:05.193 > 40826020: 0x42064f5c 0x4082c708 0x40826508 0x01f6cfd5 0x42064f5c 0x4081a000 0x4081d964 0x4082c708
16:17:05.193 >   #0  0x42064f5c in r_ble_lll_conn_superversion_timer_cb at ??:?
16:17:05.193 >   #1  0x42064f5c in r_ble_lll_conn_superversion_timer_cb at ??:?
16:17:05.193 > 
16:17:05.193 > 40826040: 0x4204108a 0x4082c814 0x420b3000 0x4203484c 0x40822cc4 0x0000080c 0x00000258 0x408020fc
16:17:05.193 >   #0  0x4204108a in r_ble_ll_conn_auth_pyld_timer_cb at ??:?
16:17:05.193 >   #1  0x4203484c in npl_freertos_callout_init at ??:?
16:17:05.193 >   #2  0x408020fc in ble_npl_event_fn_wrapper at npl_os_freertos.c.obj:?
16:17:05.193 > 
16:17:05.193 > 40826060: 0x40826500 0x00000000 0x420aac0c 0x00000000 0x0000080c 0x40826153 0x40824852 0x00000000
16:17:05.193 > 40826080: 0x40826154 0x40826153 0x40824852 0x40824855 0x4081a000 0x4081a000 0x4082c708 0x420424f4
16:17:05.193 >   #0  0x420424f4 in r_ble_ll_conn_callout_env_init_for_sm at ??:?
16:17:05.193 > 
16:17:05.193 > 408260a0: 0x4081a000 0x40819f20 0x00000000 0x42043af2 0x408249b8 0x00000000 0x40824852 0x4082c708
16:17:10.437 >   #0  0x42043af2 in r_ble_ll_conn_sm_alloc at ??:?
16:17:10.437 > 
16:17:10.437 > 408260c0: 0x4081a000 0x00000000 0x40819f78 0x42043e98 0x00000001 0x40818000 0x4082484f 0x00000003
16:17:10.437 >   #0  0x42043e98 in r_ble_ll_conn_sm_fetch_new at ??:?
16:17:10.437 > 
16:17:10.437 > 408260e0: 0x4081a000 0x00000007 0x4082484f 0x42044a34 0x00000000 0x00100010 0x8cf40000 0x4831b7c5
16:17:10.437 >   #0  0x42044a34 in r_ble_ll_conn_create at ??:?
16:17:10.437 > 
16:17:10.437 > 40826100: 0x000c0000 0x0000000c 0x00000096 0x01730000 0x40826178 0x00000000 0x408249b8 0x4082484f
16:17:10.437 > 40826120: 0x00000019 0x0000200d 0x0000000d 0x4204c4b6 0x00000000 0x40824852 0x4082484f 0x0000000d
16:17:10.437 >   #0  0x4204c4b6 in r_ble_ll_hci_le_cmd_proc at ??:?
16:17:10.437 > 
16:17:10.437 > 40826140: 0x40819f10 0x0000200d 0x4082484c 0x4204cb8c 0x00819f10 0x00000000 0x4084f7dc 0x40802328
16:17:10.437 >   #0  0x4204cb8c in r_ble_ll_hci_cmd_proc at ??:?
16:17:10.437 >   #1  0x40802328 in npl_freertos_eventq_get at ??:?
16:17:10.437 > 
16:17:10.437 > 40826160: 0x00000001 0x2004001c 0x4081a000 0xffffffff 0x40819f10 0x420b4000 0x4081a000 0x40802258
16:17:10.437 >   #0  0x40802258 in npl_freertos_eventq_get at ??:?
16:17:10.437 > 
16:17:10.437 > 40826180: 0x40819f10 0x4081a000 0x4081e5a0 0x4203c018 0x00000000 0x00000000 0x00000000 0x00000000
16:17:10.437 >   #0  0x4203c018 in r_ble_ll_task at ??:?
16:17:10.437 > 
16:17:10.437 > 408261a0: 0x00000000 0x00000000 0x00000000 0x4080d700 0x00000000 0x00000000 0x00000000 0x00000000
16:17:10.437 >   #0  0x4080d700 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:258
16:17:10.437 > 
16:17:10.437 > 408261c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
16:17:10.437 > 408261e0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000168 0xabba1234 0x0000015c 0x40825fb0
16:17:11.822 > 40826200: 0x00000000 0x408189ec 0x408189ec 0x408261fc 0x408189e4 0x00000002 0x408249e4 0x408249e4
16:17:11.822 > 40826220: 0x408261fc 0x00000000 0x00000017 0x40824dec 0x5f656c62 0x745f6c6c 0x006b7361 0x00000000
16:17:11.822 > 40826240: 0x408261e0 0x00000007 0x00000000 0x00000017 0x00000000 0x00000000 0x00000000 0x0037ff02
16:17:11.822 > 40826260: 0x00000000 0x4081ab5c 0x4081abc4 0x4081ac2c 0x00000000 0x00000000 0x00000001 0x00000000
16:17:11.822 > 40826280: 0x00000000 0x00000000 0x4202ac96 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
16:17:11.822 >   #0  0x4202ac96 in esp_cleanup_r at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/src/newlib_init.c:42
16:17:11.822 > 
16:17:11.822 > 408262a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
16:17:11.822 > 408262c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
16:17:11.822 > 408262e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
16:17:11.822 > 
16:17:11.822 > 
16:17:11.822 > 
16:17:11.822 > ELF file SHA256: 980b8e4b5
16:17:11.822 > 
16:17:11.822 > Rebooting...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions