-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Check if factory reset occurs in app? (IDFGH-9379) #10753
Comments
Unfortunately I don't think there's anything significantly simpler in terms of the underlying implementation. You could replace an NVS partition with a single-sector data partition, and write data into it as a token of the "first boot". But if you are using NVS for any other purpose, it's probably easier to reuse that partition and store the "first boot" token there. |
@igrr Thanks for confirming! |
I personally use a boot count. I increment the nvs boot count setting on each boot. If zero, i know it's the first boot after reset. |
Thanks for your suggestion! |
Is your feature request related to a problem?
I need to perform some extra initialization after factory reset. I want to check if factory reset occurs in the app.
Describe the solution you'd like.
Provide an API to tell if this is the first boot-up after factory reset.
Describe alternatives you've considered.
I have considered using a dummy nvs partition that will be set after boot. On factory reset this partition will be erased, so that the app will know this is the first boot after factory reset. However, this solution seems a bit tedious.
Additional context.
No response
The text was updated successfully, but these errors were encountered: