<?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>NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108451/nvs-settings-subsys-custom-partition-placement</link><description>Hi, 
 
 I am working on a project where I use the Settings subsys with the NVS backend. I am using a &amp;quot;provisioning&amp;quot; firmware that is used to initialize the settings partition with default values and to provision the modem with certificates and keys. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Feb 2024 17:58:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108451/nvs-settings-subsys-custom-partition-placement" /><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/471118?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 17:58:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:815599bf-07d9-4a03-bbd3-b251e4f5befd</guid><dc:creator>Zoptune</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your answer.&lt;br /&gt;I keep this ticket open in case you come with updates.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/470459?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 12:54:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b0df7d1-00bb-4a49-bb52-52121ad3f6cd</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like you&amp;#39;re correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your pm_static you can use overlay/dts APIs such as DT_CHOSEN to for instance fetch the devices, but it looks like you can&amp;#39;t use&amp;nbsp;the&amp;nbsp;config-parameters defined such as sizes (for instance&amp;nbsp;&lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt;&lt;span&gt;&amp;nbsp;) seems to not be included in pm_static.yml, but are however included in pm.yml, which are different. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mcuboot_secondary:
  address: 0x0
  device: DT_CHOSEN(nordic_pm_ext_flash)
  end_address: 0xf4000
  placement:
    align:
      start: 0x4
  region: external_flash
  share_size:
  - mcuboot_primary
  size: 0xf4000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will keep looking into this during the next week, but my initial conclusion is atleast what I just said&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/470030?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 13:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c894baea-4c61-43ce-b709-b7820a92d7d6</guid><dc:creator>AHaug</dc:creator><description>[quote user="AlexandreC"]It looks like the &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; is not replaced by the actual value defined in &lt;code&gt;prj.conf.&lt;/code&gt;[/quote]
