Add NVS partition reset to ESP factory reset #1294
Merged
+8
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NVS partition is not touched by software initiated factory reset, so clearing out bluetooth bonding files can be only done with a flash erase now.
We should format NVS partition too to clear out everything, to match nRF factory reset behaviour.
Also disable serial interface when issuing factory reset command, because now the code re-start advertising when the phone app disconnects (so we are advertising during format)
Full debug from a xiao c3 from issuing the factory reset command to reboot:
[2025-12-31 13:29:07.2412 BLE: readBytes: sz=6, hdr=51
[2025-12-31 13:29:07.2415 DEBUG: Factory reset: disabling serial interface to prevent reconnects (BLE/WiFi)
[2025-12-31 13:29:07.2416 BLE: SerialBLEInterface: disable
[2025-12-31 13:29:07.2430 [310655][E][esp32-hal-misc.c:128] disableCore0WDT(): Failed to remove Core 0 IDLE task from WDT
[2025-12-31 13:29:07.2915 BLE: SerialBLEInterface: disconnected conn_handle=1 reason=0x216 (initiated by remote)
[2025-12-31 13:29:22.9804 ESP-ROM:esp32c3-api1-20210207