Purpose of esp32 nvs_flash_deinit()?

Xylopyrographer
Posts: 14
Joined: Sat Mar 06, 2021 12:39 am

Purpose of esp32 nvs_flash_deinit()?

Postby Xylopyrographer » Sat Mar 06, 2021 11:12 pm

In working with the NVS system, I'm looking to understand what the

Code: Select all

 nvs_flash_deinit()
call actually does to the NVS partition.

To "reset' the NVS partition, the sequence:

Code: Select all

nvs_flash_erase();
nvs_flash_init();
makes sense.

But the sequence:

Code: Select all

nvs_flash_deinit();
nvs_flash_init();
(used against an existing NVS partition that had namespaces and key:value pairs in use within it) seems to have no effect, leaving the contents of the NVS partition as it was before the call.

So what is nvs_flash_deinit() doing?

Thanks.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Purpose of esp32 nvs_flash_deinit()?

Postby WiFive » Sun Mar 07, 2021 7:07 am

It is not doing anything to the partition, it is deiniting the *access* to the partition, like unmounting. Maybe you want to use nvs_erase_all

Xylopyrographer
Posts: 14
Joined: Sat Mar 06, 2021 12:39 am

Re: Purpose of esp32 nvs_flash_deinit()?

Postby Xylopyrographer » Wed May 12, 2021 3:32 am

Thanks for the reply. That makes sense.
Excuse the long delay. New to this board. It doesn't' send notifications on replies?

Who is online

Users browsing this forum: Bing [Bot], Mattgo and 93 guests