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

[nxp][platform][ota] Add runtime ota reboot delay / Add OTA_ServiceDeInit in AbortAction #38056

Merged
merged 2 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/platform/nxp/common/ota/OTAFirmwareProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ CHIP_ERROR OTAFirmwareProcessor::ApplyAction()
CHIP_ERROR OTAFirmwareProcessor::AbortAction()
{
OTA_CancelImage();
OTA_ServiceDeInit();

Clear();

return CHIP_NO_ERROR;
Expand Down
11 changes: 6 additions & 5 deletions src/platform/nxp/common/ota/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,13 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)

ConfigurationManagerImpl().StoreSoftwareUpdateCompleted();
PlatformMgr().HandleServerShuttingDown();

// Set the necessary information to inform the SSBL that a new image is available
// and trigger the actual device reboot after some time, to take into account
// queued actions, e.g. sending events to a subscription
/*
* Set the necessary information to inform the SSBL/bootloader that a new image
* is available and trigger the actual device reboot after some time, to take
* into account queued actions, e.g. sending events to a subscription.
*/
SystemLayer().StartTimer(
chip::System::Clock::Milliseconds32(CHIP_DEVICE_LAYER_OTA_REBOOT_DELAY),
chip::System::Clock::Milliseconds32(imageProcessor->mDelayBeforeRebootSec * 1000 + CHIP_DEVICE_LAYER_OTA_REBOOT_DELAY),
[](chip::System::Layer *, void *) { OtaHookReset(); }, nullptr);
}

Expand Down
Loading