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

[zephyr] BootReasons and NetworkInterfaces fixes #16530

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

Damian-Nordic
Copy link
Contributor

Problem

BootReasons attribute of GeneralDiagnostics returns wrong values on Zephyr platform. Also, SoftwareUpdateCompleted boot reason is not implemented.

Change overview

  1. Fix BootReasons attribute of GeneralDiagnostics cluster:
  • Make sure hwinfo_get_reset_cause() is called once per boot and is immediately followed by hwinfo_clear_reset_cause() since the reset cause is accumulated between subsequent resets.
  • Add support for SoftwareUpdateCompleted boot reason.
  • Reduce the scope of reasons classified as SoftwareReset.
  1. Add a missing bound check to the NetworkInterfaces attribute provider and always assume that Zephyr's net_if API is available.

Testing

Verified that the attribute on nRF Connect Lock App returns consistent and correct values in different circumstances, such as:

  • Power On/Pin reset
  • Software reset
  • Software update

1. Fix BootReasons attribute of GeneralDiagnostics cluster:
 - Make sure hwinfo_get_reset_cause() is called once per
   boot and is immediately followed by
   hwinfo_clear_reset_cause() since the reset cause is
   accumulated between subsequent resets.
 - Add support for SoftwareUpdateCompleted boot reason.
 - Reduce the scope of reasons classified as SoftwareReset.

2. Add a missing bound check to the NetworkInterfaces attribute
   provider and always assume that Zephyr's net_if API is
   available.
@github-actions
Copy link

github-actions bot commented Mar 22, 2022

PR #16530: Size comparison from 2e658fb to 2863c0d

