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] Add script for generating OTA image #13547

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

Damian-Nordic
Copy link
Contributor

@Damian-Nordic Damian-Nordic commented Jan 13, 2022

Problem

No tool for creating spec-compliant OTA images exists.

Change overview

Add script for encoding spec-compliant OTA image header and concatenating a set of payload files.
Additionally the script allows to parse the header and verify the contents were written correctly.
Fixes #2863.

Testing

Generated a sample OTA image and did simple manual verification of the contents.

@github-actions
Copy link

github-actions bot commented Jan 13, 2022

PR #13547: Size comparison from bbf5d40 to a84c3a8

Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section bbf5d40 a84c3a8 change % change
efr32 lighting-app BRD4161A (read only) 831376 831376 0 0.0
(read/write) 127612 127612 0 0.0
.bss 125732 125732 0 0.0
.data 1880 1880 0 0.0
.text 831368 831368 0 0.0
BRD4161A+rpc (read only) 818772 818772 0 0.0
(read/write) 144272 144272 0 0.0
.bss 142292 142292 0 0.0
.data 1980 1980 0 0.0
.text 818764 818764 0 0.0
window-app BRD4161A (read only) 805256 805256 0 0.0
(read/write) 126320 126320 0 0.0
.bss 124480 124480 0 0.0
.data 1836 1836 0 0.0
.text 805248 805248 0 0.0
esp32 all-clusters-app c3devkit (read only) 908512 908512 0 0.0
(read/write) 1316498 1316498 0 0.0
.dram0.bss 70504 70504 0 0.0
.dram0.data 14284 14284 0 0.0
.flash.rodata 178216 178216 0 0.0
.flash.text 908512 908512 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 957287 957287 0 0.0
(read/write) 448664 448664 0 0.0
.dram0.bss 74976 74976 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 207496 207496 0 0.0
.flash.text 951903 951903 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 657752 657752 0 0.0
.bss 77136 77136 0 0.0
.data 1852 1852 0 0.0
.text 572964 572964 0 0.0
lock k32w061+release (read/write) 661516 661516 0 0.0
.bss 77432 77432 0 0.0
.data 1872 1872 0 0.0
.text 576412 576412 0 0.0
linux chip-tool-ipv6only arm64 (read only) 8018564 8018564 0 0.0
(read/write) 370241 370241 0 0.0
.bss 55217 55217 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 245760 245760 0 0.0
.dynamic 560 560 0 0.0
.got 64472 64472 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 417772 417772 0 0.0
.text 6812900 6812900 0 0.0
thermostat-no-ble arm64 (read only) 2040860 2040860 0 0.0
(read/write) 145969 145969 0 0.0
.bss 65089 65089 0 0.0
.data 880 880 0 0.0
.data.rel.ro 73016 73016 0 0.0
.dynamic 560 560 0 0.0
.got 4048 4048 0 0.0
.init 24 24 0 0.0
.init_array 304 304 0 0.0
.rodata 129868 129868 0 0.0
.text 1696400 1696400 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2346416 2346416 0 0.0
.bss 189204 189204 0 0.0
.data 5320 5320 0 0.0
.text 1308992 1308992 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2331240 2331240 0 0.0
.bss 180728 180728 0 0.0
.data 5552 5552 0 0.0
.text 1293840 1293840 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2304464 2304464 0 0.0
.bss 179768 179768 0 0.0
.data 5544 5544 0 0.0
.text 1267064 1267064 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) 2054456 2054456 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1017056 1017056 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 940287 940287 0 0.0
bss 119596 119596 0 0.0
rodata 108508 108508 0 0.0
text 634612 634612 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 925723 925723 0 0.0
bss 116640 116640 0 0.0
rodata 100960 100960 0 0.0
text 629964 629964 0 0.0
nrf52840dongle_nrf52840 (read/write) 990967 990967 0 0.0
bss 122440 122440 0 0.0
rodata 113264 113264 0 0.0
text 666808 666808 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 850114 850114 0 0.0
bss 116384 116384 0 0.0
rodata 101684 101684 0 0.0
text 551528 551528 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 912527 912527 0 0.0
bss 118784 118784 0 0.0
rodata 103780 103780 0 0.0
text 612604 612604 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 822598 822598 0 0.0
bss 115600 115600 0 0.0
rodata 97008 97008 0 0.0
text 529560 529560 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) 913855 913855 0 0.0
bss 118544 118544 0 0.0
rodata 103996 103996 0 0.0
text 613864 613864 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 910655 910655 0 0.0
bss 118572 118572 0 0.0
rodata 103252 103252 0 0.0
text 611360 611360 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798643 798643 0 0.0
bss 109776 109776 0 0.0
rodata 78376 78376 0 0.0
text 533988 533988 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 711462 711462 0 0.0
bss 107664 107664 0 0.0
rodata 72680 72680 0 0.0
text 451668 451668 0 0.0
p6 all-clusters-app default (read/write) 2400600 2400600 0 0.0
.bss 117484 117484 0 0.0
.data 2592 2592 0 0.0
.text 1358864 1358864 0 0.0
light-app default (read/write) 2326152 2326152 0 0.0
.bss 106040 106040 0 0.0
.data 2384 2384 0 0.0
.text 1284416 1284416 0 0.0
lock-app default (read/write) 2298384 2298384 0 0.0
.bss 104920 104920 0 0.0
.data 2344 2344 0 0.0
.text 1256648 1256648 0 0.0
qpg lighting-app qpg6105+debug (read only) 534964 534964 0 0.0
(read/write) 146940 146940 0 0.0
.bss 89336 89336 0 0.0
.data 1008 1008 0 0.0
.text 529644 529644 0 0.0
lock-app qpg6105+debug (read only) 506888 506888 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88472 88472 0 0.0
.data 956 956 0 0.0
.text 501568 501568 0 0.0
persistent-storage-app qpg6105+debug (read only) 106848 106848 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101528 101528 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 836942 836942 0 0.0
bss 87288 87288 0 0.0
noinit 37160 37160 0 0.0
text 584312 584312 0 0.0

