Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32] - Make sure that BLE indications are sent sequentially #22446

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

dhrishi
Copy link
Contributor

@dhrishi dhrishi commented Sep 7, 2022

The next indication is sent only after the previous one is acked

Problem

@yufengwangca As per our offline discussion, please try it for your automated test issue reported in #22416

Change overview

A status of 0 indicates that the indication is sent from the BLE host. Ideally, we should move to the next step when the status received is BLE_HS_EDONE which indicates the indication ack is received. For any other status value, give an appropriate error.

In short, handle all the status values except for 0.

Testing

  • BLE based commissioning successful

@dhrishi dhrishi changed the title ESP32 - Make sure that BLE indications are sent sequentially [ESP32] - Make sure that BLE indications are sent sequentially Sep 7, 2022
The next indication is sent only after the previous one is acked
@github-actions
Copy link

github-actions bot commented Sep 7, 2022

PR #22446: Size comparison from 33f6a91 to cf837ea

Increases (5 builds for bl602, cc13x2_26x2, psoc6, qpg, telink)
platform target config section 33f6a91 cf837ea change % change
bl602 lighting-app bl602 .text 1065748 1065750 2 0.0
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 676443 676451 8 0.0
.text 598888 598896 8 0.0
psoc6 lock cy8ckit_062s2_43012 .debug_info 22295294 22295296 2 0.0
qpg lighting-app qpg6105+debug (read/write) 1129212 1129220 8 0.0
.text 576308 576316 8 0.0
telink light-switch-app tlsr9518adk80d text 571568 571570 2 0.0
Decreases (3 builds for cc13x2_26x2, esp32, psoc6)
platform target config section 33f6a91 cf837ea change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read/write) 165276 165268 -8 -0.0
esp32 all-clusters-app m5stack (read only) 1086511 1086503 -8 -0.0
.flash.text 1081127 1081119 -8 -0.0
psoc6 light cy8ckit_062s2_43012 .debug_info 21915511 21915510 -1 -0.0
Full report (45 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section 33f6a91 cf837ea change % change
bl602 lighting-app bl602 (read/write) 1410330 1410330 0 0.0
.bss 121585 121585 0 0.0
.data 9816 9816 0 0.0
.text 1065748 1065750 2 0.0
bl602+rpc (read/write) 1455534 1455534 0 0.0
.bss 129017 129017 0 0.0
.data 10200 10200 0 0.0
.text 1097098 1097098 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 675391 675391 0 0.0
(read/write) 176016 176016 0 0.0
.bss 74300 74300 0 0.0
.data 3380 3380 0 0.0
.rodata 89223 89223 0 0.0
.text 585856 585856 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 640103 640103 0 0.0
(read/write) 157868 157868 0 0.0
.bss 73572 73572 0 0.0
.data 3380 3380 0 0.0
.rodata 78375 78375 0 0.0
.text 561408 561408 0 0.0
lock-ftd LP_CC2652R7 (read only) 676443 676451 8 0.0
(read/write) 165276 165268 -8 -0.0
.bss 71500 71500 0 0.0
.data 3304 3304 0 0.0
.rodata 77075 77075 0 0.0
.text 598888 598896 8 0.0
lock-mtd LP_CC2652R7 (read only) 659411 659411 0 0.0
(read/write) 177996 177996 0 0.0
.bss 67188 67188 0 0.0
.data 3304 3304 0 0.0
.rodata 102331 102331 0 0.0
.text 556600 556600 0 0.0
pump-app LP_CC2652R7 (read only) 685279 685279 0 0.0
(read/write) 157144 157144 0 0.0
.bss 71436 71436 0 0.0
.data 3296 3296 0 0.0
.rodata 90087 90087 0 0.0
.text 594708 594708 0 0.0
pump-controller-app LP_CC2652R7 (read only) 669779 669779 0 0.0
(read/write) 172756 172756 0 0.0
.bss 71548 71548 0 0.0
.data 3292 3292 0 0.0
.rodata 85643 85643 0 0.0
.text 583656 583656 0 0.0
shell LP_CC2652R7 (read only) 666042 666042 0 0.0
(read/write) 180884 180884 0 0.0
.bss 76620 76620 0 0.0
.data 3376 3376 0 0.0
.rodata 85778 85778 0 0.0
.text 579948 579948 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586954 586954 0 0.0
.app_xip_area 463612 463612 0 0.0
.bss 65776 65776 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592698 592698 0 0.0
.app_xip_area 464572 464572 0 0.0
.bss 70560 70560 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599866 599866 0 0.0
.app_xip_area 477244 477244 0 0.0
.bss 65088 65088 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1108608 1108608 0 0.0
.bss 136332 136332 0 0.0
.data 2072 2072 0 0.0
.text 970184 970184 0 0.0
BRD4161A+rpc (read/write) 972236 972236 0 0.0
.bss 150844 150844 0 0.0
.data 2252 2252 0 0.0
.text 819120 819120 0 0.0
BRD4161A+rs911x (read/write) 1002104 1002104 0 0.0
.bss 169168 169168 0 0.0
.data 2064 2064 0 0.0
.text 830852 830852 0 0.0
lock-app BRD4161A+wf200 (read/write) 1150148 1150148 0 0.0
.bss 152248 152248 0 0.0
.data 2072 2072 0 0.0
.text 995808 995808 0 0.0
window-app BRD4161A (read/write) 1099840 1099840 0 0.0
.bss 137772 137772 0 0.0
.data 2096 2096 0 0.0
.text 959952 959952 0 0.0
esp32 all-clusters-app c3devkit (read only) 1033904 1033904 0 0.0
(read/write) 1493510 1493510 0 0.0
.dram0.bss 71120 71120 0 0.0
.dram0.data 13696 13696 0 0.0
.flash.rodata 218024 218024 0 0.0
.flash.text 1033904 1033904 0 0.0
.iram0.text 65204 65204 0 0.0
m5stack (read only) 1086511 1086503 -8 -0.0
(read/write) 490788 490788 0 0.0
.dram0.bss 76640 76640 0 0.0
.dram0.data 34152 34152 0 0.0
.flash.rodata 247328 247328 0 0.0
.flash.text 1081127 1081119 -8 -0.0
.iram0.text 123939 123939 0 0.0
k32w light k32w0+release (read/write) 648236 648236 0 0.0
.bss 70712 70712 0 0.0
.data 2068 2068 0 0.0
.text 572728 572728 0 0.0
lock k32w0+release (read/write) 705256 705256 0 0.0
.bss 71160 71160 0 0.0
.data 2076 2076 0 0.0
.text 629292 629292 0 0.0
linux all-clusters-app debug (read only) 3046681 3046681 0 0.0
(read/write) 156064 156064 0 0.0
.bss 61824 61824 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85768 85768 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1176 1176 0 0.0
.rodata 275659 275659 0 0.0
.text 2591586 2591586 0 0.0
all-clusters-minimal-app debug (read only) 2882529 2882529 0 0.0
(read/write) 147664 147664 0 0.0
.bss 61056 61056 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78264 78264 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 275883 275883 0 0.0
.text 2429986 2429986 0 0.0
bridge-app debug+rpc (read only) 2380233 2380233 0 0.0
(read/write) 127752 127752 0 0.0
.bss 50656 50656 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67640 67640 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 832 832 0 0.0
.rodata 204488 204488 0 0.0
.text 2012834 2012834 0 0.0
chip-tool debug (read only) 10956817 10956817 0 0.0
(read/write) 657736 657736 0 0.0
.bss 26072 26072 0 0.0
.data 2690 2690 0 0.0
.data.rel.ro 622456 622456 0 0.0
.dynamic 608 608 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 570261 570261 0 0.0
.text 8865332 8865332 0 0.0
chip-tool-ipv6only arm64 (read only) 10329772 10329772 0 0.0
(read/write) 705601 705601 0 0.0
.bss 33937 33937 0 0.0
.data 2856 2856 0 0.0
.data.rel.ro 649976 649976 0 0.0
.dynamic 560 560 0 0.0
.got 13864 13864 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 499916 499916 0 0.0
.text 8176836 8176836 0 0.0
lighting-app debug+rpc (read only) 2605673 2605673 0 0.0
(read/write) 130536 130536 0 0.0
.bss 49792 49792 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72680 72680 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 221328 221328 0 0.0
.text 2213154 2213154 0 0.0
lock-app debug (read only) 2588641 2588641 0 0.0
(read/write) 125712 125712 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69688 69688 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 238320 238320 0 0.0
.text 2183378 2183378 0 0.0
ota-provider-app debug (read only) 2365929 2365929 0 0.0
(read/write) 119144 119144 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63512 63512 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 210328 210328 0 0.0
.text 1991842 1991842 0 0.0
ota-requestor-app debug (read only) 2531241 2531241 0 0.0
(read/write) 127552 127552 0 0.0
.bss 50368 50368 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68920 68920 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 217120 217120 0 0.0
.text 2141218 2141218 0 0.0
shell debug (read only) 2614969 2614969 0 0.0
(read/write) 142184 142184 0 0.0
.bss 57704 57704 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77376 77376 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1048 1048 0 0.0
.rodata 235762 235762 0 0.0
.text 2220498 2220498 0 0.0
thermostat-no-ble arm64 (read only) 2364388 2364388 0 0.0
(read/write) 141857 141857 0 0.0
.bss 55233 55233 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 76112 76112 0 0.0
.dynamic 560 560 0 0.0
.got 5056 5056 0 0.0
.init 24 24 0 0.0
.init_array 416 416 0 0.0
.rodata 141340 141340 0 0.0
.text 1985008 1985008 0 0.0
tv-app debug (read only) 3198833 3198833 0 0.0
(read/write) 258392 258392 0 0.0
.bss 168152 168152 0 0.0
.data 4144 4144 0 0.0
.data.rel.ro 79520 79520 0 0.0
.dynamic 608 608 0 0.0
.got 4856 4856 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 260552 260552 0 0.0
.text 2747890 2747890 0 0.0
tv-casting-app debug (read only) 5516441 5516441 0 0.0
(read/write) 160888 160888 0 0.0
.bss 52120 52120 0 0.0
.data 1824 1824 0 0.0
.data.rel.ro 100488 100488 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 1048 1048 0 0.0
.rodata 345937 345937 0 0.0
.text 4898194 4898194 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2455112 2455112 0 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417756 1417756 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1181259 1181259 0 0.0
bss 143641 143641 0 0.0
rodata 143564 143564 0 0.0
text 815108 815108 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1160443 1160443 0 0.0
bss 142868 142868 0 0.0
rodata 135156 135156 0 0.0
text 803500 803500 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 841960 841960 0 0.0
(read/write) 1742604 1742604 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188720 188720 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1221517 1221517 0 0.0
.debug_aranges 111736 111736 0 0.0
.debug_frame 373000 373000 0 0.0
.debug_info 26716717 26716717 0 0.0
.debug_line 3657522 3657522 0 0.0
.debug_loc 3573591 3573591 0 0.0
.debug_ranges 338440 338440 0 0.0
.debug_str 3427479 3427479 0 0.0
.heap 841960 841960 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 570615 570615 0 0.0
.symtab 421488 421488 0 0.0
.text 1542832 1542832 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842696 842696 0 0.0
(read/write) 1685804 1685804 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187984 187984 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1213356 1213356 0 0.0
.debug_aranges 111208 111208 0 0.0
.debug_frame 376080 376080 0 0.0
.debug_info 26453339 26453339 0 0.0
.debug_line 3678038 3678038 0 0.0
.debug_loc 3561228 3561228 0 0.0
.debug_ranges 337056 337056 0 0.0
.debug_str 3416484 3416484 0 0.0
.heap 842696 842696 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 535089 535089 0 0.0
.symtab 408080 408080 0 0.0
.text 1486768 1486768 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 850928 850928 0 0.0
(read/write) 1603060 1603060 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 179960 179960 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1048175 1048175 0 0.0
.debug_aranges 103384 103384 0 0.0
.debug_frame 346348 346348 0 0.0
.debug_info 21915511 21915510 -1 -0.0
.debug_line 3248503 3248503 0 0.0
.debug_loc 3259554 3259554 0 0.0
.debug_ranges 302528 302528 0 0.0
.debug_str 3221750 3221750 0 0.0
.heap 850928 850928 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 468388 468388 0 0.0
.symtab 375168 375168 0 0.0
.text 1412256 1412256 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 845896 845896 0 0.0
(read/write) 1640748 1640748 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184976 184976 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1055610 1055610 0 0.0
.debug_aranges 104056 104056 0 0.0
.debug_frame 349176 349176 0 0.0
.debug_info 22295294 22295296 2 0.0
.debug_line 3257324 3257324 0 0.0
.debug_loc 3299408 3299408 0 0.0
.debug_ranges 305872 305872 0 0.0
.debug_str 3249171 3249171 0 0.0
.heap 845896 845896 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 474591 474591 0 0.0
.symtab 378352 378352 0 0.0
.text 1444912 1444912 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1129212 1129220 8 0.0
.bss 106112 106112 0 0.0
.data 1028 1028 0 0.0
.text 576308 576316 8 0.0
lock-app qpg6105+debug (read/write) 1100224 1100224 0 0.0
.bss 102344 102344 0 0.0
.data 1032 1032 0 0.0
.text 547324 547324 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 809156 809156 0 0.0
bss 71344 71344 0 0.0
noinit 43488 43488 0 0.0
text 571568 571570 2 0.0
lighting-app tlsr9518adk80d (read/write) 831072 831072 0 0.0
bss 72200 72200 0 0.0
noinit 43488 43488 0 0.0
text 589696 589696 0 0.0

@yufengwangca
Copy link
Contributor

I stress this this patch yesterday and didn't see the problem, but I am not sure if this patch could address the original issue we hit since it is very hard to reproduce.

From log, it shows the issue is in BLEManagerImpl::SendIndication() and receive error BLE_HS_ENOMEM, this error is still handled as an error with this patch.

@woody-apple woody-apple merged commit 2964bc0 into project-chip:master Sep 7, 2022
@dhrishi
Copy link
Contributor Author

dhrishi commented Sep 7, 2022

From log, it shows the issue is in BLEManagerImpl::SendIndication() and receive error BLE_HS_ENOMEM, this error is still handled as an error with this patch.

Thanks for running the test @yufengwangca. There is a chance that you received no memory error as the previous indications were not acked and they still consumed some memory, while the new one was sent

IMO, even if the issue you encountered is related to something else, this fix is still required :-)

isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…-chip#22446)

The next indication is sent only after the previous one is acked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.0] ESP32 - BLE Indications should be sequential
4 participants