Skip to content

Commit

Permalink
Adds changes for the multi-ota updated
Browse files Browse the repository at this point in the history
  • Loading branch information
shgutte committed Feb 24, 2025
1 parent a3dd261 commit 293f69c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 47 deletions.
37 changes: 2 additions & 35 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,44 +91,11 @@ config("siwx917-common-config") {
defines += [ "HEAP_MONITORING" ]
}

ldflags = [ "-Wl,--no-warn-rwx-segment" ]
}

config("silabs-wifi-config") {
defines = []
include_dirs = []

if (chip_default_wifi_ssid != "") {
defines += [
"SL_ONNETWORK_PAIRING=1",
"SL_WIFI_SSID=\"${chip_default_wifi_ssid}\"",
]
}
if (chip_default_wifi_psk != "") {
assert(chip_default_wifi_ssid != "",
"ssid can't be null if psk is provided")
defines += [ "SL_WIFI_PSK=\"${chip_default_wifi_psk}\"" ]
}

if (sl_wfx_config_softap) {
defines += [ "SL_WFX_CONFIG_SOFTAP" ]
}

if (sl_wfx_config_scan) {
defines += [ "SL_WFX_CONFIG_SCAN" ]
}

if (chip_enable_wifi_ipv4) {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
}

if (rs91x_wpa3_transition) {
defines += [ "WIFI_ENABLE_SECURITY_WPA3_TRANSITION=1" ]
}

if (chip_enable_multi_ota_requestor) {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_MULTI_OTA_REQUESTOR=1" ]
}

ldflags = [ "-Wl,--no-warn-rwx-segment" ]
}

source_set("siwx917-common") {
Expand Down
9 changes: 1 addition & 8 deletions src/platform/silabs/multi-ota/OTAMultiImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,12 @@ void OTAMultiImageProcessorImpl::HandleApply(intptr_t context)
imageProcessor->mAccumulator.Clear();

ChipLogProgress(SoftwareUpdate, "HandleApply: Finished");

<<<<<<< HEAD
<<<<<<< HEAD
// This reboots the device
=======
// TODO: check where to put this
// ConfigurationManagerImpl().StoreSoftwareUpdateCompleted();
=======
>>>>>>> 306094209f (Cleanup of the code)
#ifndef SLI_SI91X_MCU_INTERFACE // required for 917 NCP
>>>>>>> ac92393594 (Added changes for the build errores)
CORE_CRITICAL_SECTION(bootloader_rebootAndInstall();)
#endif
// ConfigurationManagerImpl().StoreSoftwareUpdateCompleted();
}

CHIP_ERROR OTAMultiImageProcessorImpl::ReleaseBlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <platform/silabs/multi-ota/SiWx917/OTAWiFiFirmwareProcessor.h>

#include <app/clusters/ota-requestor/OTARequestorInterface.h>
#include "wfx_host_events.h"
#include <platform/silabs/SilabsConfig.h>
#ifdef __cplusplus
extern "C" {
Expand All @@ -37,7 +36,7 @@ extern "C" {
#define RPS_HEADER 1
#define RPS_DATA 2

#define SL_STATUS_FW_UPDATE_DONE SL_STATUS_SI91X_NO_AP_FOUND
#define SL_STATUS_FW_UPDATE_DONE SL_STATUS_SI91X_FW_UPDATE_DONE
uint8_t flag = RPS_HEADER;

namespace chip {
Expand All @@ -47,7 +46,7 @@ bool OTAWiFiFirmwareProcessor::mReset

CHIP_ERROR OTAWiFiFirmwareProcessor::Init()
{
ReturnErrorCodeIf(mCallbackProcessDescriptor == nullptr, CHIP_OTA_PROCESSOR_CB_NOT_REGISTERED);
VerifyOrReturnError(mCallbackProcessDescriptor != nullptr, CHIP_OTA_PROCESSOR_CB_NOT_REGISTERED);
mAccumulator.Init(sizeof(Descriptor));
#if OTA_ENCRYPTION_ENABLE
mUnalignmentNum = 0;
Expand Down Expand Up @@ -162,7 +161,7 @@ CHIP_ERROR OTAWiFiFirmwareProcessor::ApplyAction()
// send system reset request to reset the MCU and upgrade the m4 image
ChipLogProgress(SoftwareUpdate, "SoC Soft Reset initiated!");
// Reboots the device
sl_si91x_soc_soft_reset();
sl_si91x_soc_nvic_reset();
#endif
}
return CHIP_NO_ERROR;
Expand Down

0 comments on commit 293f69c

Please sign in to comment.