-
Notifications
You must be signed in to change notification settings - Fork 69
Description
PROBLEM DESCRIPTION
I'm using an ESP32 H2 with NimBLE and i want to connect 4 Bluetooth Slaves to the master, it's working with 3 clients perfectly but the 4th device won't connect.
So i've investigated what's necessary to do, because the controller itself should support up to 9 devices.
I've tried it with the stable and also with the develop version. I've tried it with build_flags and also with menuconfig via hybrid framework configuration of arduino, espidf.
I'm using the h2zero/NimBLE-Arduino @ ^2.3.6 library currently.
I've adjusted the config with these parameters:
CONFIG_NIMBLE_CPP_LOG_LEVEL=0
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=9
DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
CONFIG_BT_NIMBLE_MAX_BONDS=9
CONFIG_BT_NIMBLE_MAX_CCCDS=9
And i'm getting this error with a crash after the controller is connecting the 4th Slave:
06:17:02.831 > [INFO] ✓ Subscribing to notifications...
06:17:02.831 > I (9669) NimBLE: GATT procedure initiated: discover all descriptors;
06:17:02.837 > I (9670) NimBLE: chr_val_handle=16 end_handle=19
06:17:02.840 >
06:17:02.863 > I (9700) NimBLE: GATT procedure initiated: write;
06:17:02.863 > I (9701) NimBLE: att_handle=17 len=2
06:17:02.865 >
06:17:02.891 > [INFO] ✓ Successfully connected and subscribed to 48:31:b7:c5:bf:aa
06:17:03.701 > [INFO] [Status] Slaves:3/4 App:NO Heap:139344
06:17:03.701 > [VR PWM:0/0] [HR PWM:0/0] [VL PWM:0/0]
06:17:05.702 > [INFO] [Status] Slaves:3/4 App:NO Heap:139332
06:17:05.702 > [VR PWM:0/0] [HR PWM:0/0] [VL PWM:0/0]
06:17:07.701 > [INFO] [Status] Slaves:3/4 App:NO Heap:139340
06:17:07.703 > [VR PWM:0/0] [HR PWM:0/0] [VL PWM:0/0]
06:17:09.695 > [INFO] Scan finished.
06:17:09.696 > [INFO] Starting BLE scan for slaves...
06:17:09.696 > I (16533) NimBLE: GAP procedure initiated: discovery;
06:17:09.701 > I (16534) NimBLE: own_addr_type=0 filter_policy=0 passive=0 limited=0 filter_duplicates=1
06:17:09.712 > I (16540) NimBLE: duration=forever
06:17:09.712 > I (16543) NimBLE:
06:17:09.717 >
06:17:09.717 > [INFO] [Status] Slaves:3/4 App:NO Heap:142072
06:17:09.717 > [VR PWM:0/0] [HR PWM:0/0] [VL PWM:0/0]
06:17:09.769 > [INFO] Queueing connection for 48:31:b7:c5:ad:22
06:17:09.769 > [INFO] Found new slave to connect to: 48:31:b7:c5:ad:22
06:17:09.774 > [INFO] New client created
06:17:09.779 > [INFO] Attempting to connect to 48:31:b7:c5:ad:22...
06:17:09.785 > I (16622) NimBLE: GAP procedure initiated: connect;
06:17:09.785 > I (16623) NimBLE: peer_addr_type=0 peer_addr=
06:17:09.790 > I (16625) NimBLE: 48:31:b7:c5:ad:22
06:17:09.796 > I (16625) NimBLE: scan_itvl=16 scan_window=16 itvl_min=12 itvl_max=12 latency=0 supervision_timeout=150 min_ce_len=0 max_ce_len=0 own_addr_type=0
06:17:09.807 > I (16636) NimBLE:
06:17:09.807 >
06:17:09.807 > assertion:callout
06:17:09.812 > line:651,function:npl_freertos_callout_init
06:17:09.812 >
06:17:09.856 > assert failed: npl_freertos_callout_init npl_os_freertos.c:651 (0)
06:17:09.862 > Core 0 register dump:
06:17:09.862 > MEPC : 0x4080d492 RA : 0x4080d450 SP : 0x40825820 GP : 0x40816624
06:17:09.867 > TP : 0x40825ae0 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
06:17:09.878 > S0/FP : 0x00000085 S1 : 0x00000001 A0 : 0x4082585c A1 : 0x40817965
06:17:09.884 > A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x4081c000
06:17:09.895 > A6 : 0x0000000c A7 : 0x76757473 S2 : 0x00000009 S3 : 0x40825972
06:17:09.901 > S4 : 0x40817964 S5 : 0x4084fcd4 S6 : 0x40825a44 S7 : 0x00000000
06:17:09.906 > S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
06:17:09.917 > T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
06:17:09.923 > MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000002 MTVAL : 0x00000000
06:17:09.934 > MHARTID : 0x00000000
06:17:09.934 >
06:17:09.934 > Stack memory:
06:17:09.934 > 40825820: 0x00000000 0x00003d75 0x420b40a8 0x408139e6 0x40817948 0x420b40a8 0x40817958 0x420a8981
06:17:09.945 > 40825840: 0x4081795c 0x40825854 0x40817960 0x420a0244 0x40817964 0x00313536 0x420a56c3 0x65737361
06:17:09.951 > 40825860: 0x66207472 0x656c6961 0x6e203a64 0x665f6c70 0x72656572 0x5f736f74 0x6c6c6163 0x5f74756f
06:17:09.962 > 40825880: 0x74696e69 0x6c706e20 0x5f736f5f 0x65657266 0x736f7472 0x363a632e 0x28203135 0x40002930
06:17:09.967 > 408258a0: 0x00313536 0x40850000 0x4081bd10 0x4000b06c 0x40800000 0xfff00000 0x000fffff 0x00000020
06:17:09.978 > 408258c0: 0x00000001 0x00000000 0x4081c3f0 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
06:17:09.990 > 408258e0: 0x40825a44 0x4084fcd4 0x4082b650 0x420580b8 0x4081c000 0x4082b75c 0x420b4000 0x40002e08
06:17:09.995 > 40825900: 0x00e7ad72 0x000fffff 0x4082ab44 0x4080307a 0x0000080c 0x00000020 0x4082595c 0x40825934
06:17:10.006 > 40825920: 0x0000080c 0x00000000 0x00000000 0x42000000 0x40825dbc 0x0000028b 0x4082b650 0x420580b8
06:17:10.012 > 40825940: 0x4081c000 0x4082b75c 0x420b4000 0x42029060 0x2024001b 0x00000000 0x4081bab0 0x408005a2
06:17:10.023 > 40825960: 0x40825db4 0x00000000 0x420a8a24 0x00000000 0x4081c000 0x40825a43 0x4082420a 0x4082420d
06:17:10.028 > 40825980: 0x4081c000 0x4081c000 0x4082b650 0x42059522 0x4081c000 0x4081bac4 0x00000000 0x4205ab20
06:17:10.039 > 408259a0: 0x4080f3f4 0x4080f3ec 0x4082420a 0x4082b650 0x4081c000 0x00000000 0x4081bb1c 0x4205aec6
06:17:10.045 > 408259c0: 0x4082434c 0x00000000 0x40824207 0x00000003 0x4081c000 0x00000007 0x40824207 0x4205ba62
06:17:10.056 > 408259e0: 0xfa000000 0x00100010 0xad220000 0x4831b7c5 0x000c0000 0x0000000c 0x00000096 0x00000000
06:17:10.062 > 40825a00: 0x00000000 0x00000000 0x00000000 0x40824207 0x00000019 0x0000200d 0x0000000d 0x420634e4
06:17:10.073 > 40825a20: 0x00000000 0x4082420a 0x40824207 0x0000000d 0x4081bab4 0x0000200d 0x40824204 0x42063bba
06:17:10.084 > 40825a40: 0x00a40015 0x00000000 0x00000000 0x00003ebc 0x00000004 0x2004001c 0x4081c000 0x40800718
06:17:10.090 > 40825a60: 0x4081bab4 0x420b9000 0x4081c000 0x40800718 0x4081bab4 0x4081c000 0x4081e724 0x408003f6
06:17:10.101 > 40825a80: 0x4081bab4 0x4081c000 0x4081e724 0x42053046 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.106 > 40825aa0: 0x00000000 0x00000000 0x00000000 0x4080f15e 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.117 > 40825ac0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
06:17:10.123 > 40825ae0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000150 0x408257b0 0x00000000 0x4081a88c
06:17:10.134 > 40825b00: 0x4081a88c 0x40825af4 0x4081a884 0x00000002 0x40824378 0x40824378 0x40825af4 0x00000000
06:17:10.139 > 40825b20: 0x00000017 0x408246f0 0x5f656c62 0x745f6c6c 0x006b7361 0x00000000 0x40825ae0 0x00000017
06:17:10.151 > 40825b40: 0x00000000 0x00000000 0x00000000 0x00000000 0x4081c658 0x4081c6c0 0x4081c728 0x00000000
06:17:10.156 > 40825b60: 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x4203d91a 0x00000000 0x00000000
06:17:10.167 > 40825b80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.178 > 40825ba0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.184 > 40825bc0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.195 > 40825be0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.201 > 40825c00: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
06:17:10.212 >
06:17:10.212 >
06:17:10.212 >
06:17:10.212 > ELF file SHA256: 279390255
06:17:10.212 >
06:17:10.212 > Rebooting...
06:17:10.235 > I (17) boot: ESP-IDF 5.5.1.250929 2nd stage bootloader
06:17:10.235 > I (18) boot: compile time Nov 3 2025 06:15:59
06:17:10.240 > I (19) boot: chip revision: v0.1
06:17:10.246 > I (20) boot: efuse block revision: v0.3
06:17:10.246 > I (21) boot.esp32h2: SPI Speed : 64MHz
06:17:10.251 > I (25) boot.esp32h2: SPI Mode : DIO
06:17:10.257 > I (29) boot.esp32h2: SPI Flash Size : 4MB
06:17:10.257 > I (33) boot: Enabling RNG early entropy source...
06:17:10.263 > I (37) boot: Partition Table:
06:17:10.268 > I (40) boot: ## Label Usage Type ST Offset Length
06:17:10.274 > I (46) boot: 0 nvs WiFi data 01 02 00009000 00006000
06:17:10.279 > I (52) boot: 1 phy_init RF data 01 01 0000f000 00001000
06:17:10.285 > I (59) boot: 2 factory factory app 00 00 00010000 00100000
06:17:10.290 > I (66) boot: End of partition table
06:17:10.296 > I (69) esp_image: segment 0: paddr=00010020 vaddr=420a0020 size=1bf3ch (114492) map
06:17:10.342 > I (123) esp_image: segment 1: paddr=0002bf64 vaddr=40800000 size=040b4h ( 16564) load
06:17:10.351 > I (133) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=986bch (624316) map
06:17:10.606 > I (388) esp_image: segment 3: paddr=000c86e4 vaddr=408040b4 size=14354h ( 82772) load
06:17:10.646 > I (428) esp_image: segment 4: paddr=000dca40 vaddr=50000000 size=00020h ( 32) load
06:17:10.661 > I (443) boot: Loaded app from partition at offset 0x10000
06:17:10.661 > I (444) boot: Disabling RNG early entropy source...
06:17:10.669 > I (453) cpu_start: Unicore app
06:17:10.680 > I (462) cpu_start: Pro cpu start user code
06:17:10.680 > I (463) cpu_start: cpu freq: 96000000 Hz
06:17:10.686 > I (463) app_init: Application information:
06:17:10.691 > I (463) app_init: Project name: ASC_Evo2
06:17:10.691 > I (466) app_init: App version: 1e97310-dirty
06:17:10.697 > I (471) app_init: Compile time: Nov 3 2025 06:14:24
06:17:10.703 > I (476) app_init: ELF file SHA256: 279390255...
06:17:10.708 > I (480) app_init: ESP-IDF: 5.5.1.250929
06:17:10.714 > I (484) efuse_init: Min chip rev: v0.0
06:17:10.714 > I (488) efuse_init: Max chip rev: v1.99
06:17:10.719 > I (492) efuse_init: Chip rev: v0.1
06:17:10.725 > I (496) heap_init: Initializing. RAM available for dynamic allocation:
06:17:10.730 > I (502) heap_init: At 4081BD10 len 00031670 (197 KiB): RAM
06:17:10.736 > I (508) heap_init: At 4084D380 len 00002B60 (10 KiB): RAM
06:17:10.741 > I (513) heap_init: At 50000020 len 00000FC8 (3 KiB): RTCRAM
06:17:10.747 > I (519) spi_flash: detected chip: gd
06:17:10.747 > I (521) spi_flash: flash io: dio
06:17:10.753 > I (525) sleep_gpio: Configure to isolate all GPIO pins in sleep state
06:17:10.758 > I (531) sleep_gpio: Enable automatic switching of GPIO sleep configuration
06:17:10.764 > I (537) coexist: coex firmware version: b0bcc39
06:17:10.787 > I (569) main_task: Started on CPU0
06:17:10.787 > I (569) main_task: Calling app_main()
06:17:10.793 > I (578) main_task: RW (680) rmt: channel resolution loss, real=10666666
06:17:11.500 > [INFO]
TO REPRODUCE
It's very simple:
Just try to connect more than 3 Bluetooth BLE clients to a master together.
EXPECTED BEHAVIOUR
It should work with more than 3 clients, because the hardware is supporting it
SCREENSHOTS
(not necessary i guess)
ADDITIONAL CONTEXT
i've also opened a ticket here about that issue:
h2zero/NimBLE-Arduino#1060