Hello,
due to what I understood from doc's data storage is 32bytes long. Can I use NVS in v4.4 to store data for example 8bytes long to save storage size or its irrelevant due to 32bytes long value storage ?
happy new year!
NVS minimal data storage
NVS minimal data storage
Programming in C and JS using ESP-IDF on esp32-d0wd-v3
Re: NVS minimal data storage
Hello,
In short: no, you cannot "only" use 8 bytes of data.
Each entry for integer types is 32 bytes long, because it contains the key (15 bytes + NULL), some additional meta data like e.g. the corresponding namespace, type, etc. and it also contains the data (8 bytes). Hence, every integer type entry uses 32 bytes, no matter what type.
If you use string or blob type entries, this is different, because the data is saved in the space adjacent to the entry in that case. Here you can indeed save data, but only multiples of 32 bytes. In other words, the size will in crease in 32-byte steps corresponding to the size of the data. For more information, please have a look at the NVS documentation: https://docs.espressif.com/projects/esp ... e-of-entry.
Best and happy new year, too,
Jakob
In short: no, you cannot "only" use 8 bytes of data.
Each entry for integer types is 32 bytes long, because it contains the key (15 bytes + NULL), some additional meta data like e.g. the corresponding namespace, type, etc. and it also contains the data (8 bytes). Hence, every integer type entry uses 32 bytes, no matter what type.
If you use string or blob type entries, this is different, because the data is saved in the space adjacent to the entry in that case. Here you can indeed save data, but only multiples of 32 bytes. In other words, the size will in crease in 32-byte steps corresponding to the size of the data. For more information, please have a look at the NVS documentation: https://docs.espressif.com/projects/esp ... e-of-entry.
Best and happy new year, too,
Jakob
Who is online
Users browsing this forum: No registered users and 110 guests