<?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>using NVS on NET CPU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78291/using-nvs-on-net-cpu</link><description>Hello, 
 I am trying to get the nvs driver working on the NET cpu and am having trouble getting the initialization working. The code below is what I am currently working with to give some context. 
 
 I have traced the issue down to the macro FLASH_AREA_OFFSET</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Aug 2021 18:47:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78291/using-nvs-on-net-cpu" /><item><title>RE: using NVS on NET CPU</title><link>https://devzone.nordicsemi.com/thread/323608?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 18:47:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e9daaff-754f-42b4-a5b8-cb69aa93ba36</guid><dc:creator>anthony32086</dc:creator><description>&lt;p&gt;Solved it, I ran some tests with the code changed to,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;fs.offset = FLASH_AREA_OFFSET(storage) - DT_REG_ADDR(DT_CHOSEN(zephyr_flash));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;then flashed with --recover to wipe all flash. Memory inspector on the NET core show&amp;nbsp;&lt;/span&gt;both &lt;span&gt;0x0003a00&amp;nbsp;and&amp;nbsp;0x0103a00&amp;nbsp; addresses with 0xFFFFFFFF.&amp;nbsp;Then after a nvs_write to id 1 m&lt;/span&gt;emory inspector&amp;nbsp;shows&amp;nbsp; memory @&amp;nbsp;&lt;span&gt;0x0003a00 contains 0xFFFFFFFF however&amp;nbsp;0x0103a00&amp;nbsp; does show new data that was written.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It seems the nRF5340 does implicitly translate writes to flash on the net core to include the base address.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Interesting that&amp;nbsp;FLASH_AREA_OFFSET(storage) returns the correct offset address (0x0003a00) from devicetree_unfixed.h since a BUILD_ASSERT(&amp;nbsp;FLASH_AREA_OFFSET(storage) ==&amp;nbsp;0x0003a00) on the net core does not fail compilation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However when the value is printed to the console, 0x0103a00 is returned so something else under the hood is happening to give the absolute address rather than a relative address, perhaps&amp;nbsp;a linker config issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>