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

[ota] Automatic NotifyUpdateApplied #16103

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Conversation

Damian-Nordic
Copy link
Contributor

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

Problem

NotifyUpdateApplied command is not sent automatically.

Change overview

Add two methods to OTAImageProcessor:

  • IsFirstImageRun() to determine if the currently running image is executed for the first time
  • ConfirmCurrentImage() to confirm that the current image is stable and the update can be left permanently.

Add storing and loading the current provider and the update token in OTARequestor.
Then extend GenericOTARequestorDriver to automatically confirm the current image and send NotifyUpdateApplied
command to the last provider.
Fixes #15404

Testing

Tested on nRF Connect platform that the full OTA succeeds and NotifyUpdateApplied is sent after applying an update.

Add two methods to OTAImageProcessor:
- IsFirstImageRun() to determine if the currently running
  image is executed for the first time
- ConfirmCurrentImage() to confirm that the current image
  is stable and the update can be left permanently.

Add storing and loading the current provider and the
update token in OTARequestor.

Then extend GenericOTARequestorDriver to automatically
confirm the current image and send NotifyUpdateApplied
command to the last provider.
@github-actions
Copy link

github-actions bot commented Mar 11, 2022

PR #16103: Size comparison from ae514b6 to d80e54c

Increases above 0.2%:

