<?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>pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2941/pstorage_store-vs-pstorage_update</link><description>Hi. 
 I have been trying to store data in flash by using pstorage.
What&amp;#39;s the difference between pstorage_store and pstorage_update? 
 At the first time, I can save data by pstorage_store without error at the callback function.
But if I try to save</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 May 2015 17:14:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2941/pstorage_store-vs-pstorage_update" /><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11169?ContentTypeID=1</link><pubDate>Tue, 19 May 2015 17:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6014d442-0f30-458a-b8ac-cf9d755dbcfa</guid><dc:creator>wins</dc:creator><description>&lt;p&gt;You can find the answer on &lt;a href="https://devzone.nordicsemi.com/question/24027/pstorage_store-and-pstorage_update-execution-time/?answer=24044#post-id-24044"&gt;this link&lt;/a&gt; but as I understand&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pstorage_update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;is a bad effort to &lt;em&gt;safe update&lt;/em&gt; information that shoud store in flash memory. I decide to not use it because of time (long, so long) and number of clear operations (that probably killed flash memory).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11170?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 17:24:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cc3ab42-04e9-4390-97ed-5a2a34fbe9b3</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Read &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/6.0.0/s110/html/a00018.html"&gt;this&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Store:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Writing data to blocks that already
have data stored is unreliable. The
application must clear the blocks
before writing fresh data to it.&lt;/li&gt;
&lt;li&gt;No intermediate copy of source data
to be stored in flash is made.
Application cannot free or reuse the
memory that is the source of data
until this operation is complete.
Completion of this operation is
notified through the event
notification callback.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When using the update routine the
Persistent Storage Manager will use a
swap area to conserve the blocks not
affected. The data page backed up in
the swap area, the data page is
erased, the non affected blocks are
copied back, then the updated block
is stored. It is not possible to
update multiple blocks in one API
call. Module detects if backing up
the page is needed or not and
optimizes accordingly.&lt;/li&gt;
&lt;li&gt;No intermediate copy of source data
to be stored in flash is made.
Application cannot free or reuse the
memory that is the source of data
until this operation is complete.
Completion of this operation is
notified through the event
notification callback.&lt;/li&gt;
&lt;li&gt;Update operation is a time intensive
operation, hence developer descretion
is required on usage of this API.
Application should be tolerant to
this.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11168?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 17:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a00b985-277f-41e5-8dce-46e1b464cd3c</guid><dc:creator>scytulip</dc:creator><description>&lt;p&gt;Then.... What&amp;#39;s the difference between pstorage_store and pstorage_update?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11166?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 15:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10abcbb0-b156-44b1-8455-3be1db8f97c5</guid><dc:creator>Masa</dc:creator><description>&lt;p&gt;You are welcome :)
This is an official bug and the way to kill the bug was given by Nordic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11165?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 14:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:228e65c6-107d-4049-a124-241a61c213a8</guid><dc:creator>leo</dc:creator><description>&lt;p&gt;Is this an official bug? thx for sharing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11167?ContentTypeID=1</link><pubDate>Sun, 29 Jun 2014 07:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e21e003c-e5b7-4495-8874-924e5848294b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I don&amp;#39;t know what the problem is, just noticed the error message was possibly wrong and thought that might help someone else figure out what the issue was.&lt;/p&gt;
&lt;p&gt;I assume you have the softdevice enabled and you have registered for events and you are calling the pstorage event handler as you&amp;#39;re required to do. I&amp;#39;m sure you are, again just asking questions to see if anything obvious comes up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11164?ContentTypeID=1</link><pubDate>Sun, 29 Jun 2014 07:05:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc146a1c-d7b3-48ed-8ecc-5f12e29727eb</guid><dc:creator>Masa</dc:creator><description>&lt;p&gt;Hi, RK.
Thank you for your reply.
You are right. That was a quite silly mistake....
The error means actually NRF_ERROR_BUSY as you mentioned.&lt;/p&gt;
&lt;p&gt;But still I don&amp;#39;t understand why I keep getting NRF_ERROR_BUSY error.
I tried using nrf_delay_us and/or timer but still I get NRF_ERROR_BUSY error.&lt;/p&gt;
&lt;p&gt;I also tried like this :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t    count  = 1; 
while(count &amp;gt; 0){
	pstorage_access_status_get(&amp;amp;count);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this loop won&amp;#39;t finish....&lt;/p&gt;
&lt;p&gt;Do you know how to handle this issue?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit :&lt;/strong&gt;
It turns out that this is a bug of SDK(pstorage.c).
Just add&lt;/p&gt;
&lt;p&gt;retval = NRF_SUCCESS;&lt;/p&gt;
&lt;p&gt;to line 379 of pstorage.c.
It should look like this :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (retval != NRF_ERROR_BUSY) {
     app_notify (retval); 
} else  {   
     // In case of busy next trigger will be a success or a failure event.           
     retval = NRF_SUCCESS;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage_store vs pstorage_update</title><link>https://devzone.nordicsemi.com/thread/11163?ContentTypeID=1</link><pubDate>Sun, 29 Jun 2014 06:34:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6aae931-3b75-442b-b1d7-feabf0356a8c</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Do you mean 0x11 is the error code? That&amp;#39;s NRF_ERROR_BUSY (17) not NRF_ERROR_INVALID_DATA (11). The documentation says that NRF SoC flash errors can be returned and indeed sd_flash_write can return NRF_ERROR_BUSY if the previous operation hasn&amp;#39;t completed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>