<?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>C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21734/c-implementation-for-writing-to-nvmc</link><description>Hello, 
 I am looking through the data sheet for the NRF52 and do not see anything for writing to NVMC. 
 I see you can erase and configure the NVMC using: 
 NRF_NVMC -&amp;gt; CONFIG = 0x2;
NRF_NVMC -&amp;gt; ERASEPAGE = 0x0150; 
 I was expecting see some thing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 30 Apr 2017 00:56:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21734/c-implementation-for-writing-to-nvmc" /><item><title>RE: C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/thread/85372?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2017 00:56:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f67ab55-b747-4256-97a6-b3e707eab21c</guid><dc:creator>micallef25</dc:creator><description>&lt;p&gt;hello daniel the &lt;em&gt;(uint32_t&lt;/em&gt;)address = value; is what I was pretty much looking for. Than kyo for your help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/thread/85371?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2017 00:47:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24df805e-98eb-43c7-bacc-b2633c665fc8</guid><dc:creator>Daniel Wang</dc:creator><description>&lt;p&gt;The nrf_nvmc_write_word() function looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void nrf_nvmc_write_word(uint32_t address, uint32_t value)
{
    // Enable write.
    NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){
    }

    *(uint32_t*)address = value;
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){
    }

    NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So now you can implement this in your own function ; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/thread/85370?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2017 00:31:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cc52d28-a113-4fd9-9187-15f5030c66e0</guid><dc:creator>micallef25</dc:creator><description>&lt;p&gt;Hi Rols, Thanks for the reply. I did see that but my question was more of the actual C implementation ie.
*Flash_Address = Data_To_Write;
I believe this should work so I guess this question can be closed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/thread/85369?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2017 00:25:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dff9cd1-0438-4754-bf3a-528345150e13</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Straight out of the manual&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Non-volatile memory controller (NVMC) is used for writing and erasing the internal Flash memory and the UICR.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Before a write can be performed, the NVMC must be enabled for writing in CONFIG.WEN. Similarly, before an erase can be performed, the NVMC must be enabled for erasing in CONFIG.EEN, see CONFIG. The user must make sure that writing and erasing are not enabled at the same time. Failing to do so may result in unpredictable behavior.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Writing to Flash&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When writing is enabled, the Flash is written by writing a full 32-bit word to a word-aligned address in the Flash.&lt;/p&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/thread/85368?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2017 00:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cef4f231-9004-4684-9eba-9d239a818a0e</guid><dc:creator>micallef25</dc:creator><description>&lt;p&gt;Hi Daniel, I did not really want to use their drivers I wanted to make my own.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C implementation for writing to NVMC</title><link>https://devzone.nordicsemi.com/thread/85367?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2017 00:03:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adf905ab-43f7-49b2-a0f5-0546745a6577</guid><dc:creator>Daniel Wang</dc:creator><description>&lt;p&gt;Use the driver for the NVMC that is in the SDK. You have 4 different functions for writing to NVMC.
&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/group__nrf__nvmc.html"&gt;Here&lt;/a&gt; is a link to the infocenter page&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>