<?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>Write to Non-Volatile Memory of rf52832 with nrf Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100057/write-to-non-volatile-memory-of-rf52832-with-nrf-connect-sdk</link><description>Board: EBYTE E73 TBB NRF52832 
 IDE: Visual Studio Code 1.78.2 
 OS: Windows 10 64 Pro 
 nRF Connect SDK 2.3.0 
 
 I am trying to write some variable to NVM. I cannot find any related example. I tried guessing to use nrfx_nvms, but I have no success.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Jun 2023 10:34:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100057/write-to-non-volatile-memory-of-rf52832-with-nrf-connect-sdk" /><item><title>RE: Write to Non-Volatile Memory of rf52832 with nrf Connect SDK</title><link>https://devzone.nordicsemi.com/thread/429240?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2023 10:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f89f77e-2658-4b9e-a819-d635f0217971</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="nefen"]BLE writes configuration settings on flash memory and I do not know if other APIs are also using flash memory.[/quote]
&lt;p&gt;the BT subsys uses the settings (CONFIG_BT_SETTINGS) subsys for storing data:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/zephyr/services/settings/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/zephyr/services/settings/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which by default stores data in the &amp;quot;storage&amp;quot; partition.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Are you planning on using a multi-image build (ie. with mcuboot)?&lt;/p&gt;
&lt;p&gt;If so, then the partition manager will be invoked for handling of the internal flash partition layout. If you use a single-image build, the partition layout is given in the device-tree.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrf/scripts/partition_manager/partition_manager.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrf/scripts/partition_manager/partition_manager.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you wanted to reserve a specific area, you can (if using multi-image build, ie. PartitionManager) create a pm_static.yml file in the root of your application folder, containing something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;my_area:
  address: 0x7e000
  end_address: 0x80000
  region: flash_primary
  size: 0x2000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This reserves two pages from address offset 0x7e000 to 0x80000 (512k)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write to Non-Volatile Memory of rf52832 with nrf Connect SDK</title><link>https://devzone.nordicsemi.com/thread/429100?ContentTypeID=1</link><pubDate>Sat, 03 Jun 2023 11:47:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32d0b9b4-39c9-45c2-9b7c-a9c241974f6e</guid><dc:creator>nefen</dc:creator><description>&lt;p&gt;I had closed that thread, but I have a related question.&lt;/p&gt;
&lt;p&gt;BLE writes configuration settings on flash memory and I do not know if other APIs are also using flash memory.&lt;/p&gt;
&lt;p&gt;How can I identify the unused sectors that I might use to store non volatile data?&lt;/p&gt;
&lt;p&gt;Is there any formal mechanism to allocate space in flash memory for my application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write to Non-Volatile Memory of rf52832 with nrf Connect SDK</title><link>https://devzone.nordicsemi.com/thread/427150?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 09:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8d5258e-a13c-414c-a384-0d9cf05ac85f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for providing a test-snippet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To allow flash write when using MPU, you need to enable this using a kconfig:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MPU_ALLOW_FLASH_WRITE=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did a smoke-test with your code, and added the above to prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v3.3.99-ncs1-rc1 ***
[00:00:00.356,872] &amp;lt;inf&amp;gt; hello_nvmc: Hello World! nrf52840dk_nrf52840
[00:00:00.356,903] &amp;lt;inf&amp;gt; hello_nvmc: Erasing page...
[00:00:00.441,070] &amp;lt;inf&amp;gt; hello_nvmc: Page succesfully erased.
[00:00:00.441,101] &amp;lt;inf&amp;gt; hello_nvmc: Setting write mode
[00:00:00.441,101] &amp;lt;inf&amp;gt; hello_nvmc: Wait for Ready
[00:00:00.441,131] &amp;lt;inf&amp;gt; hello_nvmc: Writing value 12562 to address 520192.
[00:00:00.441,192] &amp;lt;inf&amp;gt; hello_nvmc: Write finished
[00:00:00.441,192] &amp;lt;inf&amp;gt; hello_nvmc: Write succeeded, by by writing value:12562
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>