-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Silabs] Fix the secure soc reset issue #37965
base: master
Are you sure you want to change the base?
Changes from all commits
f1fcaad
186c7c3
1dd2c28
c61c362
12928c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,6 +20,7 @@ | |||||||||
#include <app/clusters/ota-requestor/OTARequestorInterface.h> | ||||||||||
#include <platform/silabs/OTAImageProcessorImpl.h> | ||||||||||
#include <platform/silabs/SilabsConfig.h> | ||||||||||
#include <platform/silabs/platformAbstraction/SilabsPlatform.h> | ||||||||||
#include <platform/silabs/wifi/WifiInterface.h> | ||||||||||
|
||||||||||
#if CHIP_CONFIG_ENABLE_ICD_SERVER | ||||||||||
|
@@ -42,7 +43,7 @@ extern "C" { | |||||||||
|
||||||||||
uint8_t flag = RPS_HEADER; | ||||||||||
static chip::OTAImageProcessorImpl gImageProcessor; | ||||||||||
|
||||||||||
using namespace chip::DeviceLayer::Silabs; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
namespace chip { | ||||||||||
|
||||||||||
// Define static memebers | ||||||||||
|
@@ -229,7 +230,7 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context) | |||||||||
// 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_nvic_reset(); | ||||||||||
GetPlatform().SoftwareReset(); | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,9 @@ class SilabsPlatformAbstractionBase | |
virtual CHIP_ERROR FlashErasePage(uint32_t addr) { return CHIP_ERROR_NOT_IMPLEMENTED; } | ||
virtual CHIP_ERROR FlashWritePage(uint32_t addr, const uint8_t * data, size_t size) { return CHIP_ERROR_NOT_IMPLEMENTED; } | ||
|
||
// soft reset | ||
virtual void SoftwareReset(void) {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be pure virtual since it is a required function and can we add function comments? |
||
|
||
// BLE Specific Method | ||
|
||
protected: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,8 @@ extern "C" { | |
#endif // SL_SI91X_BOARD_INIT | ||
#include "sl_event_handler.h" | ||
|
||
#include "sl_si91x_hal_soc_soft_reset.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it need to be an extern C include? |
||
|
||
#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT | ||
#include "sl_si91x_button.h" | ||
#include "sl_si91x_button_pin_config.h" | ||
|
@@ -208,6 +210,11 @@ uint8_t SilabsPlatform::GetButtonState(uint8_t button) | |
} | ||
#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT | ||
|
||
void SilabsPlatform::SoftwareReset() | ||
{ | ||
sl_si91x_soc_nvic_reset(); | ||
} | ||
|
||
CHIP_ERROR SilabsPlatform::FlashInit() | ||
{ | ||
return CHIP_NO_ERROR; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.