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

[nrfconnect] Fix OTA initialization order #16609

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

Damian-Nordic
Copy link
Contributor

@Damian-Nordic Damian-Nordic commented Mar 24, 2022

Problem

Recent OTA changes impose an assumption that OTA Requestor must be initialized prior to the OTA Requestor driver. Otherwise, the firmware crashes.

Change overview

Move OTA initialization code to a common helper file to reduce code duplication.
Initialize OTA components in the now-expected order.

Testing

Verified nRF Connect apps no longer crash on boot.

@github-actions
Copy link

github-actions bot commented Mar 24, 2022

PR #16609: Size comparison from 07fc8cd to 14cc589

Full report (17 builds for cyw30739, efr32, esp32, k32w, linux, mbed, p6, telink)
platform target config section 07fc8cd 14cc589 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 603578 603578 0 0.0
.app_xip_area 510748 510748 0 0.0
.bss 75576 75576 0 0.0
.data 604 604 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 561366 561366 0 0.0
.app_xip_area 470064 470064 0 0.0
.bss 74080 74080 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 573442 573442 0 0.0
.app_xip_area 472492 472492 0 0.0
.bss 83408 83408 0 0.0
.data 508 508 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 923448 923448 0 0.0
(read/write) 128680 128680 0 0.0
.bss 126680 126680 0 0.0
.data 1996 1996 0 0.0
.text 923440 923440 0 0.0
BRD4161A+rpc (read only) 952272 952272 0 0.0
(read/write) 144632 144632 0 0.0
.bss 142456 142456 0 0.0
.data 2176 2176 0 0.0
.text 952264 952264 0 0.0
window-app BRD4161A (read only) 853236 853236 0 0.0
(read/write) 126648 126648 0 0.0
.bss 124776 124776 0 0.0
.data 1872 1872 0 0.0
.text 853228 853228 0 0.0
esp32 all-clusters-app c3devkit (read only) 964750 964750 0 0.0
(read/write) 1394194 1394194 0 0.0
.dram0.bss 61992 61992 0 0.0
.dram0.data 14212 14212 0 0.0
.flash.rodata 199064 199064 0 0.0
.flash.text 964750 964750 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1021079 1021079 0 0.0
(read/write) 461940 461940 0 0.0
.dram0.bss 67520 67520 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 228560 228560 0 0.0
.flash.text 1015695 1015695 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 701720 701720 0 0.0
.bss 77568 77568 0 0.0
.data 1876 1876 0 0.0
.text 616476 616476 0 0.0
lock k32w061+release (read/write) 701172 701172 0 0.0
.bss 77544 77544 0 0.0
.data 1916 1916 0 0.0
.text 615912 615912 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9830844 9830844 0 0.0
(read/write) 473889 473889 0 0.0
.bss 40769 40769 0 0.0
.data 1144 1144 0 0.0
.data.rel.ro 372312 372312 0 0.0
.dynamic 560 560 0 0.0
.got 55864 55864 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 496452 496452 0 0.0
.text 8280292 8280292 0 0.0
thermostat-no-ble arm64 (read only) 2266140 2266140 0 0.0
(read/write) 148401 148401 0 0.0
.bss 62849 62849 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 77000 77000 0 0.0
.dynamic 560 560 0 0.0
.got 4504 4504 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 139708 139708 0 0.0
.text 1903024 1903024 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2353772 2353772 0 0.0
.bss 184572 184572 0 0.0
.data 5760 5760 0 0.0
.text 1316372 1316372 0 0.0
p6 all-clusters-app default (read/write) 2494952 2494952 0 0.0
.bss 117992 117992 0 0.0
.data 2640 2640 0 0.0
.text 1453216 1453216 0 0.0
light-app default (read/write) 2397312 2397312 0 0.0
.bss 111464 111464 0 0.0
.data 2496 2496 0 0.0
.text 1355576 1355576 0 0.0
lock-app default (read/write) 2360840 2360840 0 0.0
.bss 111208 111208 0 0.0
.data 2456 2456 0 0.0
.text 1319104 1319104 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 897102 897102 0 0.0
bss 87364 87364 0 0.0
noinit 37160 37160 0 0.0
text 634432 634432 0 0.0

Recent OTA changes impose an assumption that OTA Requestor
must be initialized prior to the OTA Requestor driver.

Fix the order and extract OTA requestor initialization to
a common function to reduce code duplication in the future.
@github-actions
Copy link

github-actions bot commented Mar 24, 2022

