<?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>storing a big array in the flash memory</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3771/storing-a-big-array-in-the-flash-memory</link><description>Hi,
i need to save an array of 50 kB on the nrf51822 flash. I only need to read the data stored in the array. I come from the PIC micro world where i simply need to initialize the array as &amp;quot; const &amp;quot; and the compiler would take care of storing the array</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Sep 2014 11:47:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3771/storing-a-big-array-in-the-flash-memory" /><item><title>RE: storing a big array in the flash memory</title><link>https://devzone.nordicsemi.com/thread/13653?ContentTypeID=1</link><pubDate>Thu, 25 Sep 2014 11:47:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc1282b3-73a9-4089-9822-dc9c07511053</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you only need to read you can use const to store a array in flash. Remember to initalize it when you declare it, and that it can be optimized away if it is not used.&lt;/p&gt;
&lt;p&gt;If you need to write it depends on if you are using a Softdevice(S1xx, S210, S310) or not.&lt;/p&gt;
&lt;p&gt;If not, you have two options. You can access the Non-Volatile Memorty Controller (NVMC) registers directly, or you can use the NVMC driver. It is named nrf_nvmc in the SDK, and you can find its documentation &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/6.1.0/s110/html/a00672.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are using a SoftDevice you should use Persistent Storage Manager. It is named pstorage in the SDK, and you can find its documentation &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/6.1.0/s110/html/a00018.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Edit: added const possibility.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>