From 51e7de24d4c048038dce8f226d707b709ca3a8be Mon Sep 17 00:00:00 2001 From: senthilku Date: Fri, 24 Mar 2023 01:31:01 +0530 Subject: [PATCH] [silabs] Fix to SiWx917 SoC Auto MCU Reset issue (#25755) * Fix to SiWx917 SoC MCU Reset issue * use nvm3_lock weak implementation for 917SoC * applied restyle * SoC header file is removed --- src/platform/silabs/SilabsConfig.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platform/silabs/SilabsConfig.cpp b/src/platform/silabs/SilabsConfig.cpp index 1d5fab99c71e5b..c887e6f2d0ac8c 100644 --- a/src/platform/silabs/SilabsConfig.cpp +++ b/src/platform/silabs/SilabsConfig.cpp @@ -35,6 +35,7 @@ #include "nvm3_hal_flash.h" #include +#ifndef BRD4325A // TODO: fix semaphore usage in nvm3_lock for siwx917. use weak implementation for that board instead // Substitute the GSDK weak nvm3_lockBegin and nvm3_lockEnd // for an application controlled re-entrance protection static SemaphoreHandle_t nvm3_Sem; @@ -51,6 +52,7 @@ void nvm3_lockEnd(void) VerifyOrDie(nvm3_Sem != NULL); xSemaphoreGive(nvm3_Sem); } +#endif // not BRD4325A namespace chip { namespace DeviceLayer { @@ -63,6 +65,7 @@ namespace Internal { CHIP_ERROR SilabsConfig::Init() { +#ifndef BRD4325A // TODO: fix semaphore usage in nvm3_lock for siwx917. use weak implementation for that board instead nvm3_Sem = xSemaphoreCreateBinaryStatic(&nvm3_SemStruct); if (nvm3_Sem == NULL) @@ -70,12 +73,15 @@ CHIP_ERROR SilabsConfig::Init() return CHIP_ERROR_NO_MEMORY; } xSemaphoreGive(nvm3_Sem); +#endif // not BRD4325A return MapNvm3Error(nvm3_open(nvm3_defaultHandle, nvm3_defaultInit)); } void SilabsConfig::DeInit() { +#ifndef BRD4325A // TODO: fix semaphore usage in nvm3_lock for siwx917. use weak implementation for that board instead vSemaphoreDelete(nvm3_Sem); +#endif // not BRD4325A nvm3_close(nvm3_defaultHandle); }