Lines Matching +full:all +full:- +full:ones
5 Zephyr Memory Storage is a new key-value storage system that is designed to work with all types
6 of non-volatile storage technologies. It supports classical on-chip NOR flash as well as new
7 technologies like RRAM and MRAM that do not require a separate erase operation at all, that is,
12 ZMS divides the memory space into sectors (minimum 2), and each sector is filled with key-value
15 The key-value pair is divided into two parts:
17 - The key part is written in an ATE (Allocation Table Entry) called "ID-ATE" which is stored
19 - The value part is defined as "data" and is stored raw starting from the top of the sector.
26 N+1 empty sector, we erase the garbage-collected sector and then we close the current sector by
37 .. list-table::
39 :header-rows: 1
41 * - Sector 0 (closed)
42 - Sector 1 (open)
43 - Sector 2 (empty)
44 * - Data_a0
45 - Data_b0
46 - Data_c0
47 * - Data_a1
48 - Data_b1
49 - Data_c1
50 * - Data_a2
51 - Data_b2
52 - Data_c2
53 * - GC_done
54 - .
55 - .
56 * - .
57 - .
58 - .
59 * - .
60 - .
61 - .
62 * - .
63 - ID ATE_b2
64 - ID ATE_c2
65 * - ID ATE_a2
66 - ID ATE_b1
67 - ID ATE_c1
68 * - ID ATE_a1
69 - ID ATE_b0
70 - ID ATE_c0
71 * - ID ATE_a0
72 - GC_done ATE
73 - GC_done ATE
74 * - Close ATE (cyc=1)
75 - Close ATE (cyc=1)
76 - Close ATE (cyc=1)
77 * - Empty ATE (cyc=1)
78 - Empty ATE (cyc=2)
79 - Empty ATE (cyc=2)
88 ``GC_done ATE`` is written to indicate that the next sector has already been garbage-collected.
91 ``ID ATE`` are entries that contain a 32-bit key and describe where the data is stored, its
94 ``Data`` is the actual value associated to the ID-ATE.
108 .. code-block:: c
115 * erase-blocks if the device has erase capabilities
128 As ZMS has a fast-forward write mechanism, it must find the last sector and the last pointer of
137 To avoid rewriting the same data with the same ID again, ZMS must look in all the sectors if the
148 By default ZMS looks for the last data with the same ID by browsing through all stored ATEs from
149 the most recent ones to the oldest ones. If it finds a valid ATE with a matching ID it retrieves
157 However, this operation is very time-consuming as it needs to browse through all valid ATEs
158 in all sectors of the partition and for each valid ATE try to find if an older one exists.
159 It is not recommended for applications to use this function often, as it is time-consuming and
165 Each sector has a lead cycle counter which is a ``uin8_t`` that is used to validate all the other
173 All the ATEs in that sector become invalid.
180 When closing a sector, all the remaining space that has not been used is filled with garbage data
189 This operation is time-consuming and will cause some applications to not meet their real time
207 enabled will make all existing data invalid.
209 Available space for user data (key-value pairs)
214 key-value pairs and keep one sector empty to be able to perform GC.
230 …\small\frac{(NUM\_SECTORS - 1) \times (SECTOR\_SIZE - (5 \times ATE\_SIZE)) \times (DATA\_SIZE)}{A…
244 For example for 4 sectors of 1024 bytes, free space for 8-byte length data is :math:`\frac{3 \times…
258 Each key-value pair needs an extra 16 bytes for the ATE, which makes it possible to store 11 pairs
272 As an example, to erase a 4096-byte sector on devices that do not require an erase operation
273 using NVS, 256 flash writes must be performed (supposing that ``write-block-size`` = 16 bytes), whi…
282 See `Available space for user data <#available-space-for-user-data-key-value-pairs>`_.
295 Let's suppose that we store an 8-byte variable using the same ID but its content changes every
298 As we have 944 bytes available for ATEs for each sector, and because ZMS is a fast-forward
303 from old sectors to new ones.
315 having the garbage collector moving blocks all the time.
325 ``SECTOR_EFFECTIVE_SIZE``: The sector size - header size (80 bytes)
344 ---------
345 - Supports storage devices that do not require an erase operation (only one write operation
347 - Supports large partition and sector sizes (64-bit address space)
348 - Supports 32-bit IDs
349 - Small-sized data (<= 8 bytes) are stored in the ATE itself
350 - Built-in data CRC32 (included in the ATE)
351 - Versioning of ZMS (to handle future evolutions)
352 - Supports large ``write-block-size`` (only for platforms that need it)
357 - Add multiple format ATE support to be able to use ZMS with different ATE formats that satisfies
359 - Add the possibility to skip garbage collector for some application usage where ID/value pairs
362 - Divide IDs into namespaces and allocate IDs on demand from application to handle collisions
364 - Add the possibility to retrieve the wear out value of the device based on the cycle count value
365 - Add a recovery function that can recover a storage partition if something went wrong
366 - Add a library/application to allow migration from NVS entries to ZMS entries
367 - Add the possibility to force formatting the storage partition to the ZMS format if something
373 but simpler, non-hierarchical ones).
379 - If you are using devices that do not require an erase operation like RRAM or MRAM, :ref:`ZMS <zms…
382 - For devices that have a large ``write_block_size`` and/or need a sector size that is different th…
385 - For classical flash technology devices, :ref:`NVS <nvs_api>` is recommended as it has low footpri…
389 - If your application needs more than 64K IDs for storage, :ref:`ZMS <zms_api>` is recommended here…
390 has a 32-bit ID field.
391 - If your application is working in a FIFO mode (First-in First-out) then :ref:`FCB <fcb_api>` is
394 More generally to make the right choice between NVS and ZMS, all the blockers should be first
397 life expectancy of the device described in this section: `Wear leveling <#wear-leveling>`_.
405 - The total size of the storage partition should be set appropriately to achieve the best
407 All the information regarding the effectively available free space in ZMS can be found
408 …documentation. See `Available space for user data <#available-space-for-user-data-key-value-pairs>…
409 It's recommended to choose a storage partition size that is double the size of the key-value pairs
411 - The sector size needs to be set such that a sector can fit the maximum data size that will be
417 - For some subsystems like :ref:`Settings <settings_api>`, all path-value pairs are split into two …
420 - Storing small data (<= 8 bytes) in ZMS entries can increase the performance, as this data is
428 - When using the ZMS API directly, the recommendation for the cache size is to make it at least
430 - Each additional cache entry will add 8 bytes to your RAM usage. Cache size should be carefully
432 - If you use ZMS through :ref:`Settings <settings_api>`, you have to take into account that each Se…