&lt;p&gt;The documentation indicates that it should be possible, but your results shows that it might not be as straight forward. I&lt;span&gt;&amp;nbsp;will try to recreate the same behavior on my end as well.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="AlexandreC"]Also, I noticed that with the dynamic partitioning and settings subsystem, a &lt;code&gt;nonsecure_storage&lt;/code&gt; partition is created, what is the purpose of this partition ? Should I define it in the &lt;code&gt;pm_static.yml&lt;/code&gt; ?[/quote]
&lt;p&gt;&lt;span&gt;The nonsecure_storage partition is used for TF-M and TrustZone. To be able to use the modem you must build the application for non-secure domain, so this storage partition is thus nonsecure.&lt;/span&gt;&lt;/p&gt;
[quote user="AlexandreC"]One last question, with static partitioning the &lt;code&gt;CONFIG_PM_PARTITION_ALIGN_SETTINGS_STORAGE&lt;/code&gt; parameter is not usable anymore. Is this assumption correct ?[/quote]
&lt;p&gt;&lt;span&gt;As per my first comment in this reply, I will try to recreate it and come back to you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Andreas&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/469962?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 08:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97abc2fc-1513-4cad-a21e-5c16e8479114</guid><dc:creator>Zoptune</dc:creator><description>&lt;p&gt;Ok thanks for the MCUboot confirmation and for the sample request follow up &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I tried to use &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; in the &lt;code&gt;pm_static.yml&lt;/code&gt; file but I got a type error in the partition manager python script execution :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Partition &amp;#39;nonsecure_storage&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Partition &amp;#39;settings_storage&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Dropping partition &amp;#39;nrf_modem_lib_trace&amp;#39; since its size is 0.&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;&amp;nbsp; File &amp;quot;/home/alexandre/Documents/Dev/Tools/nRF_Connect_SDK_2.3.0/opt/ncs/nrf/scripts/partition_manager.py&amp;quot;, line 1978, in &amp;lt;module&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;br /&gt;&amp;nbsp; File &amp;quot;/home/alexandre/Documents/Dev/Tools/nRF_Connect_SDK_2.3.0/opt/ncs/nrf/scripts/partition_manager.py&amp;quot;, line 1028, in main&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; solution.update(solve_region(pm_config, region, region_config,&lt;br /&gt;&amp;nbsp; File &amp;quot;/home/alexandre/Documents/Dev/Tools/nRF_Connect_SDK_2.3.0/opt/ncs/nrf/scripts/partition_manager.py&amp;quot;, line 971, in solve_region&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_region_config(partitions, region_config, static_partitions, system_reqs=pm_config)&lt;br /&gt;&amp;nbsp; File &amp;quot;/home/alexandre/Documents/Dev/Tools/nRF_Connect_SDK_2.3.0/opt/ncs/nrf/scripts/partition_manager.py&amp;quot;, line 760, in get_region_config&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculate_end_address(pm_config)&lt;br /&gt;&amp;nbsp; File &amp;quot;/home/alexandre/Documents/Dev/Tools/nRF_Connect_SDK_2.3.0/opt/ncs/nrf/scripts/partition_manager.py&amp;quot;, line 726, in calculate_end_address&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pm_config[part]['end_address'] = pm_config[part]['address'] + pm_config[part]['size']&lt;br /&gt;TypeError: unsupported operand type(s) for +: &amp;#39;int&amp;#39; and &amp;#39;str&amp;#39;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It looks like the &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; is not replaced by the actual value defined in &lt;code&gt;prj.conf.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Also, I noticed that with the dynamic partitioning and settings subsystem, a &lt;code&gt;nonsecure_storage&lt;/code&gt; partition is created, what is the purpose of this partition ? Should I define it in the &lt;code&gt;pm_static.yml&lt;/code&gt; ?&lt;/p&gt;
&lt;p&gt;One last question, with static partitioning the &lt;code&gt;CONFIG_PM_PARTITION_ALIGN_SETTINGS_STORAGE&lt;/code&gt; parameter is not usable anymore. Is this assumption correct ?&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/469827?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 14:28:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb0336dc-14e9-42fa-9609-43cf30bec946</guid><dc:creator>AHaug</dc:creator><description>[quote user="AlexandreC"]The downside I see here is that I cannot use the &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; Kconfig variable anymore in development phase. But do I have to keep synced the size defined in the &lt;code&gt;pm_static.yml&lt;/code&gt; file and the size defined in &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; ?[/quote]
&lt;p&gt;You can still use the partition_size_settings when you define the sizes of the partitions in your yaml. The example here showcases this&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#configuration-file-preprocessing"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#configuration-file-preprocessing&lt;/a&gt;.&lt;/p&gt;
[quote user="AlexandreC"]I indeed plan to use mcuboot and DFU but with the secondary located in an external flash, do you see any potential problem with this configuration ?[/quote]
&lt;p&gt;No, this is fine :) Just make sure that the primary and secondary slots are equal in size and that you meet any other conditions mentioned here:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#external-flash-memory-partitions"&gt;developer.nordicsemi.com/.../partition_manager.html&lt;/a&gt;&lt;/p&gt;
[quote user="AlexandreC"]I think an advanced Partition Manager sample would be very useful to help beginner and vanilla Zephyr user to understand how it works :)[/quote]
&lt;p&gt;Yes, I agree and I will add a request for that. But luckily the documentation for PM is quite comprehensive so it is relatively straight forward to follow! :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/469806?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 13:15:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d726ff5-7628-4228-988c-5787de1b1418</guid><dc:creator>Zoptune</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/ahaug"&gt;AHaug&lt;/a&gt; and thanks for your answer !&lt;/p&gt;
&lt;p&gt;Ok so I do not any choice other than using a static partition definition.&lt;/p&gt;
&lt;p&gt;The downside I see here is that I cannot use the &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; Kconfig variable anymore in development phase. But do I have to keep synced the size defined in the &lt;code&gt;pm_static.yml&lt;/code&gt; file and the size defined in &lt;code&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE&lt;/code&gt; ?&lt;/p&gt;
&lt;p&gt;I indeed plan to use mcuboot and DFU but with the secondary located in an external flash, do you see any potential problem with this configuration ?&lt;/p&gt;
&lt;p&gt;I think an advanced Partition Manager sample would be very useful to help beginner and vanilla Zephyr user to understand how it works :)&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NVS Settings subsys custom partition placement</title><link>https://devzone.nordicsemi.com/thread/469722?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 09:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f769c23-85e1-456e-bed0-e08dd076f7fc</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]1. where can I define a custom partition ? (I tried in a &lt;code&gt;pm.yml&lt;/code&gt; file at the root of the project but it seems to be ignored. I am not sure to have fully understood everything about multi image build)[/quote]
&lt;p&gt;You can do this by using static configuration and static partitions in a pm_static.yml&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration&lt;/a&gt;. If you create one in the root folder of your project it should be included by the build system when you build your project.&amp;nbsp;&lt;/p&gt;
[quote user=""]2. will my custom partition be in conflict with the one that is automatically added by the settings subsys ?[/quote]
&lt;p&gt;Any partitions you create in a static_partition will be used instead of the dynamic partitioning, and any partitions not included in the static_partition that is still required by the build system will be included by the dynamic partitioning manager. In other words, as long as you name your partitions properly, it will not be in conflict with the dynamic partitioning.&lt;/p&gt;
[quote user=""]3. is there any sample where the partition is used to define a custom partition ?[/quote]
&lt;p&gt;There isn&amp;#39;t any sample that showcases how to create a pm_static.yml, but there are multiple samples that uses a pm_static.yml (most wireless protocol samples has CONFIG_SETTINGS=y and many of them also uses static partitioning.&lt;/p&gt;
&lt;p&gt;The steps to create a static pm yourself can be done as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create your application using the dynamic partitioning used by the build system&lt;/li&gt;
&lt;li&gt;Copy the contents of partitions.yml from build/partitions.yml to a pm_static.yml located in your project directory&lt;/li&gt;
&lt;li&gt;Modify the addresses according to your need.&amp;nbsp;
&lt;ol&gt;
&lt;li&gt;Do note that if you intend to have DFU support, then mcuboot primary and mcuboot secondary needs to be identically large, and mcuboot primary must fit your entire application (and have room for updates if you plan on adding features to your fw later down the products life span).&lt;/li&gt;
&lt;li&gt;The same pm_static.yml is recommended to be used for all updates in the products life span&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>