@Damian-Nordic Damian-Nordic force-pushed the ota-image-tool branch 2 times, most recently from f71ea72 to 280c1e1 Compare January 14, 2022 10:49
@github-actions
Copy link

github-actions bot commented Jan 14, 2022

PR #13547: Size comparison from 5e61ce9 to 280c1e1

Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 5e61ce9 280c1e1 change % change
efr32 lighting-app BRD4161A (read only) 832764 832764 0 0.0
(read/write) 127628 127628 0 0.0
.bss 125744 125744 0 0.0
.data 1884 1884 0 0.0
.text 832756 832756 0 0.0
BRD4161A+rpc (read only) 820168 820168 0 0.0
(read/write) 144288 144288 0 0.0
.bss 142304 142304 0 0.0
.data 1984 1984 0 0.0
.text 820160 820160 0 0.0
window-app BRD4161A (read only) 805424 805424 0 0.0
(read/write) 126320 126320 0 0.0
.bss 124480 124480 0 0.0
.data 1836 1836 0 0.0
.text 805416 805416 0 0.0
esp32 all-clusters-app c3devkit (read only) 910034 910034 0 0.0
(read/write) 1316506 1316506 0 0.0
.dram0.bss 70504 70504 0 0.0
.dram0.data 14284 14284 0 0.0
.flash.rodata 178224 178224 0 0.0
.flash.text 910034 910034 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 959027 959027 0 0.0
(read/write) 448672 448672 0 0.0
.dram0.bss 74976 74976 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 207504 207504 0 0.0
.flash.text 953643 953643 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 657920 657920 0 0.0
.bss 77136 77136 0 0.0
.data 1852 1852 0 0.0
.text 573132 573132 0 0.0
lock k32w061+release (read/write) 661604 661604 0 0.0
.bss 77432 77432 0 0.0
.data 1872 1872 0 0.0
.text 576500 576500 0 0.0
linux chip-tool-ipv6only arm64 (read only) 8024820 8024820 0 0.0
(read/write) 370241 370241 0 0.0
.bss 55217 55217 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 245760 245760 0 0.0
.dynamic 560 560 0 0.0
.got 64472 64472 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 417788 417788 0 0.0
.text 6819140 6819140 0 0.0
thermostat-no-ble arm64 (read only) 2041980 2041980 0 0.0
(read/write) 145969 145969 0 0.0
.bss 65089 65089 0 0.0
.data 880 880 0 0.0
.data.rel.ro 73016 73016 0 0.0
.dynamic 560 560 0 0.0
.got 4048 4048 0 0.0
.init 24 24 0 0.0
.init_array 304 304 0 0.0
.rodata 129884 129884 0 0.0
.text 1697504 1697504 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2347832 2347832 0 0.0
.bss 189204 189204 0 0.0
.data 5320 5320 0 0.0
.text 1310408 1310408 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2332416 2332416 0 0.0
.bss 180752 180752 0 0.0
.data 5560 5560 0 0.0
.text 1295016 1295016 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2304536 2304536 0 0.0
.bss 179768 179768 0 0.0
.data 5544 5544 0 0.0
.text 1267136 1267136 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) 2054464 2054464 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1017064 1017064 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 941447 941447 0 0.0
bss 119624 119624 0 0.0
rodata 108660 108660 0 0.0
text 635576 635576 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 926911 926911 0 0.0
bss 116668 116668 0 0.0
rodata 101108 101108 0 0.0
text 630968 630968 0 0.0
nrf52840dongle_nrf52840 (read/write) 992091 992091 0 0.0
bss 122464 122464 0 0.0
rodata 113412 113412 0 0.0
text 667772 667772 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 851270 851270 0 0.0
bss 116412 116412 0 0.0
rodata 101832 101832 0 0.0
text 552492 552492 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 912619 912619 0 0.0
bss 118784 118784 0 0.0
rodata 103792 103792 0 0.0
text 612672 612672 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 822686 822686 0 0.0
bss 115600 115600 0 0.0
rodata 97016 97016 0 0.0
text 529632 529632 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) 913991 913991 0 0.0
bss 118544 118544 0 0.0
rodata 104004 104004 0 0.0
text 613996 613996 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 910747 910747 0 0.0
bss 118572 118572 0 0.0
rodata 103264 103264 0 0.0
text 611448 611448 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798655 798655 0 0.0
bss 109776 109776 0 0.0
rodata 78388 78388 0 0.0
text 533992 533992 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 711470 711470 0 0.0
bss 107664 107664 0 0.0
rodata 72688 72688 0 0.0
text 451672 451672 0 0.0
p6 all-clusters-app default (read/write) 2402304 2402304 0 0.0
.bss 117484 117484 0 0.0
.data 2592 2592 0 0.0
.text 1360568 1360568 0 0.0
light-app default (read/write) 2327544 2327544 0 0.0
.bss 106064 106064 0 0.0
.data 2392 2392 0 0.0
.text 1285808 1285808 0 0.0
lock-app default (read/write) 2298456 2298456 0 0.0
.bss 104920 104920 0 0.0
.data 2344 2344 0 0.0
.text 1256720 1256720 0 0.0
qpg lighting-app qpg6105+debug (read only) 561976 561976 0 0.0
(read/write) 146936 146936 0 0.0
.bss 89952 89952 0 0.0
.data 1044 1044 0 0.0
.text 556656 556656 0 0.0
lock-app qpg6105+debug (read only) 515292 515292 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88584 88584 0 0.0
.data 972 972 0 0.0
.text 509972 509972 0 0.0
persistent-storage-app qpg6105+debug (read only) 106848 106848 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38512 38512 0 0.0
.data 288 288 0 0.0
.text 101528 101528 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 838462 838462 0 0.0
bss 87312 87312 0 0.0
noinit 37160 37160 0 0.0
text 585618 585618 0 0.0

