Skip to content

Commit

Permalink
[Telink]: Added a clear explanation for preventing NVS writing on shu…
Browse files Browse the repository at this point in the history
…tdown

Signed-off-by: Misha Tkachenko <misha.tkachenko@telink-semi.com>
  • Loading branch information
mishadesh committed May 25, 2023
1 parent ba3273b commit 2222b74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ CHIP_ERROR AppTaskCommon::InitCommonParts(void)
#endif

// We need to disable OpenThread to prevent writing to the NVS storage when factory reset occurs
// The OpenThread thread is running during factory reset. The nvs_clear function is called during
// factory reset, which makes the NVS storage innaccessible, but the OpenThread knows nothing
// about this and tries to store the parameters to NVS. Because of this the OpenThread need to be
// shut down before NVS. This delegate fixes the issue "Failed to store setting , ret -13",
// which means that the NVS is already disabled.
// For this the OnShutdown function is used
PlatformMgr().SetDelegate(new PlatformMgrDelegate);

Expand Down

0 comments on commit 2222b74

Please sign in to comment.