NVS write frequency analysis

cmorgan
Posts: 89
Joined: Thu Aug 24, 2017 12:52 am

NVS write frequency analysis

Postby cmorgan » Sat Jan 06, 2018 3:14 am

Hello.

The wifi subsystem can store its settings in nvs. In my case I'm switching between AP and STA and APSTA modes during a scanning process, due to the limitations of the SoftAP.

What I'm wondering is how to prove that I'm not wearing out the nvs. I'm pretty sure I'm not, and I could instrument my code but I was looking for ram based write counters in the nvs code that could help. Something where for each byte written and each separate nvs commit a counter would be incremented. This wouldn't persist across boots but would let me periodically check the rate of data written.

There doesn't appear to be any api like this in the documentation https://esp-idf.readthedocs.io/en/lates ... flash.html

Chris

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

Re: NVS write frequency analysis

Postby WiFive » Sat Jan 06, 2018 3:39 am

Can you call esp_wifi_set_storage while wifi is running to use ram for temporary mode changes ?

cmorgan
Posts: 89
Joined: Thu Aug 24, 2017 12:52 am

Re: NVS write frequency analysis

Postby cmorgan » Sat Jan 06, 2018 2:50 pm

I'd still like the changes (for instance the ssid, passphrase etc) to persist across power cycles.

Possible to use a power down isr to switch the mode to flash and save before power completely went away?

I'm assuming that the whole wifi nvs is rewritten if the mode changes but that may not be the case, or maybe changing the mode doesn't change nvs at all.

That's why I was looking to instrument the nvs writes/commits, it would give me a close view of what is being written to flash.

Who is online

Users browsing this forum: No registered users and 113 guests