<?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>Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/977/able-to-write-only-one-time-in-nvmc</link><description>Hi , 
 Here is my code used to write in to non volatile memory. 
 #include &amp;quot;nrf.h&amp;quot;
//#include &amp;quot;uicr_config.h&amp;quot;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;quot;nrf_nvmc.h&amp;quot; 
 int main(void)
{ 
 uint32_t address = 0x10001088;
 uint32_t value</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Nov 2013 13:42:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/977/able-to-write-only-one-time-in-nvmc" /><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4641?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2013 13:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8349477d-e44e-4831-9789-79603d9fb40b</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;just now I added the new question regarding my query in non-volatile memory please check the below link
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/non-volatile-memory-permanent-storage-problem" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/non-volatile-memory-permanent-storage-problem&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4640?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2013 12:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b5af49d-868f-4911-88f1-ede3dfe96e85</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If you do a proper NVMC write, the data will not be lost on power-reset, unless you accidentally do an erase on startup. Are you sure that this is not the case? If so, I&amp;#39;d recommend you to include the code you&amp;#39;re using and create a new question, since this seems to be an unrelated question to the one here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4639?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2013 09:04:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73a347e5-a9fc-4e60-a5e8-4a83a71b3daf</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;As you said, we can able to write data&amp;#39;s in the non-volatile memory  (i.e, flash area that is not used by the application), and i also checked it using keil debugger.&lt;/p&gt;
&lt;p&gt;I tried in different memory locations from 0x028400 to 0x03C800 I can able to erase, read, write.&lt;/p&gt;
&lt;p&gt;But the problem we are facing is when i do power reset the data is getting erased (like volatile memory).&lt;/p&gt;
&lt;p&gt;I am not sure whether i am testing it in correct way or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4636?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2013 12:09:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:397654b5-14af-4898-bd61-2ceb2bc6fe49</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure why you want to erase UICR, but you should &lt;em&gt;not&lt;/em&gt; do so in normal operation.&lt;/p&gt;
&lt;p&gt;To erase a flash area, you need to find out which page it is part of, and then erase this page. There are registers in FICR for page size and number of pages, so if you have an address it should be easy to do the math to find the page number. Remember that flash operations halt the CPU, so you should make sure that you have enough time to do so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4638?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2013 12:08:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e242ac39-8894-49e0-9fd7-aad76705d2ca</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;d recommend you to take a look at this question for information on how to find a flash area that&amp;#39;s safe to use:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/safe-to-use-nvm-space" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/safe-to-use-nvm-space&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4637?ContentTypeID=1</link><pubDate>Sat, 23 Nov 2013 07:21:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac060c23-153b-4b14-bbe0-f8ac269dc362</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;In my case soft device is enabled.&lt;/p&gt;
&lt;p&gt;So i cant able to erase UICR .&lt;/p&gt;
&lt;p&gt;Now i think , i want to use ble_flash* functions to read ,write and erase in to nvm.&lt;/p&gt;
&lt;p&gt;But i dont know in which page i can write my configuration.&lt;/p&gt;
&lt;p&gt;how to know falsh page number.&lt;/p&gt;
&lt;p&gt;Kindly suggest me.&lt;/p&gt;
&lt;p&gt;Regards
Balaji&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4635?ContentTypeID=1</link><pubDate>Sat, 23 Nov 2013 07:03:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:192e675d-a23f-4631-bf42-2022a15a21e2</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;Here i done changes in code. but not yet worked.&lt;/p&gt;
&lt;p&gt;Kindly confirm where i am wrong.&lt;/p&gt;
&lt;p&gt;uint32_t address = 0x10001080;
uint32_t value   = 0x13345621;
uint32_t b=0;&lt;/p&gt;
&lt;p&gt;NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Een;
while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
{&lt;/p&gt;
&lt;p&gt;}
// Erase the page
NRF_NVMC-&amp;gt;ERASEUICR=1;
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;/p&gt;
&lt;p&gt;nrf_nvmc_write_word(address,	value);
while (true)
{
/* Do nothing */
}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Regards
Balaji&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4634?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2013 16:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7f0337e-4b4a-47eb-bc93-8649c783b639</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;You can erase only a full page at a time, as is explained in the nRF51 Reference Manual, and quite clearly shown in the function name, so this code will obviously not work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4633?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2013 16:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81d13816-76ad-49e1-a7ef-30a316cf204d</guid><dc:creator>balaji</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;I tried by erasing also but not yet worked.&lt;/p&gt;
&lt;p&gt;Here is my code :&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf.h&amp;quot;
//#include &amp;quot;uicr_config.h&amp;quot;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;quot;nrf_nvmc.h&amp;quot;&lt;/p&gt;
&lt;p&gt;int main(void)
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;			uint32_t address = 0x1000108C;
			uint32_t value   = 0x13345653;
			uint32_t b=0;
			
			nrf_nvmc_page_erase(address);
			nrf_nvmc_write_word(address,	value);

			b = *(uint32_t *)address;
			
			//nrf_nvmc_write_word(address+12,	b);
			while (true)
			{
						/* Do nothing */
			}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Regards
Balaji&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Able to write only one time in NVMC</title><link>https://devzone.nordicsemi.com/thread/4632?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2013 15:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24b2b556-f0fe-4777-873b-c63a126b809c</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;When erasing flash, all bits are set back to 1, and when then writing, the needed bits are set to 0. To set a bit back to 1, you must erase the address again.&lt;/p&gt;
&lt;p&gt;This means that it isn&amp;#39;t possible to write to bytes successively to flash, if the change needs to set bits back to one. In other words, you can first write 0b10101111 to an address, and then 0b10100101, but you can&amp;#39;t write 0b1010000 and then write 0xb10100101.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>