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

How to Only Reset Matter and Matter related nvs data (CON-1529) #1259

Open
bilalahmaddev opened this issue Jan 25, 2025 · 3 comments
Open

How to Only Reset Matter and Matter related nvs data (CON-1529) #1259

bilalahmaddev opened this issue Jan 25, 2025 · 3 comments

Comments

@bilalahmaddev
Copy link

Is there any API to reset Matter only and Matter related nvs Data?

@github-actions github-actions bot changed the title How to Only Reset Matter and Matter related nvs data How to Only Reset Matter and Matter related nvs data (CON-1529) Jan 25, 2025
@shubhamdp
Copy link
Contributor

Can you elaborate more on "only reset matter and matter related nvs data"? Do you mean to only erase the matter specific data? Or are you expecting anything more?

esp_matter::factory_reset(), only erases the Matter specific data, but this resets the device (i.e. reboot).

@bilalahmaddev
Copy link
Author

@shubhamdp I am using same API when I flash code first time and run TC-RR-1.1 it passes the test and next time when I perform factory reset using this API esp_matter::factory_reset(), test case fails on timeout error on step 14.

@shubhamdp
Copy link
Contributor

Can you please try this, replace the ConfigurationMgr().InitiateFactoryReset(); with chip::Server::GetInScheduleFactoryReset() here https://github.com/espressif/esp-matter/blob/main/components/esp_matter/esp_matter_core.cpp#L894.

Below patch does the same...

diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp
index 0a578a1..f426401 100644
--- a/components/esp_matter/esp_matter_core.cpp
+++ b/components/esp_matter/esp_matter_core.cpp
@@ -891,7 +891,7 @@ esp_err_t factory_reset()
     }

     /* Submodule factory reset. This also restarts after completion. */
-    ConfigurationMgr().InitiateFactoryReset();
+    chip::Server::GetInstance().ScheduleFactoryReset();
     return err;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants