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

[silabs] Fix to SiWx917 SoC Auto MCU Reset issue #25755

Merged
Merged
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
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