Page 1 of 1

Esp32S3 : How much time can I write an entry in NVS ?

Posted: Thu Jan 18, 2024 11:11 am
by ThomasESP32
Good morning,

I am working with an Esp32S3 and I have created a NVS in order to store datas.
In this NVS, I have declared an etry, let's call it "Entry1".
Its type is uint16.

I would like to know how much time I can write something in this entry.
Is there a max write number due to the fact that the entry is written in flash ?

Do you have any idea please ?

Thank you for your ehlp,
Best regards,

Thomas TRUILHE

Re: Esp32S3 : How much time can I write an entry in NVS ?

Posted: Thu Jan 18, 2024 12:15 pm
by MicroController
NVS uses a form of wear-levelling, so the number should be about
(Size of NVS partion)/(size of entry in flash, inkl. metadata) * (flash max writes),
where flash max writes is commonly spec'd as 100000 erase/writes.

Re: Esp32S3 : How much time can I write an entry in NVS ?

Posted: Thu Jan 18, 2024 12:59 pm
by ThomasESP32
So,
I my partition is 0x19000 = 102400 bytes.
And if my entry takes 3 entries positions in NVS (Because it is an array of bytes).

Do you think the result should be :
1) (102400/32) * 100000 = 320000000 => Here because an entry is 32 bytes.

2) (102400/96) * 100000 = 106600000 => Here because an entry is 32 bytes and my entry takes 3 positions.

What is the correct result please ?

Thank you,

Re: Esp32S3 : How much time can I write an entry in NVS ?

Posted: Fri Jan 19, 2024 9:21 am
by MicroController
Its type is uint16.
https://docs.espressif.com/projects/esp ... e-of-entry
For values of primitive types (currently integers from 1 to 8 bytes long), entry holds one key-value pair.
So one entry per integer.