Merge branch 'feature/nvs_fd_support' into 'master'

feat(nvs_flash): Added support for storing flash and double types

Closes IDFGH-9857

See merge request espressif/esp-idf!47045
This commit is contained in:
Radek Tandler
2026-04-15 11:03:57 +02:00
12 changed files with 1146 additions and 21 deletions
+4 -1
View File
@@ -35,6 +35,7 @@ NVS operates on key-value pairs. Keys are ASCII strings; the maximum key length
- integer types: ``uint8_t``, ``int8_t``, ``uint16_t``, ``int16_t``, ``uint32_t``, ``int32_t``, ``uint64_t``, ``int64_t``
- zero-terminated string
- variable length binary data (blob)
- floating point types: ``float`` and ``double``
.. note::
@@ -48,7 +49,9 @@ NVS operates on key-value pairs. Keys are ASCII strings; the maximum key length
Before setting new or updating existing key-value pair, free entries in nvs pages have to be available. For integer types, at least one free entry has to be available. For the string value, at least one page capable of keeping the whole string in a contiguous row of free entries has to be available. For the blob value, the size of new data has to be available in free entries.
Additional data types, such as ``float`` and ``double`` might be added later.
.. note::
The floating point types ``float`` and ``double`` are supported regardless of the FPU presence on a particular SoC.
Keys are required to be unique. Assigning a new value to an existing key replaces the old value and data type with the value and data type specified by a write operation.
@@ -35,6 +35,7 @@ NVS 的操作对象为键值对,其中键是 ASCII 字符串,当前支持的
- 整数型:``uint8_t````int8_t````uint16_t````int16_t````uint32_t````int32_t````uint64_t````int64_t``
- 以 0 结尾的字符串;
- 可变长度的二进制数据 (BLOB)
- 浮点类型:``float````double``
.. note::
@@ -48,7 +49,9 @@ NVS 的操作对象为键值对,其中键是 ASCII 字符串,当前支持的
在设置新的键值对或更新现有键值对之前,NVS 页中必须有可用的空闲条目。对于整数类型,至少需要有一个空闲条目。对于字符串值,至少需要一个能够将整个字符串连续存储在空闲条目中的页面。对于 blob 值,空闲条目中需要有足够空间容纳新数据的大小。
其他数据类型,例如 ``float````double``,可能会在以后添加。
.. note::
无论特定 SoC 上是否存在 FPU,均支持浮点类型 ``float````double``
键必须唯一。为现有的键写入新值时,会将旧的值及数据类型更新为写入操作指定的值和数据类型。