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 Linux implementation of OTAImageProcessorInterface #12493

Conversation

carol-apple
Copy link
Contributor

Problem

Currently, there no implementation of OTAImageProcessorInterface exists

Change overview

Add a Linux implementation to the ota-requestor-app

Testing

This cannot be hooked up as it requires OTADownloader to be implemented. Tested manually by modifying code temporarily to call into the methods in OTAImageProcessorInterface. Once OTADownloader is available, an end to end test can be done to verify that OTA images are downloaded as expected.

@todo
Copy link

todo bot commented Dec 2, 2021

Dummy function to be removed once BDX downloader is implemented and can return a real instance

// TODO: Dummy function to be removed once BDX downloader is implemented and can return a real instance
OTADownloader * GetDownloaderInstance()
{
return nullptr;
}
CHIP_ERROR LinuxOTAImageProcessor::PrepareDownload()
{
if (mParams.imageFile.empty())
{
ChipLogError(SoftwareUpdate, "Invalid output image file supplied");


This comment was generated by todo based on a TODO comment in 9f08821 in #12493. cc @carol-apple.

@todo
Copy link

todo bot commented Dec 2, 2021

Process block header if any

// TODO: Process block header if any
if (!imageProcessor->mOfs.write(reinterpret_cast<const char *>(imageProcessor->mBlock.data()),
static_cast<std::streamsize>(imageProcessor->mBlock.size())))
{
downloader->OnBlockProcessed(CHIP_ERROR_WRITE_FAILED, OTADownloader::kEnd);
return;
}
imageProcessor->mParams.downloadedBytes += imageProcessor->mBlock.size();
downloader->OnBlockProcessed(CHIP_NO_ERROR, OTADownloader::kGetNext);


This comment was generated by todo based on a TODO comment in 9f08821 in #12493. cc @carol-apple.

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

PR #12493: Size comparison from 2eb4c51 to 9f08821

Increases above 0.2%:

platform target config section 2eb4c51 9f08821 change % change
linux ota-requestor-app debug .got 4032 4064 32 0.8
.init_array 472 480 8 1.7
.rodata 132592 132976 384 0.3
Increases (1 build for linux)
platform target config section 2eb4c51 9f08821 change % change
linux ota-requestor-app debug (read only) 1478225 1481913 3688 0.2
(read/write) 76160 76200 40 0.1
.data.rel.ro 29304 29320 16 0.1
.got 4032 4064 32 0.8
.init_array 472 480 8 1.7
.rodata 132592 132976 384 0.3
.text 1238386 1241122 2736 0.2
Full report (32 builds for esp32, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 2eb4c51 9f08821 change % change
esp32 all-clusters-app c3devkit (read only) 847268 847268 0 0.0
(read/write) 1223618 1223618 0 0.0
.dram0.bss 56472 56472 0 0.0
.dram0.data 14052 14052 0 0.0
.flash.rodata 167632 167632 0 0.0
.flash.text 847268 847268 0 0.0
.iram0.text 61394 61394 0 0.0
m5stack (read only) 917827 917827 0 0.0
(read/write) 422596 422596 0 0.0
.dram0.bss 61864 61864 0 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 195436 195436 0 0.0
.flash.text 912443 912443 0 0.0
.iram0.text 122943 122943 0 0.0
linux all-clusters-app debug (read only) 1835665 1835665 0 0.0
(read/write) 123840 123840 0 0.0
.bss 50640 50640 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 66816 66816 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 146357 146357 0 0.0
.text 1547506 1547506 0 0.0
bridge-app debug+rpc (read only) 1417669 1417669 0 0.0
(read/write) 74032 74032 0 0.0
.bss 36048 36048 0 0.0
.data 1728 1728 0 0.0
.data.rel.ro 31248 31248 0 0.0
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 408 408 0 0.0
.rodata 119404 119404 0 0.0
.text 1194261 1194261 0 0.0
chip-tool debug (read only) 6596461 6596461 0 0.0
(read/write) 201744 201744 0 0.0
.bss 34344 34344 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 160824 160824 0 0.0
.dynamic 592 592 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 480 480 0 0.0
.rodata 306328 306328 0 0.0
.text 5880501 5880501 0 0.0
lighting-app debug+rpc (read only) 1701465 1701465 0 0.0
(read/write) 107088 107088 0 0.0
.bss 41744 41744 0 0.0
.data 1280 1280 0 0.0
.data.rel.ro 58752 58752 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 139185 139185 0 0.0
.text 1420530 1420530 0 0.0
ota-provider-app debug (read only) 1378201 1378201 0 0.0
(read/write) 72264 72264 0 0.0
.bss 38624 38624 0 0.0
.data 928 928 0 0.0
.data.rel.ro 27592 27592 0 0.0
.dynamic 592 592 0 0.0
.got 4048 4048 0 0.0
.init 27 27 0 0.0
.init_array 448 448 0 0.0
.rodata 120680 120680 0 0.0
.text 1153714 1153714 0 0.0
ota-requestor-app debug (read only) 1478225 1481913 3688 0.2
(read/write) 76160 76200 40 0.1
.bss 40736 40736 0 0.0
.data 992 992 0 0.0
.data.rel.ro 29304 29320 16 0.1
.dynamic 592 592 0 0.0
.got 4032 4064 32 0.8
.init 27 27 0 0.0
.init_array 472 480 8 1.7
.rodata 132592 132976 384 0.3
.text 1238386 1241122 2736 0.2
shell debug (read only) 813129 813129 0 0.0
(read/write) 60264 60264 0 0.0
.bss 16904 16904 0 0.0
.data 256 256 0 0.0
.data.rel.ro 38656 38656 0 0.0
.dynamic 592 592 0 0.0
.got 3504 3504 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 83506 83506 0 0.0
.text 623538 623538 0 0.0
tv-app debug (read only) 1995169 1995169 0 0.0
(read/write) 316760 316760 0 0.0
.bss 246112 246112 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 63440 63440 0 0.0
.dynamic 592 592 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 169224 169224 0 0.0
.text 1673618 1673618 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2308576 2308576 0 0.0
.bss 179532 179532 0 0.0
.data 5184 5184 0 0.0
.heap 851728 851728 0 0.0
.text 1271152 1271152 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2295096 2295096 0 0.0
.bss 173224 173224 0 0.0
.data 5496 5496 0 0.0
.heap 857728 857728 0 0.0
.text 1257696 1257696 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2268128 2268128 0 0.0
.bss 172040 172040 0 0.0
.data 5496 5496 0 0.0
.heap 858912 858912 0 0.0
.text 1230728 1230728 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2046576 2046576 0 0.0
.bss 156704 156704 0 0.0
.data 4872 4872 0 0.0
.heap 874872 874872 0 0.0
.text 1009176 1009176 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 891323 891323 0 0.0
bss 113728 113728 0 0.0
rodata 99372 99372 0 0.0
text 602684 602684 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 854699 854699 0 0.0
bss 110076 110076 0 0.0
rodata 90732 90732 0 0.0
text 577680 577680 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 817234 817234 0 0.0
bss 115100 115100 0 0.0
rodata 94628 94628 0 0.0
text 533024 533024 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 862179 862179 0 0.0
bss 110764 110764 0 0.0
rodata 95108 95108 0 0.0
text 580936 580936 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 788334 788334 0 0.0
bss 112176 112176 0 0.0
rodata 90400 90400 0 0.0
text 511368 511368 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 868195 868195 0 0.0
bss 110900 110900 0 0.0
rodata 96844 96844 0 0.0
text 585004 585004 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 861275 861275 0 0.0
bss 110780 110780 0 0.0
rodata 94980 94980 0 0.0
text 580064 580064 0 0.0
shell nrf52840dk_nrf52840 (read/write) 779911 779911 0 0.0
bss 109696 109696 0 0.0
rodata 73796 73796 0 0.0
text 521916 521916 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694938 694938 0 0.0
bss 110680 110680 0 0.0
rodata 68436 68436 0 0.0
text 442520 442520 0 0.0
p6 all-clusters-app default (read/write) 2338416 2338416 0 0.0
.bss 107720 107720 0 0.0
.data 2456 2456 0 0.0
.heap 923168 923168 0 0.0
.text 1296680 1296680 0 0.0
light-app default (read/write) 2278016 2278016 0 0.0
.bss 98452 98452 0 0.0
.data 2336 2336 0 0.0
.heap 932552 932552 0 0.0
.text 1236280 1236280 0 0.0
lock-app default (read/write) 2253368 2253368 0 0.0
.bss 97108 97108 0 0.0
.data 2296 2296 0 0.0
.heap 933936 933936 0 0.0
.text 1211632 1211632 0 0.0
qpg lighting-app qpg6100+debug (read only) 510408 510408 0 0.0
(read/write) 122332 122332 0 0.0
.bss 80240 80240 0 0.0
.data 964 964 0 0.0
.text 505088 505088 0 0.0
lock-app qpg6100+debug (read only) 483232 483232 0 0.0
(read/write) 122332 122332 0 0.0
.bss 79152 79152 0 0.0
.data 916 916 0 0.0
.text 477912 477912 0 0.0
persistent-storage-app qpg6100+debug (read only) 108208 108208 0 0.0
(read/write) 122332 122332 0 0.0
.bss 36696 36696 0 0.0
.data 292 292 0 0.0
.text 102888 102888 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 794430 794430 0 0.0
bss 80304 80304 0 0.0
noinit 37160 37160 0 0.0
text 554474 554474 0 0.0

@carol-apple carol-apple force-pushed the ota_image_process_linux_implementation branch from 9f08821 to 723a93e Compare December 2, 2021 21:51
@github-actions
Copy link

github-actions bot commented Dec 2, 2021

PR #12493: Size comparison from 07dbf82 to 723a93e

Increases above 0.2%:

platform target config section 07dbf82 723a93e change % change
linux ota-requestor-app debug .got 4032 4064 32 0.8
.init_array 472 480 8 1.7
.rodata 132624 133008 384 0.3
Increases (1 build for linux)
platform target config section 07dbf82 723a93e change % change
linux ota-requestor-app debug (read only) 1478257 1481945 3688 0.2
(read/write) 76160 76200 40 0.1
.data.rel.ro 29304 29320 16 0.1
.got 4032 4064 32 0.8
.init_array 472 480 8 1.7
.rodata 132624 133008 384 0.3
.text 1238386 1241122 2736 0.2
Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 07dbf82 723a93e change % change
efr32 lighting-app BRD4161A (read only) 751432 751432 0 0.0
(read/write) 120008 120008 0 0.0
.bss 118176 118176 0 0.0
.data 1828 1828 0 0.0
.text 751424 751424 0 0.0
BRD4161A+rpc (read only) 780080 780080 0 0.0
(read/write) 138312 138312 0 0.0
.bss 136376 136376 0 0.0
.data 1936 1936 0 0.0
.text 780072 780072 0 0.0
lock-app BRD4161A (read only) 725272 725272 0 0.0
(read/write) 117712 117712 0 0.0
.bss 115928 115928 0 0.0
.data 1784 1784 0 0.0
.text 725264 725264 0 0.0
window-app BRD4161A (read only) 728600 728600 0 0.0
(read/write) 118136 118136 0 0.0
.bss 116344 116344 0 0.0
.data 1792 1792 0 0.0
.text 728592 728592 0 0.0
esp32 all-clusters-app c3devkit (read only) 847418 847418 0 0.0
(read/write) 1223666 1223666 0 0.0
.dram0.bss 56520 56520 0 0.0
.dram0.data 14052 14052 0 0.0
.flash.rodata 167632 167632 0 0.0
.flash.text 847418 847418 0 0.0
.iram0.text 61394 61394 0 0.0
m5stack (read only) 917963 917963 0 0.0
(read/write) 422644 422644 0 0.0
.dram0.bss 61912 61912 0 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 195436 195436 0 0.0
.flash.text 912579 912579 0 0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 728608 728608 0 0.0
.bss 79280 79280 0 0.0
.data 1860 1860 0 0.0
.text 641668 641668 0 0.0
lock-app k32w061+debug (read/write) 617592 617592 0 0.0
.bss 69720 69720 0 0.0
.data 1824 1824 0 0.0
.text 540248 540248 0 0.0
shell k32w061+debug (read/write) 683460 683460 0 0.0
.bss 81376 81376 0 0.0
.data 1796 1796 0 0.0
.text 594488 594488 0 0.0
linux all-clusters-app debug (read only) 1837073 1837073 0 0.0
(read/write) 123904 123904 0 0.0
.bss 50704 50704 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 66816 66816 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 146389 146389 0 0.0
.text 1548882 1548882 0 0.0
bridge-app debug+rpc (read only) 1417733 1417733 0 0.0
(read/write) 74032 74032 0 0.0
.bss 36048 36048 0 0.0
.data 1728 1728 0 0.0
.data.rel.ro 31248 31248 0 0.0
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 408 408 0 0.0
.rodata 119468 119468 0 0.0
.text 1194261 1194261 0 0.0
chip-tool debug (read only) 6613197 6613197 0 0.0
(read/write) 201744 201744 0 0.0
.bss 34344 34344 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 160824 160824 0 0.0
.dynamic 592 592 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 480 480 0 0.0
.rodata 307192 307192 0 0.0
.text 5896373 5896373 0 0.0
lighting-app debug+rpc (read only) 1701529 1701529 0 0.0
(read/write) 107088 107088 0 0.0
.bss 41744 41744 0 0.0
.data 1280 1280 0 0.0
.data.rel.ro 58752 58752 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 139249 139249 0 0.0
.text 1420530 1420530 0 0.0
ota-provider-app debug (read only) 1378233 1378233 0 0.0
(read/write) 72264 72264 0 0.0
.bss 38624 38624 0 0.0
.data 928 928 0 0.0
.data.rel.ro 27592 27592 0 0.0
.dynamic 592 592 0 0.0
.got 4048 4048 0 0.0
.init 27 27 0 0.0
.init_array 448 448 0 0.0
.rodata 120712 120712 0 0.0
.text 1153714 1153714 0 0.0
ota-requestor-app debug (read only) 1478257 1481945 3688 0.2
(read/write) 76160 76200 40 0.1
.bss 40736 40736 0 0.0
.data 992 992 0 0.0
.data.rel.ro 29304 29320 16 0.1
.dynamic 592 592 0 0.0
.got 4032 4064 32 0.8
.init 27 27 0 0.0
.init_array 472 480 8 1.7
.rodata 132624 133008 384 0.3
.text 1238386 1241122 2736 0.2
shell debug (read only) 813129 813129 0 0.0
(read/write) 60264 60264 0 0.0
.bss 16904 16904 0 0.0
.data 256 256 0 0.0
.data.rel.ro 38656 38656 0 0.0
.dynamic 592 592 0 0.0
.got 3504 3504 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 83506 83506 0 0.0
.text 623538 623538 0 0.0
tv-app debug (read only) 1995233 1995233 0 0.0
(read/write) 316760 316760 0 0.0
.bss 246112 246112 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 63440 63440 0 0.0
.dynamic 592 592 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 169288 169288 0 0.0
.text 1673618 1673618 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2308768 2308768 0 0.0
.bss 179580 179580 0 0.0
.data 5184 5184 0 0.0
.heap 851680 851680 0 0.0
.text 1271344 1271344 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2295096 2295096 0 0.0
.bss 173224 173224 0 0.0
.data 5496 5496 0 0.0
.heap 857728 857728 0 0.0
.text 1257696 1257696 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2268128 2268128 0 0.0
.bss 172040 172040 0 0.0
.data 5496 5496 0 0.0
.heap 858912 858912 0 0.0
.text 1230728 1230728 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2046576 2046576 0 0.0
.bss 156704 156704 0 0.0
.data 4872 4872 0 0.0
.heap 874872 874872 0 0.0
.text 1009176 1009176 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 891323 891323 0 0.0
bss 113728 113728 0 0.0
rodata 99372 99372 0 0.0
text 602684 602684 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 854699 854699 0 0.0
bss 110076 110076 0 0.0
rodata 90732 90732 0 0.0
text 577680 577680 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 817234 817234 0 0.0
bss 115100 115100 0 0.0
rodata 94628 94628 0 0.0
text 533024 533024 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 862179 862179 0 0.0
bss 110764 110764 0 0.0
rodata 95108 95108 0 0.0
text 580936 580936 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 788334 788334 0 0.0
bss 112176 112176 0 0.0
rodata 90400 90400 0 0.0
text 511368 511368 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 868195 868195 0 0.0
bss 110900 110900 0 0.0
rodata 96844 96844 0 0.0
text 585004 585004 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 861275 861275 0 0.0
bss 110780 110780 0 0.0
rodata 94980 94980 0 0.0
text 580064 580064 0 0.0
shell nrf52840dk_nrf52840 (read/write) 779911 779911 0 0.0
bss 109696 109696 0 0.0
rodata 73796 73796 0 0.0
text 521916 521916 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694938 694938 0 0.0
bss 110680 110680 0 0.0
rodata 68436 68436 0 0.0
text 442520 442520 0 0.0
p6 all-clusters-app default (read/write) 2338672 2338672 0 0.0
.bss 107768 107768 0 0.0
.data 2456 2456 0 0.0
.heap 923120 923120 0 0.0
.text 1296936 1296936 0 0.0
light-app default (read/write) 2278016 2278016 0 0.0
.bss 98452 98452 0 0.0
.data 2336 2336 0 0.0
.heap 932552 932552 0 0.0
.text 1236280 1236280 0 0.0
lock-app default (read/write) 2253368 2253368 0 0.0
.bss 97108 97108 0 0.0
.data 2296 2296 0 0.0
.heap 933936 933936 0 0.0
.text 1211632 1211632 0 0.0
qpg lighting-app qpg6100+debug (read only) 510408 510408 0 0.0
(read/write) 122332 122332 0 0.0
.bss 80240 80240 0 0.0
.data 964 964 0 0.0
.text 505088 505088 0 0.0
lock-app qpg6100+debug (read only) 483232 483232 0 0.0
(read/write) 122332 122332 0 0.0
.bss 79152 79152 0 0.0
.data 916 916 0 0.0
.text 477912 477912 0 0.0
persistent-storage-app qpg6100+debug (read only) 108208 108208 0 0.0
(read/write) 122332 122332 0 0.0
.bss 36696 36696 0 0.0
.data 292 292 0 0.0
.text 102888 102888 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 794430 794430 0 0.0
bss 80304 80304 0 0.0
noinit 37160 37160 0 0.0
text 554474 554474 0 0.0

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.

5 participants