Add script for encoding spec-compliant OTA image header
and concatenating a set of payload files.
@Damian-Nordic Damian-Nordic force-pushed the ota-image-tool branch 2 times, most recently from 31ef758 to 82add17 Compare January 17, 2022 09:23
@github-actions
Copy link

github-actions bot commented Jan 17, 2022

PR #13547: Size comparison from e4faade to 82add17

Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section e4faade 82add17 change % change
efr32 lighting-app BRD4161A (read only) 834852 834852 0 0.0
(read/write) 127628 127628 0 0.0
.bss 125744 125744 0 0.0
.data 1884 1884 0 0.0
.text 834844 834844 0 0.0
BRD4161A+rpc (read only) 822232 822232 0 0.0
(read/write) 144288 144288 0 0.0
.bss 142304 142304 0 0.0
.data 1984 1984 0 0.0
.text 822224 822224 0 0.0
window-app BRD4161A (read only) 805424 805424 0 0.0
(read/write) 126320 126320 0 0.0
.bss 124480 124480 0 0.0
.data 1836 1836 0 0.0
.text 805416 805416 0 0.0
esp32 all-clusters-app c3devkit (read only) 912094 912094 0 0.0
(read/write) 1316682 1316682 0 0.0
.dram0.bss 70520 70520 0 0.0
.dram0.data 14284 14284 0 0.0
.flash.rodata 178384 178384 0 0.0
.flash.text 912094 912094 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 960883 960883 0 0.0
(read/write) 448840 448840 0 0.0
.dram0.bss 74976 74976 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 207672 207672 0 0.0
.flash.text 955499 955499 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 659064 659064 0 0.0
.bss 77136 77136 0 0.0
.data 1852 1852 0 0.0
.text 574276 574276 0 0.0
lock k32w061+release (read/write) 661796 661796 0 0.0
.bss 77432 77432 0 0.0
.data 1872 1872 0 0.0
.text 576692 576692 0 0.0
linux chip-tool-ipv6only arm64 (read only) 8042100 8042100 0 0.0
(read/write) 370641 370641 0 0.0
.bss 55217 55217 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 245856 245856 0 0.0
.dynamic 560 560 0 0.0
.got 64776 64776 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 419420 419420 0 0.0
.text 6833684 6833684 0 0.0
thermostat-no-ble arm64 (read only) 2042108 2042108 0 0.0
(read/write) 145969 145969 0 0.0
.bss 65089 65089 0 0.0
.data 880 880 0 0.0
.data.rel.ro 73016 73016 0 0.0
.dynamic 560 560 0 0.0
.got 4048 4048 0 0.0
.init 24 24 0 0.0
.init_array 304 304 0 0.0
.rodata 129884 129884 0 0.0
.text 1697632 1697632 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2349856 2349856 0 0.0
.bss 189220 189220 0 0.0
.data 5320 5320 0 0.0
.text 1312432 1312432 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2334504 2334504 0 0.0
.bss 180760 180760 0 0.0
.data 5568 5568 0 0.0
.text 1297104 1297104 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2304848 2304848 0 0.0
.bss 179768 179768 0 0.0
.data 5544 5544 0 0.0
.text 1267448 1267448 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) 2054464 2054464 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1017064 1017064 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 943403 943403 0 0.0
bss 119628 119628 0 0.0
rodata 108824 108824 0 0.0
text 637376 637376 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 928883 928883 0 0.0
bss 116672 116672 0 0.0
rodata 101272 101272 0 0.0
text 632772 632772 0 0.0
nrf52840dongle_nrf52840 (read/write) 994079 994079 0 0.0
bss 122472 122472 0 0.0
rodata 113576 113576 0 0.0
text 669576 669576 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 853242 853242 0 0.0
bss 116416 116416 0 0.0
rodata 101996 101996 0 0.0
text 554300 554300 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 912763 912763 0 0.0
bss 118784 118784 0 0.0
rodata 103792 103792 0 0.0
text 612824 612824 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 822830 822830 0 0.0
bss 115600 115600 0 0.0
rodata 97016 97016 0 0.0
text 529784 529784 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) 915627 915627 0 0.0
bss 118548 118548 0 0.0
rodata 104152 104152 0 0.0
text 615480 615480 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 910715 910715 0 0.0
bss 118572 118572 0 0.0
rodata 103264 103264 0 0.0
text 611404 611404 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798655 798655 0 0.0
bss 109776 109776 0 0.0
rodata 78388 78388 0 0.0
text 533992 533992 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 711470 711470 0 0.0
bss 107664 107664 0 0.0
rodata 72688 72688 0 0.0
text 451668 451668 0 0.0
p6 all-clusters-app default (read/write) 2404744 2404744 0 0.0
.bss 117556 117556 0 0.0
.data 2600 2600 0 0.0
.text 1363008 1363008 0 0.0
light-app default (read/write) 2330048 2330048 0 0.0
.bss 106128 106128 0 0.0
.data 2392 2392 0 0.0
.text 1288312 1288312 0 0.0
lock-app default (read/write) 2299072 2299072 0 0.0
.bss 104976 104976 0 0.0
.data 2344 2344 0 0.0
.text 1257336 1257336 0 0.0
qpg lighting-app qpg6105+debug (read only) 565072 565072 0 0.0
(read/write) 146940 146940 0 0.0
.bss 89960 89960 0 0.0
.data 1048 1048 0 0.0
.text 559752 559752 0 0.0
lock-app qpg6105+debug (read only) 515484 515484 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88584 88584 0 0.0
.data 972 972 0 0.0
.text 510164 510164 0 0.0
persistent-storage-app qpg6105+debug (read only) 106848 106848 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38512 38512 0 0.0
.data 288 288 0 0.0
.text 101528 101528 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 840778 840778 0 0.0
bss 87316 87316 0 0.0
noinit 37160 37160 0 0.0
text 587748 587748 0 0.0

