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

ThomasESP32
Posts: 214
Joined: Thu Jul 14, 2022 5:15 am

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

Postby ThomasESP32 » Thu Jan 18, 2024 11:11 am

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

MicroController
Posts: 1605
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Thu Jan 18, 2024 12:15 pm

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.

ThomasESP32
Posts: 214
Joined: Thu Jul 14, 2022 5:15 am

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

Postby ThomasESP32 » Thu Jan 18, 2024 12:59 pm

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,

MicroController
Posts: 1605
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Fri Jan 19, 2024 9:21 am

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.

Who is online

Users browsing this forum: No registered users and 79 guests