<?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>Maximum settings partition size estimation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111040/maximum-settings-partition-size-estimation</link><description>Hi there, 
 I need help finalizing the size of my product&amp;#39;s settings partition. I only store Bluetooth bonds on the settings partition: 20 bonds to other Nordic devices via the Nordic UART service and 10 bonds to BLE HID devices. These connections must</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Jun 2024 09:04:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111040/maximum-settings-partition-size-estimation" /><item><title>RE: Maximum settings partition size estimation</title><link>https://devzone.nordicsemi.com/thread/489035?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 09:04:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dacabd5-919b-450c-9f38-a92f95df45b4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As mentioned in the NVS documentation,&amp;nbsp;NVS will always keep one page empty to allow copying of existing data. Therefore, it is not possible to allocate less than 2 flash pages to NVS.&lt;/p&gt;
&lt;p&gt;This extra flash page enables safe&amp;nbsp;updating of existing data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum settings partition size estimation</title><link>https://devzone.nordicsemi.com/thread/488955?ContentTypeID=1</link><pubDate>Sat, 15 Jun 2024 21:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03b20773-b148-4de3-aac9-9129caa79aae</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve included the following in my main():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	void *storage;
    int rc = settings_storage_get(&amp;amp;storage);
    ssize_t size = nvs_calc_free_space((struct nvs_fs *)storage);
    printk(&amp;quot;Free space: %d\n&amp;quot;, size);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;According to the printed result, the free space doesn&amp;#39;t exceed 4K, even though I&amp;#39;ve allocated 8K for storage.&lt;/p&gt;
&lt;p&gt;my-board.dtsi:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;flash0 {
    partitions {
        compatible = &amp;quot;fixed-partitions&amp;quot;;
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;1&amp;gt;;

        boot_partition: partition@0 {
            label = &amp;quot;mcuboot&amp;quot;;
            reg = &amp;lt;0x0 0x10000&amp;gt;;
        };
        slot0_partition: partition@10000 {
            label = &amp;quot;image-0&amp;quot;;
            reg = &amp;lt;0x10000 0xdd000&amp;gt;;
        };
        hardware_config_partition: partition@ed000 {
            label = &amp;quot;hardware-config&amp;quot;;
            reg = &amp;lt;0xed000 0x1000&amp;gt;;
        };
        user_config_partition: partition@ee000 {
            label = &amp;quot;user-config&amp;quot;;
            reg = &amp;lt;0xee000 0x10000&amp;gt;;
        };
        storage_partition: partition@fe000 {
            label = &amp;quot;storage&amp;quot;;
            reg = &amp;lt;0xfe000 0x2000&amp;gt;;
        };
    };
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;pm_static.yml:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;app:
  address: 0x10200
  end_address: 0xfe000
  region: flash_primary
  size: 0xede00
mcuboot:
  address: 0x0
  end_address: 0x10000
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  size: 0x10000
mcuboot_pad:
  address: 0x10000
  end_address: 0x10200
  placement:
    align:
      start: 0x1000
    before:
    - mcuboot_primary_app
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0x10000
  end_address: 0xfe000
  orig_span: &amp;amp;id001
  - app
  - mcuboot_pad
  region: flash_primary
  size: 0xee000
  span: *id001
mcuboot_primary_app:
  address: 0x10200
  end_address: 0xfe000
  orig_span: &amp;amp;id002
  - app
  region: flash_primary
  size: 0xede00
  span: *id002
hardware_config_partition:
  address: 0xed000
  end_address: 0xee000
  size: 0x1000
user_config_partition:
  address: 0xee000
  end_address: 0xfe000
  size: 0x10000
settings_storage:
  address: 0xfe000
  end_address: 0x100000
  placement:
    align:
      start: 0x1000
    before:
    - end
  region: flash_primary
  size: 0x2000
sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum settings partition size estimation</title><link>https://devzone.nordicsemi.com/thread/482811?ContentTypeID=1</link><pubDate>Fri, 10 May 2024 12:53:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33ef9f27-5b27-4422-abc1-271218851fb1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;How much flash is used by settings is very application depended (number of setting entries and how frequent they are updated).&amp;nbsp;I recommend using the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/storage/nvs/nvs.html#c.nvs_calc_free_space"&gt;nvs_calc_free_space()&lt;/a&gt;&amp;nbsp;to help profile the flash usage&amp;nbsp;for your application. Flash wear should also be considered:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/storage/nvs/nvs.html#flash-wear"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/storage/nvs/nvs.html#flash-wear&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use this function to retreive the NVS instance used by the settings module:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/ccf8c547d090ad3f76dbfa64744f32333658dcdb"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/ccf8c547d090ad3f76dbfa64744f32333658dcdb&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>