<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108051/setting-sub-system-with-nvs-as-backed</link><description>Hi, 
 i am managing some settings parameters for our project through the Setting sub-system with NVS as backed. We are using the SDK version 2.1.1 and soon moving to 2.5.x 
 Reading the documentation regarding the NVS, it states that the metadata have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Feb 2024 14:48:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108051/setting-sub-system-with-nvs-as-backed" /><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467951?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2024 14:48:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be6f5921-fa66-42dd-aaaf-25545d880d62</guid><dc:creator>Riccardo Gaiati</dc:creator><description>&lt;p&gt;Thanks so much Sigurd !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467950?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2024 14:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab67b055-ff92-473e-82f3-43f62ea6051d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;NVS and FCB are upstream Zephyr, so I crated an issue of it there.&lt;br /&gt;I will also mention the issue to our documentation team, and they will consider if this is something they will prioritize&lt;br /&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/68699"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/68699&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467921?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2024 12:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3ad424e-d233-4705-a3c9-e6a97120d50d</guid><dc:creator>Riccardo Gaiati</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;thanks for your reply. I will sort things out.&lt;/p&gt;
&lt;p&gt;Thanks also for the indication of your blog: very interesting !&lt;/p&gt;
&lt;p&gt;One thing: if Nordic could update the documentation, maybe by highlighting the fact that the data ARE NOT crc checked, it would be nice.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Riccardo&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467676?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 07:16:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b0b6522-c6c2-441a-844a-6bf44644528e</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Riccardo Gaiati"]I cannot switch to FCB for backward compatibility. Unless the switch from NVS to FCB happens without problem :) Does it ?[/quote]
&lt;p&gt;I do not imagine that the change is seamless, no. From that, and what you find in the code, looks like FCB might not be the way to go then.&lt;/p&gt;
[quote user="Riccardo Gaiati"]I understand your points and also at the beginning I thought to add 1/2 bytes to every settings to implements crc8/crc16.&amp;nbsp;[/quote]
&lt;p&gt;Yea, looks like you would have to implement something yourself if this is a feature you want.&lt;/p&gt;
&lt;p&gt;Good that you caught that the CRC is only for the metadata. That means I should update my &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/persistent-storage-of-keys-and-data-using-the-nrf-connect-sdk"&gt;blog on storage&lt;/a&gt; to reflect that. &lt;br /&gt;When I read that previously, I thought that the data itself had an integrity check.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467608?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2024 14:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80dd68ae-abc5-4aea-8b34-8ed29760ad44</guid><dc:creator>Riccardo Gaiati</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;thanks so much for the prompt reply and clear explanation.&lt;/p&gt;
&lt;p&gt;I understand your points and also at the beginning I thought to add 1/2 bytes to every settings to implements crc8/crc16.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I cannot switch to FCB for backward compatibility. Unless the switch from NVS to FCB happens without problem :) Does it ?&lt;/p&gt;
&lt;p&gt;I need to check the code of the FCB subsystem, but the entry to me sounds like the metadata in NVS&amp;nbsp; (so the data might not be protected aswell).&lt;/p&gt;
&lt;p&gt;In any case, thanks in advance !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467578?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2024 13:23:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18c7925d-79a9-483a-83a4-75d58e2b3028</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is an issue on this in the Zephyr RTOS: &lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/49937"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/49937&lt;/a&gt;.&lt;br /&gt;As you can see the author is our employee:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5086.pastedimage1707139247813v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If you want to support the fix, you can do so on that issue.&lt;/p&gt;
&lt;p&gt;If you want us to prioritize this, the best way is to rely your desire for this feature to our &lt;a href="https://www.nordicsemi.com/About-us/Contact-Us"&gt;sales team&lt;/a&gt;. We listen to our customers, but we do not have infinite resources and have to prioritize. Demand is one of the factors that impact that.&lt;/p&gt;
&lt;p&gt;For a possible workaround, you can configure settings to use FCB instead: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_SETTINGS_FCB"&gt;CONFIG_SETTINGS_FCB&lt;/a&gt;. &lt;br /&gt;I will leave checking the actual implementation to you, but from the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/storage/fcb/fcb.html"&gt;FCB docs&lt;/a&gt;:&lt;br /&gt;&amp;quot;Entries in the flash are checksummed.&amp;quot;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467576?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2024 13:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:737038c4-68f4-4528-872c-2c313f0bdc77</guid><dc:creator>Riccardo Gaiati</dc:creator><description>&lt;p&gt;Hi Bernard,&lt;/p&gt;
&lt;p&gt;thanks for the prompt answer.&lt;/p&gt;
&lt;p&gt;I kindly disagree on the unlikelihood of this corruption. The problem i see it is not related to when the write of the data and metadata happens, but more if the external flash gets corrupted for hardware problem or an unexpected write operation in the area where the data are stored. In those cases, the framework will return a corrupted value...and the corruption would not be detected.&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting sub-system with NVS as backed</title><link>https://devzone.nordicsemi.com/thread/467534?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2024 10:51:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a7326a2-07c5-42a8-9402-65a43281eb07</guid><dc:creator>Bernard Lee</dc:creator><description>&lt;p&gt;Yes, the data is not protected by CRC. Nevertheless, it is difficult to get metadata correct but data corrupted. See the NVS documentation.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;A write of data to nvs always starts with writing the data, followed by a write of the metadata. Data that is written in flash without metadata is ignored during initialization.&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>