Increases (10 builds for nrfconnect, telink)
platform target config section 2e658fb 2863c0d change % change
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1155987 1156035 48 0.0
bss 146716 146736 20 0.0
rodata 145956 145972 16 0.0
text 788148 788192 44 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1142603 1142651 48 0.0
bss 143160 143180 20 0.0
rodata 123612 123628 16 0.0
text 796992 797036 44 0.0
nrf52840dk_nrf52840+rpc (read/write) 1091199 1091263 64 0.0
bss 139244 139264 20 0.0
rodata 111200 111216 16 0.0
text 761812 761872 60 0.0
nrf52840dongle_nrf52840 (read/write) 1155079 1155111 32 0.0
bss 144152 144172 20 0.0
rodata 122292 122308 16 0.0
text 798828 798864 36 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1048574 1048654 80 0.0
bss 140224 140244 20 0.0
rodata 115756 115772 16 0.0
text 710688 710736 48 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1042763 1042939 176 0.0
bss 133108 133128 20 0.0
rodata 116276 116292 16 0.0
text 714772 714816 44 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 949138 949222 84 0.0
bss 130204 130224 20 0.0
rodata 108472 108492 20 0.0
text 628624 628672 48 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1060931 1060963 32 0.0
bss 133020 133040 20 0.0
rodata 118220 118236 16 0.0
text 730872 730916 44 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1044167 1044199 32 0.0
bss 132768 132788 20 0.0
rodata 114800 114816 16 0.0
text 717784 717828 44 0.0
telink lighting-app tlsr9518adk80d (read/write) 895830 895922 92 0.0
bss 87424 87444 20 0.0
text 633404 633462 58 0.0
Full report (35 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 2e658fb 2863c0d change % change
cyw30739 light cyw930739m2evb_01 (read/write) 603870 603870 0 0.0
.app_xip_area 510968 510968 0 0.0
.bss 75656 75656 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 561658 561658 0 0.0
.app_xip_area 470284 470284 0 0.0
.bss 74160 74160 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 571494 571494 0 0.0
.app_xip_area 470472 470472 0 0.0
.bss 83488 83488 0 0.0
.data 500 500 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 922008 922008 0 0.0
(read/write) 128760 128760 0 0.0
.bss 126768 126768 0 0.0
.data 1988 1988 0 0.0
.text 922000 922000 0 0.0
BRD4161A+rpc (read only) 950820 950820 0 0.0
(read/write) 144712 144712 0 0.0
.bss 142544 142544 0 0.0
.data 2168 2168 0 0.0
.text 950812 950812 0 0.0
window-app BRD4161A (read only) 852384 852384 0 0.0
(read/write) 126720 126720 0 0.0
.bss 124856 124856 0 0.0
.data 1864 1864 0 0.0
.text 852376 852376 0 0.0
esp32 all-clusters-app c3devkit (read only) 963776 963776 0 0.0
(read/write) 1393690 1393690 0 0.0
.dram0.bss 62072 62072 0 0.0
.dram0.data 14188 14188 0 0.0
.flash.rodata 198512 198512 0 0.0
.flash.text 963776 963776 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1020319 1020319 0 0.0
(read/write) 461460 461460 0 0.0
.dram0.bss 67592 67592 0 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 228016 228016 0 0.0
.flash.text 1014935 1014935 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 701092 701092 0 0.0
.bss 77656 77656 0 0.0
.data 1868 1868 0 0.0
.text 615768 615768 0 0.0
lock k32w061+release (read/write) 700964 700964 0 0.0
.bss 77624 77624 0 0.0
.data 1908 1908 0 0.0
.text 615632 615632 0 0.0
linux all-clusters-app debug (read only) 2477089 2477089 0 0.0
(read/write) 143152 143152 0 0.0
.bss 57312 57312 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 78840 78840 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 212005 212005 0 0.0
.text 2101634 2101634 0 0.0
bridge-app debug+rpc (read only) 1752637 1752637 0 0.0
(read/write) 89424 89424 0 0.0
.bss 44456 44456 0 0.0
.data 1952 1952 0 0.0
.data.rel.ro 37944 37944 0 0.0
.dynamic 592 592 0 0.0
.got 3920 3920 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 144684 144684 0 0.0
.text 1492741 1492741 0 0.0
chip-tool debug (read only) 10145893 10145893 0 0.0
(read/write) 354848 354848 0 0.0
.bss 22304 22304 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 325408 325408 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 517813 517813 0 0.0
.text 8845477 8845477 0 0.0
chip-tool-ipv6only arm64 (read only) 9769404 9769404 0 0.0
(read/write) 472689 472689 0 0.0
.bss 40609 40609 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 371824 371824 0 0.0
.dynamic 560 560 0 0.0
.got 55328 55328 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 493604 493604 0 0.0
.text 8224436 8224436 0 0.0
door-lock-app debug (read only) 2004473 2004473 0 0.0
(read/write) 116832 116832 0 0.0
.bss 47584 47584 0 0.0
.data 992 992 0 0.0
.data.rel.ro 62856 62856 0 0.0
.dynamic 592 592 0 0.0
.got 4120 4120 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 181180 181180 0 0.0
.text 1673634 1673634 0 0.0
lighting-app debug+rpc (read only) 2178137 2178137 0 0.0
(read/write) 123792 123792 0 0.0
.bss 48864 48864 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 67928 67928 0 0.0
.dynamic 608 608 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 175484 175484 0 0.0
.text 1843634 1843634 0 0.0
ota-provider-app debug (read only) 1938833 1938833 0 0.0
(read/write) 112624 112624 0 0.0
.bss 47488 47488 0 0.0
.data 1288 1288 0 0.0
.data.rel.ro 58200 58200 0 0.0
.dynamic 608 608 0 0.0
.got 4376 4376 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 166571 166571 0 0.0
.text 1620498 1620498 0 0.0
ota-requestor-app debug (read only) 1969001 1969001 0 0.0
(read/write) 115592 115592 0 0.0
.bss 48480 48480 0 0.0
.data 1416 1416 0 0.0
.data.rel.ro 60264 60264 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 162980 162980 0 0.0
.text 1654034 1654034 0 0.0
shell debug (read only) 2426433 2426433 0 0.0
(read/write) 147208 147208 0 0.0
.bss 67240 67240 0 0.0
.data 784 784 0 0.0
.data.rel.ro 73472 73472 0 0.0
.dynamic 592 592 0 0.0
.got 4152 4152 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 209426 209426 0 0.0
.text 2060306 2060306 0 0.0
thermostat-no-ble arm64 (read only) 2262500 2262500 0 0.0
(read/write) 148273 148273 0 0.0
.bss 62753 62753 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 77000 77000 0 0.0
.dynamic 560 560 0 0.0
.got 4480 4480 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 140036 140036 0 0.0
.text 1899152 1899152 0 0.0
tv-app debug (read only) 2677657 2677657 0 0.0
(read/write) 247712 247712 0 0.0
.bss 164384 164384 0 0.0
.data 3104 3104 0 0.0
.data.rel.ro 74168 74168 0 0.0
.dynamic 592 592 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 207413 207413 0 0.0
.text 2295394 2295394 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2353452 2353452 0 0.0
.bss 184652 184652 0 0.0
.data 5752 5752 0 0.0
.text 1316052 1316052 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1155987 1156035 48 0.0
bss 146716 146736 20 0.0
rodata 145956 145972 16 0.0
text 788148 788192 44 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1142603 1142651 48 0.0
bss 143160 143180 20 0.0
rodata 123612 123628 16 0.0
text 796992 797036 44 0.0
nrf52840dk_nrf52840+rpc (read/write) 1091199 1091263 64 0.0
bss 139244 139264 20 0.0
rodata 111200 111216 16 0.0
text 761812 761872 60 0.0
nrf52840dongle_nrf52840 (read/write) 1155079 1155111 32 0.0
bss 144152 144172 20 0.0
rodata 122292 122308 16 0.0
text 798828 798864 36 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1048574 1048654 80 0.0
bss 140224 140244 20 0.0
rodata 115756 115772 16 0.0
text 710688 710736 48 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1042763 1042939 176 0.0
bss 133108 133128 20 0.0
rodata 116276 116292 16 0.0
text 714772 714816 44 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 949138 949222 84 0.0
bss 130204 130224 20 0.0
rodata 108472 108492 20 0.0
text 628624 628672 48 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1060931 1060963 32 0.0
bss 133020 133040 20 0.0
rodata 118220 118236 16 0.0
text 730872 730916 44 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1044167 1044199 32 0.0
bss 132768 132788 20 0.0
rodata 114800 114816 16 0.0
text 717784 717828 44 0.0
p6 all-clusters-app default (read/write) 2492976 2492976 0 0.0
.bss 118072 118072 0 0.0
.data 2632 2632 0 0.0
.text 1451240 1451240 0 0.0
light-app default (read/write) 2396376 2396376 0 0.0
.bss 111544 111544 0 0.0
.data 2488 2488 0 0.0
.text 1354640 1354640 0 0.0
lock-app default (read/write) 2359928 2359928 0 0.0
.bss 111288 111288 0 0.0
.data 2448 2448 0 0.0
.text 1318192 1318192 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 895830 895922 92 0.0
bss 87424 87444 20 0.0
noinit 37160 37160 0 0.0
text 633404 633462 58 0.0

@Damian-Nordic Damian-Nordic merged commit fc6595a into project-chip:master Mar 23, 2022
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
1. Fix BootReasons attribute of GeneralDiagnostics cluster:
 - Make sure hwinfo_get_reset_cause() is called once per
   boot and is immediately followed by
   hwinfo_clear_reset_cause() since the reset cause is
   accumulated between subsequent resets.
 - Add support for SoftwareUpdateCompleted boot reason.
 - Reduce the scope of reasons classified as SoftwareReset.

2. Add a missing bound check to the NetworkInterfaces attribute
   provider and always assume that Zephyr's net_if API is
   available.
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.

3 participants