@carol-apple carol-apple merged commit d611c63 into project-chip:master Jan 18, 2022
@Damian-Nordic Damian-Nordic deleted the ota-image-tool branch January 18, 2022 08:52
if args.max_version:
fields.update({HeaderTag.MAX_VERSION: uint(args.max_version)})

if args.release_notes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Size range is 1..256. Suggest warning if it doesn't start with https://

Comment on lines +114 to +118
if args.min_version:
fields.update({HeaderTag.MIN_VERSION: uint(args.min_version)})

if args.max_version:
fields.update({HeaderTag.MAX_VERSION: uint(args.max_version)})
Copy link
Contributor

@tcarmelveilleux tcarmelveilleux Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must validate the following (depending on presence):

  • min_version <= max_version
  • max_version < args.version

HeaderTag.VENDOR_ID: uint(args.vendor_id),
HeaderTag.PRODUCT_ID: uint(args.product_id),
HeaderTag.VERSION: uint(args.version),
HeaderTag.VERSION_STRING: args.version_str,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must verify length in range 1..64


fields = {
HeaderTag.VENDOR_ID: uint(args.vendor_id),
HeaderTag.PRODUCT_ID: uint(args.product_id),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PID cannot be 0

"""

fields = {
HeaderTag.VENDOR_ID: uint(args.vendor_id),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VID cannot be 0

DIGEST_ALL_ALGORITHMS = hashlib.algorithms_available.intersection(
DIGEST_ALGORITHM_ID.keys())

PAYLOAD_BUFFER_SIZE = 16 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding the comment:

# Buffer size used for file reads to ensure large files do not need to be loaded
# into memory fully before processing.

Comment on lines +47 to +54
sha256_128=2,
sha256_120=3,
sha256_96=4,
sha256_64=5,
sha256_32=6,
sha384=7,
sha512=8,
sha3_224=9,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest warning if sha256_x (len < 256 bits) and sha3_224 are used, since:

It is RECOMMENDED that a digest algorithm be chosen that has a minimum digest length of 256 bits, such as sha-256 (ID 1 in the registry).


with open(args.image_file, 'rb') as file:
fixed_header_format = '<IQI'
fixed_header = file.read(struct.calcsize(fixed_header_format))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding: assert struct.calcsize(fixed_header_format) == 16

Generate OTA image header
"""

fixed_header_format = '<IQI'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding: assert struct.calcsize(fixed_header_format) == 16

selissia pushed a commit to selissia/connectedhomeip that referenced this pull request Jan 28, 2022
Add script for encoding spec-compliant OTA image header
and concatenating a set of payload files.
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 2022
Add script for encoding spec-compliant OTA image header
and concatenating a set of payload files.
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.

Implement OTA Software Update file packer
5 participants