platform target config section ae514b6 d80e54c change % change
nrfconnect lighting-app nrf52840dk_nrf52840+rpc rodata 109700 109920 220 0.2
Increases (15 builds for cyw30739, efr32, k32w, mbed, nrfconnect)
platform target config section ae514b6 d80e54c change % change
cyw30739 ota-requestor cyw930739m2evb_01 (read/write) 566766 567102 336 0.1
.app_xip_area 466228 466564 336 0.1
efr32 lighting-app BRD4161A (read only) 921128 921480 352 0.0
.text 921120 921472 352 0.0
BRD4161A+rpc (read only) 949940 950308 368 0.0
.text 949932 950300 368 0.0
k32w light k32w061+release (read/write) 695388 695748 360 0.1
.text 610548 610908 360 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2456368 2456608 240 0.0
.text 1418940 1419180 240 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2417768 2418008 240 0.0
.text 1380340 1380580 240 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2344000 2344232 232 0.0
.text 1306572 1306804 232 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152643 1153019 376 0.0
rodata 144516 144588 72 0.0
text 786676 786988 312 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1139367 1139727 360 0.0
rodata 122272 122344 72 0.1
text 795508 795796 288 0.0
nrf52840dk_nrf52840+rpc (read/write) 1086395 1087383 988 0.1
rodata 109700 109920 220 0.2
text 758912 759676 764 0.1
nrf5340dk_nrf5340_cpuapp (read/write) 1042562 1042922 360 0.0
rodata 114392 114464 72 0.1
text 706528 706816 288 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1039623 1039983 360 0.0
rodata 114936 115008 72 0.1
text 713368 713656 288 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 943194 943550 356 0.0
rodata 107112 107180 68 0.1
text 624536 624824 288 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1057647 1058007 360 0.0
rodata 116880 116952 72 0.1
text 729476 729764 288 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1040899 1041259 360 0.0
rodata 113460 113532 72 0.1
text 716400 716688 288 0.0
Full report (29 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section ae514b6 d80e54c change % change
cyw30739 light cyw930739m2evb_01 (read/write) 599102 599102 0 0.0
.app_xip_area 506700 506700 0 0.0
.bss 75108 75108 0 0.0
.data 640 640 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 556986 556986 0 0.0
.app_xip_area 466112 466112 0 0.0
.bss 73612 73612 0 0.0
.data 604 604 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 566766 567102 336 0.1
.app_xip_area 466228 466564 336 0.1
.bss 82932 82932 0 0.0
.data 564 564 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 921128 921480 352 0.0
(read/write) 128232 128232 0 0.0
.bss 126176 126176 0 0.0
.data 2052 2052 0 0.0
.text 921120 921472 352 0.0
BRD4161A+rpc (read only) 949940 950308 368 0.0
(read/write) 144184 144184 0 0.0
.bss 141952 141952 0 0.0
.data 2232 2232 0 0.0
.text 949932 950300 368 0.0
window-app BRD4161A (read only) 853732 853732 0 0.0
(read/write) 126216 126216 0 0.0
.bss 124312 124312 0 0.0
.data 1904 1904 0 0.0
.text 853724 853724 0 0.0
esp32 all-clusters-app c3devkit (read only) 958524 958524 0 0.0
(read/write) 1393858 1393858 0 0.0
.dram0.bss 63584 63584 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 197144 197144 0 0.0
.flash.text 958524 958524 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1014127 1014127 0 0.0
(read/write) 461092 461092 0 0.0
.dram0.bss 69104 69104 0 0.0
.dram0.data 34048 34048 0 0.0
.flash.rodata 226104 226104 0 0.0
.flash.text 1008743 1008743 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 695388 695748 360 0.1
.bss 77112 77112 0 0.0
.data 1928 1928 0 0.0
.text 610548 610908 360 0.1
lock k32w061+release (read/write) 696360 696360 0 0.0
.bss 77080 77080 0 0.0
.data 1952 1952 0 0.0
.text 611528 611528 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9729660 9729660 0 0.0
(read/write) 475729 475729 0 0.0
.bss 43953 43953 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 371520 371520 0 0.0
.dynamic 560 560 0 0.0
.got 55280 55280 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 492148 492148 0 0.0
.text 8186868 8186868 0 0.0
thermostat-no-ble arm64 (read only) 2181588 2181588 0 0.0
(read/write) 148625 148625 0 0.0
.bss 65409 65409 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 74968 74968 0 0.0
.dynamic 560 560 0 0.0
.got 4256 4256 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 133444 133444 0 0.0
.text 1829984 1829984 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2456368 2456608 240 0.0
.bss 192136 192136 0 0.0
.data 5488 5488 0 0.0
.text 1418940 1419180 240 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2417768 2418008 240 0.0
.bss 187452 187452 0 0.0
.data 5808 5808 0 0.0
.text 1380340 1380580 240 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2351012 2351012 0 0.0
.bss 186212 186212 0 0.0
.data 5784 5784 0 0.0
.text 1313612 1313612 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2344000 2344232 232 0.0
.bss 185992 185992 0 0.0
.data 5592 5592 0 0.0
.text 1306572 1306804 232 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152643 1153019 376 0.0
bss 146188 146188 0 0.0
rodata 144516 144588 72 0.0
text 786676 786988 312 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1139367 1139727 360 0.0
bss 142600 142600 0 0.0
rodata 122272 122344 72 0.1
text 795508 795796 288 0.0
nrf52840dk_nrf52840+rpc (read/write) 1086395 1087383 988 0.1
bss 138684 138684 0 0.0
rodata 109700 109920 220 0.2
text 758912 759676 764 0.1
nrf52840dongle_nrf52840 (read/write) 1152863 1152863 0 0.0
bss 143616 143616 0 0.0
rodata 121404 121404 0 0.0
text 798068 798068 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1042562 1042922 360 0.0
bss 139664 139664 0 0.0
rodata 114392 114464 72 0.1
text 706528 706816 288 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1039623 1039983 360 0.0
bss 132548 132548 0 0.0
rodata 114936 115008 72 0.1
text 713368 713656 288 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 943194 943550 356 0.0
bss 129644 129644 0 0.0
rodata 107112 107180 68 0.1
text 624536 624824 288 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1057647 1058007 360 0.0
bss 132460 132460 0 0.0
rodata 116880 116952 72 0.1
text 729476 729764 288 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1040899 1041259 360 0.0
bss 132208 132208 0 0.0
rodata 113460 113532 72 0.1
text 716400 716688 288 0.0
p6 all-clusters-app default (read/write) 2495680 2495680 0 0.0
.bss 119640 119640 0 0.0
.data 2672 2672 0 0.0
.text 1453944 1453944 0 0.0
light-app default (read/write) 2399680 2399680 0 0.0
.bss 113104 113104 0 0.0
.data 2528 2528 0 0.0
.text 1357944 1357944 0 0.0
lock-app default (read/write) 2363240 2363240 0 0.0
.bss 112848 112848 0 0.0
.data 2488 2488 0 0.0
.text 1321504 1321504 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 889766 889766 0 0.0
bss 86976 86976 0 0.0
noinit 37160 37160 0 0.0
text 628970 628970 0 0.0

@github-actions
Copy link

github-actions bot commented Mar 11, 2022

PR #16103: Size comparison from ae514b6 to 7a0a83d

Increases above 0.2%:

platform target config section ae514b6 7a0a83d change % change
nrfconnect lighting-app nrf52840dk_nrf52840+rpc rodata 109700 109920 220 0.2
Increases (15 builds for cyw30739, efr32, k32w, mbed, nrfconnect)
platform target config section ae514b6 7a0a83d change % change
cyw30739 ota-requestor cyw930739m2evb_01 (read/write) 566766 567102 336 0.1
.app_xip_area 466228 466564 336 0.1
efr32 lighting-app BRD4161A (read only) 921128 921480 352 0.0
.text 921120 921472 352 0.0
BRD4161A+rpc (read only) 949940 950308 368 0.0
.text 949932 950300 368 0.0
k32w light k32w061+release (read/write) 695388 695748 360 0.1
.text 610548 610908 360 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2456368 2456608 240 0.0
.text 1418940 1419180 240 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2417768 2418008 240 0.0
.text 1380340 1380580 240 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2344000 2344232 232 0.0
.text 1306572 1306804 232 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152643 1153019 376 0.0
rodata 144516 144588 72 0.0
text 786676 786988 312 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1139367 1139727 360 0.0
rodata 122272 122344 72 0.1
text 795508 795796 288 0.0
nrf52840dk_nrf52840+rpc (read/write) 1086395 1087383 988 0.1
rodata 109700 109920 220 0.2
text 758912 759676 764 0.1
nrf5340dk_nrf5340_cpuapp (read/write) 1042562 1042922 360 0.0
rodata 114392 114464 72 0.1
text 706528 706816 288 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1039623 1039983 360 0.0
rodata 114936 115008 72 0.1
text 713368 713656 288 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 943194 943550 356 0.0
rodata 107112 107180 68 0.1
text 624536 624824 288 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1057647 1058007 360 0.0
rodata 116880 116952 72 0.1
text 729476 729764 288 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1040899 1041259 360 0.0
rodata 113460 113532 72 0.1
text 716400 716688 288 0.0
Full report (29 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section ae514b6 7a0a83d change % change
cyw30739 light cyw930739m2evb_01 (read/write) 599102 599102 0 0.0
.app_xip_area 506700 506700 0 0.0
.bss 75108 75108 0 0.0
.data 640 640 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 556986 556986 0 0.0
.app_xip_area 466112 466112 0 0.0
.bss 73612 73612 0 0.0
.data 604 604 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 566766 567102 336 0.1
.app_xip_area 466228 466564 336 0.1
.bss 82932 82932 0 0.0
.data 564 564 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 921128 921480 352 0.0
(read/write) 128232 128232 0 0.0
.bss 126176 126176 0 0.0
.data 2052 2052 0 0.0
.text 921120 921472 352 0.0
BRD4161A+rpc (read only) 949940 950308 368 0.0
(read/write) 144184 144184 0 0.0
.bss 141952 141952 0 0.0
.data 2232 2232 0 0.0
.text 949932 950300 368 0.0
window-app BRD4161A (read only) 853732 853732 0 0.0
(read/write) 126216 126216 0 0.0
.bss 124312 124312 0 0.0
.data 1904 1904 0 0.0
.text 853724 853724 0 0.0
esp32 all-clusters-app c3devkit (read only) 958524 958524 0 0.0
(read/write) 1393858 1393858 0 0.0
.dram0.bss 63584 63584 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 197144 197144 0 0.0
.flash.text 958524 958524 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1014127 1014127 0 0.0
(read/write) 461092 461092 0 0.0
.dram0.bss 69104 69104 0 0.0
.dram0.data 34048 34048 0 0.0
.flash.rodata 226104 226104 0 0.0
.flash.text 1008743 1008743 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 695388 695748 360 0.1
.bss 77112 77112 0 0.0
.data 1928 1928 0 0.0
.text 610548 610908 360 0.1
lock k32w061+release (read/write) 696360 696360 0 0.0
.bss 77080 77080 0 0.0
.data 1952 1952 0 0.0
.text 611528 611528 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9729660 9729660 0 0.0
(read/write) 475729 475729 0 0.0
.bss 43953 43953 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 371520 371520 0 0.0
.dynamic 560 560 0 0.0
.got 55280 55280 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 492148 492148 0 0.0
.text 8186868 8186868 0 0.0
thermostat-no-ble arm64 (read only) 2181588 2181588 0 0.0
(read/write) 148625 148625 0 0.0
.bss 65409 65409 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 74968 74968 0 0.0
.dynamic 560 560 0 0.0
.got 4256 4256 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 133444 133444 0 0.0
.text 1829984 1829984 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2456368 2456608 240 0.0
.bss 192136 192136 0 0.0
.data 5488 5488 0 0.0
.text 1418940 1419180 240 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2417768 2418008 240 0.0
.bss 187452 187452 0 0.0
.data 5808 5808 0 0.0
.text 1380340 1380580 240 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2351012 2351012 0 0.0
.bss 186212 186212 0 0.0
.data 5784 5784 0 0.0
.text 1313612 1313612 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2344000 2344232 232 0.0
.bss 185992 185992 0 0.0
.data 5592 5592 0 0.0
.text 1306572 1306804 232 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152643 1153019 376 0.0
bss 146188 146188 0 0.0
rodata 144516 144588 72 0.0
text 786676 786988 312 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1139367 1139727 360 0.0
bss 142600 142600 0 0.0
rodata 122272 122344 72 0.1
text 795508 795796 288 0.0
nrf52840dk_nrf52840+rpc (read/write) 1086395 1087383 988 0.1
bss 138684 138684 0 0.0
rodata 109700 109920 220 0.2
text 758912 759676 764 0.1
nrf52840dongle_nrf52840 (read/write) 1152863 1152863 0 0.0
bss 143616 143616 0 0.0
rodata 121404 121404 0 0.0
text 798068 798068 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1042562 1042922 360 0.0
bss 139664 139664 0 0.0
rodata 114392 114464 72 0.1
text 706528 706816 288 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1039623 1039983 360 0.0
bss 132548 132548 0 0.0
rodata 114936 115008 72 0.1
text 713368 713656 288 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 943194 943550 356 0.0
bss 129644 129644 0 0.0
rodata 107112 107180 68 0.1
text 624536 624824 288 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1057647 1058007 360 0.0
bss 132460 132460 0 0.0
rodata 116880 116952 72 0.1
text 729476 729764 288 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1040899 1041259 360 0.0
bss 132208 132208 0 0.0
rodata 113460 113532 72 0.1
text 716400 716688 288 0.0
p6 all-clusters-app default (read/write) 2495680 2495680 0 0.0
.bss 119640 119640 0 0.0
.data 2672 2672 0 0.0
.text 1453944 1453944 0 0.0
light-app default (read/write) 2399680 2399680 0 0.0
.bss 113104 113104 0 0.0
.data 2528 2528 0 0.0
.text 1357944 1357944 0 0.0
lock-app default (read/write) 2363240 2363240 0 0.0
.bss 112848 112848 0 0.0
.data 2488 2488 0 0.0
.text 1321504 1321504 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 889766 889766 0 0.0
bss 86976 86976 0 0.0
noinit 37160 37160 0 0.0
text 628970 628970 0 0.0

@andy31415 andy31415 merged commit d86a7d4 into project-chip:master Mar 14, 2022
@Damian-Nordic Damian-Nordic deleted the notify branch March 17, 2022 14:55
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
* [ota] Automatic NotifyUpdateApplied

Add two methods to OTAImageProcessor:
- IsFirstImageRun() to determine if the currently running
  image is executed for the first time
- ConfirmCurrentImage() to confirm that the current image
  is stable and the update can be left permanently.

Add storing and loading the current provider and the
update token in OTARequestor.

Then extend GenericOTARequestorDriver to automatically
confirm the current image and send NotifyUpdateApplied
command to the last provider.

* Fix build
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.

Send NotifyUpdateApplied command after starting new software image
3 participants