<?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>(Zephyr / NCS) NVS Error: flash_nrf: invalid address: with CONFIG_SETTINGS=y</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85583/zephyr-ncs-nvs-error-flash_nrf-invalid-address-with-config_settings-y</link><description>I am trying to implement bonded pairing with a project in which I already have NVS configured for user data. When implementing bonding, I understand that I need to remove the CONFIG_SETTINGS_NONE=y flag and add a CONFIG_SETTINGS=y flag. I assume this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Mar 2022 12:42:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85583/zephyr-ncs-nvs-error-flash_nrf-invalid-address-with-config_settings-y" /><item><title>RE: (Zephyr / NCS) NVS Error: flash_nrf: invalid address: with CONFIG_SETTINGS=y</title><link>https://devzone.nordicsemi.com/thread/357658?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 12:42:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de2648ea-b777-4cb9-9551-91752aa91d92</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Eric&lt;/p&gt;
&lt;p&gt;It&amp;#39;s correct that you should&amp;nbsp;&lt;strong&gt;wait&amp;nbsp;&lt;/strong&gt;to set up a static configuration of the partition manager until you have a product out in the field where the partitions are supposed to be locked.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I discussed your issue with a couple of colleagues, and we think it would be best to split the partitions into two separate NVS partitions, so you don&amp;#39;t have to synchronize between mulitple images like this. 1 for the settings NVS and one for the &amp;quot;user NVS&amp;quot;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (Zephyr / NCS) NVS Error: flash_nrf: invalid address: with CONFIG_SETTINGS=y</title><link>https://devzone.nordicsemi.com/thread/357503?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 17:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f9e9034-04e0-46b8-a9c1-5e08ea821b06</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;So it seems that my issue is due to using MCUBoot in combination with NVS. I understand that the device tree is ignored when using a multi-image build configuration.&lt;/p&gt;
&lt;p&gt;This can be re-created by trying to compile the NVS sample with CONFIG_BOOTLOADER_MCUBOOT=y set. The problem line is below and is because the macro cannot find the storage label which was defined in the device tree (being ignored).&lt;/p&gt;
&lt;div style="background-color:#282a36;color:#f8f8f2;font-family:Menlo, Monaco, &amp;#39;Courier New&amp;#39;, monospace;font-size:12px;font-weight:normal;line-height:18px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#ff79c6;"&gt;#define&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt; &lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;STORAGE_NODE&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt; &lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;DT_NODE_BY_FIXED_PARTITION_LABEL&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;(storage)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="background-color:#282a36;color:#f8f8f2;font-family:Menlo, Monaco, &amp;#39;Courier New&amp;#39;, monospace;font-size:12px;font-weight:normal;line-height:18px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#ff79c6;"&gt;#define&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt; &lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;FLASH_NODE&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt; &lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;DT_MTD_FROM_FIXED_PARTITION&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;(&lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;STORAGE_NODE&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style="background-color:#282a36;color:#f8f8f2;font-family:Menlo, Monaco, &amp;#39;Courier New&amp;#39;, monospace;font-size:12px;font-weight:normal;line-height:18px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#f8f8f2;"&gt;flash_dev&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt; &lt;/span&gt;&lt;span style="color:#ff79c6;"&gt;=&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt; &lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;DEVICE_DT_GET&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;(&lt;/span&gt;&lt;span style="color:#50fa7b;"&gt;FLASH_NODE&lt;/span&gt;&lt;span style="color:#f8f8f2;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is the error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;error: &amp;#39;__device_dts_ord_DT_COMPAT_fixed_partitions_LABEL_nvs_storage_PARENT_PARENT_ORD&amp;#39; undeclared (first use in this function)
   80 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am able to fix the compilation error by adding a pm_static.yml file to the root directory of the NVS sample as described far down in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/77781/problem-to-read-back-flash-with-nvs-when-concurrent-use-with-bluetooth"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;storage:
  address: 0x7a000
  size: 0x6000
  end_address: 0x80000
  placement:
    before: 
    - user_storage
  region: flash_primary
user_storage:
  address: 0x80000
  size: 0x2000
  end_address: 0x82000
  placement:
    before:
    - end
  region: flash_primary&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, in a different thread (that I cannot find right now), it is recommended to avoid static configuration. This seems to make sense.&lt;/p&gt;
&lt;p&gt;So in order to prefer the partition manager&amp;#39;s output, I have removed the two problems lines (above) and ran a `ninja report` in the build folder. The output is below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  flash_primary (0x80000 - 512kB): 
+-------------------------------------------------+
| 0x0: mcuboot (0xc000 - 48kB)                    |
+---0xc000: mcuboot_primary (0x37000 - 220kB)-----+
| 0xc000: mcuboot_pad (0x200 - 512B)              |
+---0xc200: mcuboot_primary_app (0x36e00 - 219kB)-+
| 0xc200: app (0x36e00 - 219kB)                   |
+-------------------------------------------------+
| 0x43000: mcuboot_secondary (0x37000 - 220kB)    |
| 0x7a000: nvs_storage (0x6000 - 24kB)            |
+-------------------------------------------------+

  sram_primary (0x10000 - 64kB): 
+-------------------------------------------+
| 0x20000000: sram_primary (0x10000 - 64kB) |
+-------------------------------------------+&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This seems to imply that there is a partition labeled `nvs_storage` that I can use as a FLASH_NODE.&lt;/p&gt;
&lt;p&gt;However, when changing my problem lines to target the partition labeled nvs_storage (as described in the report output) I am still faced with the same compilation error.&lt;/p&gt;
&lt;p&gt;I do not see any documentation on the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.1/nrf/scripts/partition_manager/partition_manager.html"&gt;partition manager&lt;/a&gt; page that describes how to actually use it in the multi-image builds. Am I missing something? What is the alternative to defining a static partition?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (Zephyr / NCS) NVS Error: flash_nrf: invalid address: with CONFIG_SETTINGS=y</title><link>https://devzone.nordicsemi.com/thread/357409?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 13:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0296be2f-7aed-44db-a12c-76177a6db454</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html"&gt;Partition Manager&lt;/a&gt; documentation is available here. I&amp;#39;m not sure what you&amp;#39;re looking for in terms of &amp;quot;calculating partitions&amp;quot;, but the size of Flash and RAM is stated in the &lt;a href="https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52.html"&gt;nRF52 product specification&lt;/a&gt;, and the size of I.E. the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_ble_controller.html"&gt;Bluetooth LE controller&lt;/a&gt; you&amp;#39;re using can be found here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (Zephyr / NCS) NVS Error: flash_nrf: invalid address: with CONFIG_SETTINGS=y</title><link>https://devzone.nordicsemi.com/thread/357244?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 15:20:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:919d7d5c-691a-48a5-b418-9e9f5d0304bf</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;Thanks Simonr, can you point me to documentation that describes how to calculate these partitions for a given chip? So far I have been using the default partitions for the nRF52 DK dts file. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (Zephyr / NCS) NVS Error: flash_nrf: invalid address: with CONFIG_SETTINGS=y</title><link>https://devzone.nordicsemi.com/thread/357222?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 14:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:304300bb-81a8-40fd-b054-0c2d1a7efe9d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Eric&lt;/p&gt;
&lt;p&gt;It looks like something is trying to write data outside of the flash of the nRF52832, are you trying to write data outside of the partitions you have allocated somewhere? I guess you could try reducing some of your partitions so the entire flash isn&amp;#39;t taken by these partitions.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>