Skip to content

Commit

Permalink
[silabs] Fix to SiWx917 SoC Auto MCU Reset issue (#25755)
Browse files Browse the repository at this point in the history
* Fix to SiWx917 SoC MCU Reset issue

* use nvm3_lock weak implementation for 917SoC

* applied restyle

* SoC header file is removed
  • Loading branch information
senthilku authored and pull[bot] committed Sep 8, 2023
1 parent c134f1d commit 1100736
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/platform/silabs/SilabsConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "nvm3_hal_flash.h"
#include <nvm3_lock.h>

#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;
Expand All @@ -51,6 +52,7 @@ void nvm3_lockEnd(void)
VerifyOrDie(nvm3_Sem != NULL);
xSemaphoreGive(nvm3_Sem);
}
#endif // not BRD4325A

namespace chip {
namespace DeviceLayer {
Expand All @@ -63,19 +65,23 @@ 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)
{
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);
}

Expand Down

0 comments on commit 1100736

Please sign in to comment.