Factory Reset & Un-provisioning API's in nCS

Hi Team,

We're using nrf52833, nCS V1.9.1 need information on for following things,

1. We need information on API from nCS SDK which un-provision's the device and reset's the BLE connection

2. Information on API which clear's / erases SDK data stored in NV

3. When device is already provisioned using nRF Mesh application, to un-provision the device user needs to press Reset device in mobile app, we want to know what exactly happens in backend when we press reset device does it just reset's the provisioning information / clears its internal memory as well.

Thank you,

Regards,

Hitesh

  • I see.

    bt_mesh_cfg_node_reset will make a node to reset only mesh settings in settings subsystem. If there are any other settings stored in settings subsystem, they won't be touched. Another thing is that the mesh settings won't be erased from the flash, but will be marked as deleted (until garbage collector is called).

    If you want to completely erase the settings partition, then there is no such API in settings subsystem. But I think what they can do is to catch when a node is reset by assigning a callback to struct bt_mesh_prov.reset, then initialise `struct nvs_fs` like it is done in `zephyr/samples/subsys/nvs` sample and then call `nvs_clear`. But I'm not sure if it is correct to clear the storage while settings subsystem is initialised. Maybe you will either need to reboot the device right after calling `nvs_clear` or first reboot the device after reset and then clear the settings partition before initalizing the settings subsystem.

    Let me know if you want to go for this option and want me to look further into it.

    Regards,

    Elfving

Related