I'm writing to NVS without commiting the changes and works fine. Why?

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

I'm writing to NVS without commiting the changes and works fine. Why?

Postby chucrut » Thu Jan 05, 2023 7:08 pm

I use nvs_set_i32(...) and then nvs_get_i32(...) and the result is always correct.
I'm not using nvs_commit()

Suppose the data is gone after a power cycle.
Where is the data being stored then?
Because the data is being stored somewhere
Many thanks for your help!

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: I'm writing to NVS without commiting the changes and works fine. Why?

Postby ESP_Sprite » Fri Jan 06, 2023 1:14 am

It's cached in RAM, in all likelihood. It's not guaranteed the writes make it to flash until you call nvs_commit().

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: I'm writing to NVS without commiting the changes and works fine. Why?

Postby mbratch » Tue Jan 10, 2023 12:25 am

chucrut wrote:
Thu Jan 05, 2023 7:08 pm
Suppose the data is gone after a power cycle.
Where is the data being stored then?
Volatile memory

Who is online

Users browsing this forum: Baidu [Spider] and 87 guests