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

ESP: Add chip shell engine initializing for esp32 platform #13364

Merged

Conversation

wqx6
Copy link
Contributor

@wqx6 wqx6 commented Jan 7, 2022

Problem

The chip shell engine initializing was missing for esp32 platform. It cause a stack overflow for chip shell task.

Change overview

And chip shell engine initializing.

Testing

Test with all-clusters-app.

@dhrishi
Copy link
Contributor

dhrishi commented Jan 7, 2022

#13060 It seems this PR causes the increase of stack use.

Ok. We should also check the high watermark for the stack (if not already done) and accordingly increase the size

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

PR #13364: Size comparison from b81facc to a22bdbf

Increases (1 build for esp32)
platform target config section b81facc a22bdbf change % change
esp32 all-clusters-app m5stack (read only) 946699 946703 4 0.0
.flash.text 941315 941319 4 0.0
Full report (31 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section b81facc a22bdbf change % change
efr32 lighting-app BRD4161A (read only) 830576 830576 0 0.0
(read/write) 127096 127096 0 0.0
.bss 125216 125216 0 0.0
.data 1876 1876 0 0.0
.text 830568 830568 0 0.0
BRD4161A+rpc (read only) 817772 817772 0 0.0
(read/write) 143752 143752 0 0.0
.bss 141776 141776 0 0.0
.data 1976 1976 0 0.0
.text 817764 817764 0 0.0
window-app BRD4161A (read only) 804024 804024 0 0.0
(read/write) 126032 126032 0 0.0
.bss 124200 124200 0 0.0
.data 1832 1832 0 0.0
.text 804016 804016 0 0.0
esp32 all-clusters-app c3devkit (read only) 891298 891298 0 0.0
(read/write) 1314178 1314178 0 0.0
.dram0.bss 69552 69552 0 0.0
.dram0.data 14236 14236 0 0.0
.flash.rodata 177336 177336 0 0.0
.flash.text 891298 891298 0 0.0
.iram0.text 62254 62254 0 0.0
m5stack (read only) 946699 946703 4 0.0
(read/write) 440928 440928 0 0.0
.dram0.bss 72232 72232 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 203624 203624 0 0.0
.flash.text 941315 941319 4 0.0
.iram0.text 122671 122671 0 0.0
k32w light k32w061+release (read/write) 649288 649288 0 0.0
.bss 76240 76240 0 0.0
.data 1904 1904 0 0.0
.text 565344 565344 0 0.0
lock k32w061+release (read/write) 634104 634104 0 0.0
.bss 75944 75944 0 0.0
.data 1860 1860 0 0.0
.text 550500 550500 0 0.0
linux chip-tool-ipv6only arm64 (read only) 7033996 7033996 0 0.0
(read/write) 325073 325073 0 0.0
.bss 54241 54241 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 209064 209064 0 0.0
.dynamic 560 560 0 0.0
.got 56992 56992 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 384292 384292 0 0.0
.text 5956932 5956932 0 0.0
thermostat-no-ble arm64 (read only) 2026956 2026956 0 0.0
(read/write) 144193 144193 0 0.0
.bss 64033 64033 0 0.0
.data 880 880 0 0.0
.data.rel.ro 72392 72392 0 0.0
.dynamic 560 560 0 0.0
.got 3952 3952 0 0.0
.init 24 24 0 0.0
.init_array 296 296 0 0.0
.rodata 128844 128844 0 0.0
.text 1685200 1685200 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2348264 2348264 0 0.0
.bss 188812 188812 0 0.0
.data 5312 5312 0 0.0
.text 1310840 1310840 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2330160 2330160 0 0.0
.bss 180632 180632 0 0.0
.data 5552 5552 0 0.0
.text 1292760 1292760 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2303312 2303312 0 0.0
.bss 179680 179680 0 0.0
.data 5544 5544 0 0.0
.text 1265912 1265912 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2054200 2054200 0 0.0
.bss 156972 156972 0 0.0
.data 4864 4864 0 0.0
.text 1016800 1016800 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 936687 936687 0 0.0
bss 118208 118208 0 0.0
rodata 108220 108220 0 0.0
text 632700 632700 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 922147 922147 0 0.0
bss 115252 115252 0 0.0
rodata 100664 100664 0 0.0
text 628052 628052 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 847666 847666 0 0.0
bss 116100 116100 0 0.0
rodata 101396 101396 0 0.0
text 549640 549640 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 908831 908831 0 0.0
bss 117396 117396 0 0.0
rodata 103492 103492 0 0.0
text 610576 610576 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 820006 820006 0 0.0
bss 115316 115316 0 0.0
rodata 96720 96720 0 0.0
text 527552 527552 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541835 541835 0 0.0
bss 52588 52588 0 0.0
rodata 50104 50104 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 910111 910111 0 0.0
bss 117156 117156 0 0.0
rodata 103708 103708 0 0.0
text 611788 611788 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 906911 906911 0 0.0
bss 117184 117184 0 0.0
rodata 102964 102964 0 0.0
text 609324 609324 0 0.0
shell nrf52840dk_nrf52840 (read/write) 797543 797543 0 0.0
bss 109680 109680 0 0.0
rodata 78188 78188 0 0.0
text 533180 533180 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 710362 710362 0 0.0
bss 107568 107568 0 0.0
rodata 72492 72492 0 0.0
text 450860 450860 0 0.0
p6 all-clusters-app default (read/write) 2403672 2403672 0 0.0
.bss 117020 117020 0 0.0
.data 2592 2592 0 0.0
.text 1361936 1361936 0 0.0
light-app default (read/write) 2325656 2325656 0 0.0
.bss 105888 105888 0 0.0
.data 2384 2384 0 0.0
.text 1283920 1283920 0 0.0
lock-app default (read/write) 2297856 2297856 0 0.0
.bss 104768 104768 0 0.0
.data 2336 2336 0 0.0
.text 1256120 1256120 0 0.0
qpg lighting-app qpg6105+debug (read only) 532452 532452 0 0.0
(read/write) 146936 146936 0 0.0
.bss 86696 86696 0 0.0
.data 1004 1004 0 0.0
.text 527132 527132 0 0.0
lock-app qpg6105+debug (read only) 504232 504232 0 0.0
(read/write) 146940 146940 0 0.0
.bss 85832 85832 0 0.0
.data 952 952 0 0.0
.text 498912 498912 0 0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 834110 834110 0 0.0
bss 87020 87020 0 0.0
noinit 37160 37160 0 0.0
text 582188 582188 0 0.0

@wqx6 wqx6 force-pushed the increase_stack_size_for_chip_shell branch from a22bdbf to ca94852 Compare January 7, 2022 11:18
@github-actions
Copy link

github-actions bot commented Jan 7, 2022

PR #13364: Size comparison from b81facc to ca94852

Full report (4 builds for qpg, telink)
platform target config section b81facc ca94852 change % change
qpg lighting-app qpg6105+debug (read only) 532452 532452 0 0.0
(read/write) 146936 146936 0 0.0
.bss 86696 86696 0 0.0
.data 1004 1004 0 0.0
.text 527132 527132 0 0.0
lock-app qpg6105+debug (read only) 504232 504232 0 0.0
(read/write) 146940 146940 0 0.0
.bss 85832 85832 0 0.0
.data 952 952 0 0.0
.text 498912 498912 0 0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 834110 834110 0 0.0
bss 87020 87020 0 0.0
noinit 37160 37160 0 0.0
text 582188 582188 0 0.0

@wqx6 wqx6 force-pushed the increase_stack_size_for_chip_shell branch from ca94852 to 2dd7af0 Compare January 7, 2022 11:43
@wqx6 wqx6 changed the title ESP:Increase chip shell task stack size for esp32 platform ESP: Add chip shell engine initializing for esp32 platform Jan 7, 2022
@wqx6
Copy link
Contributor Author

wqx6 commented Jan 7, 2022

#13060 It seems this PR causes the increase of stack use.

Ok. We should also check the high watermark for the stack (if not already done) and accordingly increase the size

Seems the stack overflow is caused by the missing of chip shell engine initializing. I have changed the describe of this PR.

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

PR #13364: Size comparison from b81facc to 2dd7af0

Increases above 0.2%:

platform target config section b81facc 2dd7af0 change % change
esp32 all-clusters-app m5stack (read only) 946699 951223 4524 0.5
(read/write) 440928 445744 4816 1.1
.dram0.bss 72232 74048 1816 2.5
.flash.rodata 203624 206624 3000 1.5
.flash.text 941315 945839 4524 0.5
Increases (1 build for esp32)
platform target config section b81facc 2dd7af0 change % change
esp32 all-clusters-app m5stack (read only) 946699 951223 4524 0.5
(read/write) 440928 445744 4816 1.1
.dram0.bss 72232 74048 1816 2.5
.flash.rodata 203624 206624 3000 1.5
.flash.text 941315 945839 4524 0.5
Full report (31 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section b81facc 2dd7af0 change % change
efr32 lighting-app BRD4161A (read only) 830576 830576 0 0.0
(read/write) 127096 127096 0 0.0
.bss 125216 125216 0 0.0
.data 1876 1876 0 0.0
.text 830568 830568 0 0.0
BRD4161A+rpc (read only) 817772 817772 0 0.0
(read/write) 143752 143752 0 0.0
.bss 141776 141776 0 0.0
.data 1976 1976 0 0.0
.text 817764 817764 0 0.0
window-app BRD4161A (read only) 804024 804024 0 0.0
(read/write) 126032 126032 0 0.0
.bss 124200 124200 0 0.0
.data 1832 1832 0 0.0
.text 804016 804016 0 0.0
esp32 all-clusters-app c3devkit (read only) 891298 891298 0 0.0
(read/write) 1314178 1314178 0 0.0
.dram0.bss 69552 69552 0 0.0
.dram0.data 14236 14236 0 0.0
.flash.rodata 177336 177336 0 0.0
.flash.text 891298 891298 0 0.0
.iram0.text 62254 62254 0 0.0
m5stack (read only) 946699 951223 4524 0.5
(read/write) 440928 445744 4816 1.1
.dram0.bss 72232 74048 1816 2.5
.dram0.data 34064 34064 0 0.0
.flash.rodata 203624 206624 3000 1.5
.flash.text 941315 945839 4524 0.5
.iram0.text 122671 122671 0 0.0
k32w light k32w061+release (read/write) 649288 649288 0 0.0
.bss 76240 76240 0 0.0
.data 1904 1904 0 0.0
.text 565344 565344 0 0.0
lock k32w061+release (read/write) 634104 634104 0 0.0
.bss 75944 75944 0 0.0
.data 1860 1860 0 0.0
.text 550500 550500 0 0.0
linux chip-tool-ipv6only arm64 (read only) 7033996 7033996 0 0.0
(read/write) 325073 325073 0 0.0
.bss 54241 54241 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 209064 209064 0 0.0
.dynamic 560 560 0 0.0
.got 56992 56992 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 384292 384292 0 0.0
.text 5956932 5956932 0 0.0
thermostat-no-ble arm64 (read only) 2026956 2026956 0 0.0
(read/write) 144193 144193 0 0.0
.bss 64033 64033 0 0.0
.data 880 880 0 0.0
.data.rel.ro 72392 72392 0 0.0
.dynamic 560 560 0 0.0
.got 3952 3952 0 0.0
.init 24 24 0 0.0
.init_array 296 296 0 0.0
.rodata 128844 128844 0 0.0
.text 1685200 1685200 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2348264 2348264 0 0.0
.bss 188812 188812 0 0.0
.data 5312 5312 0 0.0
.text 1310840 1310840 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2330160 2330160 0 0.0
.bss 180632 180632 0 0.0
.data 5552 5552 0 0.0
.text 1292760 1292760 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2303312 2303312 0 0.0
.bss 179680 179680 0 0.0
.data 5544 5544 0 0.0
.text 1265912 1265912 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2054200 2054200 0 0.0
.bss 156972 156972 0 0.0
.data 4864 4864 0 0.0
.text 1016800 1016800 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 936687 936687 0 0.0
bss 118208 118208 0 0.0
rodata 108220 108220 0 0.0
text 632700 632700 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 922147 922147 0 0.0
bss 115252 115252 0 0.0
rodata 100664 100664 0 0.0
text 628052 628052 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 847666 847666 0 0.0
bss 116100 116100 0 0.0
rodata 101396 101396 0 0.0
text 549640 549640 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 908831 908831 0 0.0
bss 117396 117396 0 0.0
rodata 103492 103492 0 0.0
text 610576 610576 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 820006 820006 0 0.0
bss 115316 115316 0 0.0
rodata 96720 96720 0 0.0
text 527552 527552 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541835 541835 0 0.0
bss 52588 52588 0 0.0
rodata 50104 50104 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 910111 910111 0 0.0
bss 117156 117156 0 0.0
rodata 103708 103708 0 0.0
text 611788 611788 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 906911 906911 0 0.0
bss 117184 117184 0 0.0
rodata 102964 102964 0 0.0
text 609324 609324 0 0.0
shell nrf52840dk_nrf52840 (read/write) 797543 797543 0 0.0
bss 109680 109680 0 0.0
rodata 78188 78188 0 0.0
text 533180 533180 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 710362 710362 0 0.0
bss 107568 107568 0 0.0
rodata 72492 72492 0 0.0
text 450860 450860 0 0.0
p6 all-clusters-app default (read/write) 2403672 2403672 0 0.0
.bss 117020 117020 0 0.0
.data 2592 2592 0 0.0
.text 1361936 1361936 0 0.0
light-app default (read/write) 2325656 2325656 0 0.0
.bss 105888 105888 0 0.0
.data 2384 2384 0 0.0
.text 1283920 1283920 0 0.0
lock-app default (read/write) 2297856 2297856 0 0.0
.bss 104768 104768 0 0.0
.data 2336 2336 0 0.0
.text 1256120 1256120 0 0.0
qpg lighting-app qpg6105+debug (read only) 532452 532452 0 0.0
(read/write) 146936 146936 0 0.0
.bss 86696 86696 0 0.0
.data 1004 1004 0 0.0
.text 527132 527132 0 0.0
lock-app qpg6105+debug (read only) 504232 504232 0 0.0
(read/write) 146940 146940 0 0.0
.bss 85832 85832 0 0.0
.data 952 952 0 0.0
.text 498912 498912 0 0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 834110 834110 0 0.0
bss 87020 87020 0 0.0
noinit 37160 37160 0 0.0
text 582188 582188 0 0.0

@dhrishi
Copy link
Contributor

dhrishi commented Jan 7, 2022

@wqx6 @shubhamdp Will it cause issues in all the ESP32 examples that use the shell?

If yes, should we fastrack it @andy31415 ?

@andy31415
Copy link
Contributor

ToT is broken, #13368 attempts to fix. We can fast track this, but it also has sufficient checkmarks to merge (except CI will not pass due to ToT failure)

@andy31415 andy31415 merged commit 0e5bc69 into project-chip:master Jan 7, 2022
@andy31415
Copy link
Contributor

I admin merged - darwin failure is not caused by this PR and the PR passed ESP32 CI.

@lmpprk
Copy link
Contributor

lmpprk commented Jan 7, 2022

Has this PR broken the ESP32 workflow?

2022-01-07 15:22:04 INFO    /__w/connectedhomeip/connectedhomeip/examples/all-clusters-app/esp32/third_party/connectedhomeip/examples/platform/esp32/shell_extension/launch.cpp:40:33: error: 'class chip::Shell::Engine' has no member named 'Init'
2022-01-07 15:22:04 INFO         chip::Shell::Engine::Root().Init();
2022-01-07 15:22:04 INFO                                     ^~~~

@mlepage-google
Copy link
Contributor

Yes, I see it has broken CI for ESP32 on other PRs, with the same error. E.g.:
https://github.com/project-chip/connectedhomeip/runs/4740233314

andy31415 added a commit to andy31415/connectedhomeip that referenced this pull request Jan 7, 2022
turon pushed a commit to turon/connectedhomeip that referenced this pull request Jan 7, 2022
turon pushed a commit to turon/connectedhomeip that referenced this pull request Jan 7, 2022
turon added a commit that referenced this pull request Jan 7, 2022
* [shell] Add command to start/stop zcl app server.

- Add 'server port' and 'server udcport' commands.
- Add 'server sessions' command.
- Add 'server endpoints' and 'server clusters' commands.

- Add docs for the new 'server' command subcommands (README_SERVER.md).
- Add 'server' command to build of linux and mac platforms only initially.

- Improve clean exit paths for 'server' command.
- Update 'ForEachSessionHandle' to use new Loop construct.
- Fix build failure in ota-provider (warning when logs disabled).

* [shell] Correct order of atexit and shutdown handling.

* [shell] Add OTA stubs.

* Apply suggestions from code review

Co-authored-by: Łukasz Duda <[email protected]>

* [session] Update ForEachSessionHandle to new API.

- Revert erroneous shutdown protection in Server.cpp
- Add app-level shutdown protection in cmd_server.cpp

* Bugfix: Add chip shell engine initializing for esp32 platform (#13364)

* [shell] Code review fixes.

Co-authored-by: Łukasz Duda <[email protected]>
Co-authored-by: Wang Qixiang <[email protected]>
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 2022
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 2022
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 2022
* [shell] Add command to start/stop zcl app server.

- Add 'server port' and 'server udcport' commands.
- Add 'server sessions' command.
- Add 'server endpoints' and 'server clusters' commands.

- Add docs for the new 'server' command subcommands (README_SERVER.md).
- Add 'server' command to build of linux and mac platforms only initially.

- Improve clean exit paths for 'server' command.
- Update 'ForEachSessionHandle' to use new Loop construct.
- Fix build failure in ota-provider (warning when logs disabled).

* [shell] Correct order of atexit and shutdown handling.

* [shell] Add OTA stubs.

* Apply suggestions from code review

Co-authored-by: Łukasz Duda <[email protected]>

* [session] Update ForEachSessionHandle to new API.

- Revert erroneous shutdown protection in Server.cpp
- Add app-level shutdown protection in cmd_server.cpp

* Bugfix: Add chip shell engine initializing for esp32 platform (project-chip#13364)

* [shell] Code review fixes.

Co-authored-by: Łukasz Duda <[email protected]>
Co-authored-by: Wang Qixiang <[email protected]>
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.

8 participants