v2.1.1-ncs5-snapshot: [nrf fromtree] Protected Storage: Do not align NV counters in init
·
1253 commits
to main
since this release
NVC_2 and NVC_3 should not be aligned to NVC_1 unless the object table has been successfully stored to persistent memory. When storing an object to PS, the object is stored first and the object table is updated afterwards. If there is not enough memory for the object table, NVC_1 is increased, but NVC_2 and NVC_3 are not. Reset the device. Object table is validated with NVC_3. Now, if NVC_2 and NVC_3 are brought to be on par with NVC_1 and the object table is not saved and the device is reset again, the object table can no longer be validated. New object tables are created, which loses all the data stored to PS. Change-Id: I9eb680d507d5aac251bede586b6c39c751815dcb Signed-off-by: Markus Lassila <[email protected]> (cherry picked from commit c08e9ef89a35a546291af699f378ee9acc661fa7)