<?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>NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17644/nrf51822-flash-write-lead-to-undesirable-value</link><description>I have Inited the pstorage 
 err_code = pstorage_init();
 APP_ERROR_CHECK(err_code);
 
 Here PSTORAGE_NUM_OF_PAGES=2(1page for bonding ,1page for my application use ) .and register my page 
 param.block_size = sizeof (m_sys_data_store) ;//36bytes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 12 Nov 2016 05:54:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17644/nrf51822-flash-write-lead-to-undesirable-value" /><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67852?ContentTypeID=1</link><pubDate>Sat, 12 Nov 2016 05:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31133df7-4440-4acf-ba4f-6f2ea0659e63</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;Good to hear. Please mark the question as answered then. You can do it by pressing gray button next to my answer. Or if it was Petters comment that solved your problem, then convert his comment to an answer and mark as accepted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67851?ContentTypeID=1</link><pubDate>Sat, 12 Nov 2016 05:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb1eb18f-83e8-46c6-b792-86a3e0f869ae</guid><dc:creator>Songplus</dc:creator><description>&lt;p&gt;Thank you.Yesterday I tried  as you said,and succeed.Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67847?ContentTypeID=1</link><pubDate>Sat, 12 Nov 2016 05:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84ed03a0-2cc0-436e-8798-b1e64cd664fc</guid><dc:creator>Songplus</dc:creator><description>&lt;p&gt;Thank you.You are right.I have fixed the bug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67846?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2016 13:01:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79594efa-2ae8-47fb-baec-c1a27b0d7a04</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;You shouldn&amp;#39;t wait a fixed time before the flash operation is finished, to be sure that it is finished you should wait until you get the event in the callback handler. See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v9.0.0/lib_pstorage.html?cp=4_0_3_3_13_2_6#pstorage_clear"&gt;this&lt;/a&gt;. If you do a clear operation you should wait for the PSTORAGE_CLEAR_OP_CODE event before you write.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67850?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2016 09:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60467348-b374-4689-9981-5e7b743fdc6f</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;Oh, i did not notice that you are doing flash erase. You are correct, if you are erasing flash and then trying to write it with &lt;code&gt;pstorage_store();&lt;/code&gt; it should work fine. The &lt;code&gt;pstorage_update();&lt;/code&gt; actually does the same thing for you. It first erases the flash area and then writes to it the new data. It is just for the convenience. If you are doing erase and then writing, there should be no difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67849?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2016 03:27:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:901f5c01-c609-4274-a23c-5735480063ac</guid><dc:creator>Songplus</dc:creator><description>&lt;p&gt;Thank you for your anser.Before wirting to the flash,I have erased ,There should not be dirty on the flash,So I think there isn&amp;#39;t  wrong.Besides,I don&amp;#39;t know what the mechanism of  &lt;code&gt;pstorage_update()&lt;/code&gt; is.Would it work steadily?
I will try it ,TKS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Flash write ,lead to undesirable value</title><link>https://devzone.nordicsemi.com/thread/67848?ContentTypeID=1</link><pubDate>Thu, 10 Nov 2016 08:33:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f559a4b2-1711-436a-9fd8-51b9146f2a6d</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;If you want to update the contents of flash memory, you can&amp;#39;t use &lt;code&gt;pstorage_store();&lt;/code&gt; for every time you want to write something to flash. That is valid only for the first time. If you want to update flash contents to which you have already written, you should use &lt;code&gt;pstorage_update();&lt;/code&gt; instead. Using &lt;code&gt;pstorage_store();&lt;/code&gt; on a flash region which was already written might cause unpredictable results. I have recently also tried to run pstorage module and i got everything working correct, but i did it on S110 V8. You can check it here &lt;a href="https://devzone.nordicsemi.com/question/100154/pstorage_update-calback-question/"&gt;pstorage_update callback&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>