PR #16609: Size comparison from 6c3f648 to b4a9b10

Increases (2 builds for nrfconnect)
platform target config section 6c3f648 b4a9b10 change % change
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1125251 1125267 16 0.0
nrf5340dk_nrf5340_cpuapp text 704316 704320 4 0.0
Decreases (5 builds for nrfconnect)
platform target config section 6c3f648 b4a9b10 change % change
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1140039 1139663 -376 -0.0
bss 142512 142496 -16 -0.0
text 780764 780376 -388 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 1025639 1025623 -16 -0.0
text 706956 706948 -8 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 934670 934654 -16 -0.0
text 622284 622276 -8 -0.0
pump-app nrf52840dk_nrf52840 text 723032 723024 -8 -0.0
pump-controller-app nrf52840dk_nrf52840 text 709932 709924 -8 -0.0
Full report (35 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 6c3f648 b4a9b10 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 603562 603562 0 0.0
.app_xip_area 510732 510732 0 0.0
.bss 75576 75576 0 0.0
.data 604 604 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 561350 561350 0 0.0
.app_xip_area 470048 470048 0 0.0
.bss 74080 74080 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 573426 573426 0 0.0
.app_xip_area 472476 472476 0 0.0
.bss 83408 83408 0 0.0
.data 508 508 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 923432 923432 0 0.0
(read/write) 128680 128680 0 0.0
.bss 126680 126680 0 0.0
.data 1996 1996 0 0.0
.text 923424 923424 0 0.0
BRD4161A+rpc (read only) 952240 952240 0 0.0
(read/write) 144632 144632 0 0.0
.bss 142456 142456 0 0.0
.data 2176 2176 0 0.0
.text 952232 952232 0 0.0
window-app BRD4161A (read only) 853220 853220 0 0.0
(read/write) 126648 126648 0 0.0
.bss 124776 124776 0 0.0
.data 1872 1872 0 0.0
.text 853212 853212 0 0.0
esp32 all-clusters-app c3devkit (read only) 964804 964804 0 0.0
(read/write) 1394194 1394194 0 0.0
.dram0.bss 61992 61992 0 0.0
.dram0.data 14212 14212 0 0.0
.flash.rodata 199064 199064 0 0.0
.flash.text 964804 964804 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1021107 1021107 0 0.0
(read/write) 461940 461940 0 0.0
.dram0.bss 67520 67520 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 228560 228560 0 0.0
.flash.text 1015723 1015723 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 701704 701704 0 0.0
.bss 77568 77568 0 0.0
.data 1876 1876 0 0.0
.text 616460 616460 0 0.0
lock k32w061+release (read/write) 701156 701156 0 0.0
.bss 77544 77544 0 0.0
.data 1916 1916 0 0.0
.text 615896 615896 0 0.0
linux all-clusters-app debug (read only) 2483153 2483153 0 0.0
(read/write) 143344 143344 0 0.0
.bss 57408 57408 0 0.0
.data 1280 1280 0 0.0
.data.rel.ro 78920 78920 0 0.0
.dynamic 592 592 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 212229 212229 0 0.0
.text 2107202 2107202 0 0.0
bridge-app debug+rpc (read only) 1755461 1755461 0 0.0
(read/write) 89552 89552 0 0.0
.bss 44552 44552 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 37936 37936 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 144300 144300 0 0.0
.text 1495925 1495925 0 0.0
chip-tool debug (read only) 10206533 10206533 0 0.0
(read/write) 355712 355712 0 0.0
.bss 22496 22496 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 326056 326056 0 0.0
.dynamic 608 608 0 0.0
.got 4816 4816 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 518101 518101 0 0.0
.text 8903925 8903925 0 0.0
chip-tool-ipv6only arm64 (read only) 9825308 9825308 0 0.0
(read/write) 473793 473793 0 0.0
.bss 40769 40769 0 0.0
.data 1144 1144 0 0.0
.data.rel.ro 372664 372664 0 0.0
.dynamic 560 560 0 0.0
.got 55416 55416 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 493732 493732 0 0.0
.text 8278148 8278148 0 0.0
door-lock-app debug (read only) 2007345 2007345 0 0.0
(read/write) 116896 116896 0 0.0
.bss 47680 47680 0 0.0
.data 992 992 0 0.0
.data.rel.ro 62840 62840 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 180956 180956 0 0.0
.text 1676706 1676706 0 0.0
lighting-app debug+rpc (read only) 2181289 2181289 0 0.0
(read/write) 123888 123888 0 0.0
.bss 48960 48960 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 174972 174972 0 0.0
.text 1847250 1847250 0 0.0
ota-provider-app debug (read only) 1948393 1948393 0 0.0
(read/write) 112624 112624 0 0.0
.bss 47552 47552 0 0.0
.data 1256 1256 0 0.0
.data.rel.ro 58184 58184 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 166699 166699 0 0.0
.text 1629954 1629954 0 0.0
ota-requestor-app debug (read only) 1975201 1975201 0 0.0
(read/write) 115880 115880 0 0.0
.bss 48544 48544 0 0.0
.data 1480 1480 0 0.0
.data.rel.ro 60408 60408 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 162692 162692 0 0.0
.text 1659858 1659858 0 0.0
shell debug (read only) 2431945 2431945 0 0.0
(read/write) 147400 147400 0 0.0
.bss 67336 67336 0 0.0
.data 800 800 0 0.0
.data.rel.ro 73568 73568 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 209682 209682 0 0.0
.text 2065394 2065394 0 0.0
thermostat-no-ble arm64 (read only) 2266140 2266140 0 0.0
(read/write) 148385 148385 0 0.0
.bss 62833 62833 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 77000 77000 0 0.0
.dynamic 560 560 0 0.0
.got 4504 4504 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 139708 139708 0 0.0
.text 1903024 1903024 0 0.0
tv-app debug (read only) 2681737 2681737 0 0.0
(read/write) 247872 247872 0 0.0
.bss 164512 164512 0 0.0
.data 3136 3136 0 0.0
.data.rel.ro 74160 74160 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 206933 206933 0 0.0
.text 2299906 2299906 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2353772 2353772 0 0.0
.bss 184572 184572 0 0.0
.data 5760 5760 0 0.0
.text 1316372 1316372 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1140039 1139663 -376 -0.0
bss 142512 142496 -16 -0.0
rodata 141912 141912 0 0.0
text 780764 780376 -388 -0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1125251 1125267 16 0.0
bss 138952 138952 0 0.0
rodata 118636 118636 0 0.0
text 789140 789140 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 1089019 1089019 0 0.0
bss 139188 139188 0 0.0
rodata 109876 109876 0 0.0
text 760960 760960 0 0.0
nrf52840dongle_nrf52840 (read/write) 1139319 1139319 0 0.0
bss 139940 139940 0 0.0
rodata 118468 118468 0 0.0
text 791412 791412 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1034034 1034034 0 0.0
bss 136016 136016 0 0.0
rodata 111832 111832 0 0.0
text 704316 704320 4 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1025639 1025623 -16 -0.0
bss 128900 128900 0 0.0
rodata 111352 111352 0 0.0
text 706956 706948 -8 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 934670 934654 -16 -0.0
bss 125996 125996 0 0.0
rodata 104604 104604 0 0.0
text 622284 622276 -8 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 1043643 1043643 0 0.0
bss 128812 128812 0 0.0
rodata 113292 113292 0 0.0
text 723032 723024 -8 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1026851 1026851 0 0.0
bss 128560 128560 0 0.0
rodata 109860 109860 0 0.0
text 709932 709924 -8 -0.0
p6 all-clusters-app default (read/write) 2494984 2494984 0 0.0
.bss 117992 117992 0 0.0
.data 2640 2640 0 0.0
.text 1453248 1453248 0 0.0
light-app default (read/write) 2397360 2397360 0 0.0
.bss 111464 111464 0 0.0
.data 2496 2496 0 0.0
.text 1355624 1355624 0 0.0
lock-app default (read/write) 2360888 2360888 0 0.0
.bss 111208 111208 0 0.0
.data 2456 2456 0 0.0
.text 1319152 1319152 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 896606 896606 0 0.0
bss 87356 87356 0 0.0
noinit 37160 37160 0 0.0
text 633984 633984 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit a49813a into project-chip:master Mar 25, 2022
rochaferraz pushed a commit to rochaferraz/connectedhomeip that referenced this pull request Mar 31, 2022
Recent OTA changes impose an assumption that OTA Requestor
must be initialized prior to the OTA Requestor driver.

Fix the order and extract OTA requestor initialization to
a common function to reduce code duplication in the future.
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
Recent OTA changes impose an assumption that OTA Requestor
must be initialized prior to the OTA Requestor driver.

Fix the order and extract OTA requestor initialization to
a common function to reduce code duplication in the future.
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.

Nordic board with lighting example app doesn't power up - ZEPHYR FATAL ERROR 0
4 participants