<?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>NCS MCUboot and NVS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98868/ncs-mcuboot-and-nvs</link><description>NCS: 2.3.0 
 OS: Windows 10I have a question regarding how NVS is managed with MCUboot enabled. So the way I understand it, when MCUboot is enabled, it automatically enabled partition manager. This means all the flash partitions in the device tree are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Apr 2023 18:26:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98868/ncs-mcuboot-and-nvs" /><item><title>RE: NCS MCUboot and NVS</title><link>https://devzone.nordicsemi.com/thread/421319?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 18:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e31bfafb-0312-4dd6-9a89-0ce087259477</guid><dc:creator>Bryan</dc:creator><description>&lt;p&gt;Hieu,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I retested and confirmed that I do NOT have to keep the dts file in sync.&amp;nbsp; That makes much more sense.&amp;nbsp; My mistake.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for the detailed information.&amp;nbsp; That will be a very useful post to others.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS MCUboot and NVS</title><link>https://devzone.nordicsemi.com/thread/421284?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 14:02:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9011fecd-f0fd-49b0-8dac-40fb13366f42</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Bryan,&lt;/p&gt;
[quote user=""]Can someone give a thorough explanation of &amp;quot;how&amp;quot; NVS is managed when MCUboot is enabled and how it should be properly configured?[/quote]
&lt;p&gt;To my understanding, NVS works the same way it always does. It is the partition that NVS will be initialized on that would be changed, which I understand is what you are asking by &amp;quot;how it should be properly configured.&amp;quot;&lt;/p&gt;
&lt;p&gt;From this point on, I will explain with information from NCS v2.3.0. The same details for older version of NCS should be the same or inferable from that.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;way the partitions are created is detailed in the Partition Manager documentation:&amp;nbsp;&lt;br /&gt;Link:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/scripts/partition_manager/partition_manager.html"&gt;Partition Manager — nRF Connect SDK 2.3.0 documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When the Partition Manager is active, it overrides the partitions defined in DTS automatically. This is done by replacing&amp;nbsp;Zephyr&amp;nbsp;macros&amp;#39; &lt;em&gt;implementations&lt;/em&gt;&amp;nbsp;based on DTS with that based on Partition Manager.&lt;br /&gt;Refer:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs2/include/zephyr/storage/flash_map.h#L260-L262"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs2/include/zephyr/storage/flash_map.h#L260-L262&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By default, when created automatically, a partition named nvs_storage is always created.&lt;br /&gt;Refer:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/subsys/partition_manager/pm.yml.nvs"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/subsys/partition_manager/pm.yml.nvs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the macro implementation replacement mentioned above, the default name of the storage partition in Zephyr is also replaced with &amp;quot;nvs_storage.&amp;quot;&amp;nbsp;&lt;br /&gt;Refer:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/include/flash_map_pm.h#L36-L39"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/include/flash_map_pm.h#L36-L39&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;size of this partition is configurable with CONFIG_PM_PARTITION_SIZE_NVS_STORAGE, the default size is 0x6000.&lt;br /&gt;Refer:&lt;br /&gt;Default size: &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/subsys/partition_manager/Kconfig#L71-L76"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/subsys/partition_manager/Kconfig#L71-L76&lt;/a&gt;.&lt;br /&gt;Kconfig definition:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/subsys/partition_manager/Kconfig.template.partition_config"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/subsys/partition_manager/Kconfig.template.partition_config&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;It is a little weird that you said you need to keep &lt;em&gt;#2. DTS&lt;/em&gt; file in sync with &lt;em&gt;#1. Project Config&lt;/em&gt; and &lt;em&gt;#3. Code&lt;/em&gt;. Are you certain that if you&amp;nbsp;desync DTS with the rest, the setup will break?&lt;/p&gt;
[quote user=""]This does not seem to be the case for NVS storage.&amp;nbsp; I want to limit the size of NVS to as small as possible so as much flash can be used MCUboot as possible.&amp;nbsp; I was told in another devzone post that the smallest number of flash pages that can be used is &lt;strong&gt;two&lt;/strong&gt; (each page is 4096 bytes).&amp;nbsp; One for data and one for swap.&lt;br /&gt;&lt;br /&gt;devzone.nordicsemi.com/.../quote]
&lt;p&gt;This is right,&amp;nbsp;please keep that in mind when tuning with&amp;nbsp;&lt;span&gt;CONFIG_PM_PARTITION_SIZE_NVS_STORAGE.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>