From 4406491be4b87c6f43d781366b3d8c64d1814d0a Mon Sep 17 00:00:00 2001 From: Patryk Lipinski Date: Fri, 19 Jan 2024 15:37:43 +0100 Subject: [PATCH] [nrf noup] Lock thread stack before factory reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fix a problem with thread activity interrupting factory reset. This activity used to led to “Factory reset fail: -6”. Writing to cleared nvm flash pages caused the problem. Signed-off-by: Patryk Lipinski --- src/platform/Zephyr/ConfigurationManagerImpl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index 69e82aba22..6957c9b4ea 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -176,6 +176,7 @@ void ConfigurationManagerImpl::RunConfigUnitTest(void) void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) { ChipLogProgress(DeviceLayer, "Performing factory reset"); + ThreadStackManager().LockThreadStack(); #ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS void * storage = nullptr;