Skip to content

Commit

Permalink
[nrf noup] Lock thread stack before factory reset
Browse files Browse the repository at this point in the history
This commit fix problem with thread activity interupting factory reset.
This activity used to lead to "Factory reset fail: -6".
Writing to cleared nvm flash pages caused the problem.

Signed-off-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no>
  • Loading branch information
LipinskiPNordicSemi committed Jan 19, 2024
1 parent b6a5e9a commit 39d62ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/Zephyr/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
{
ChipLogProgress(DeviceLayer, "Performing factory reset");

ConnectivityMgr().ErasePersistentInfo();

#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS
void * storage = nullptr;
int status = settings_storage_get(&storage);
Expand All @@ -197,8 +199,6 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
{
ChipLogError(DeviceLayer, "Factory reset failed: %" CHIP_ERROR_FORMAT, err.Format());
}

ConnectivityMgr().ErasePersistentInfo();
#endif

PlatformMgr().Shutdown();
Expand Down

0 comments on commit 39d62ec

Please sign in to comment.