<?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>How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9238/how-to-reliably-save-data-using-pstorage</link><description>Hello, 
 I have quite a few of setting on my nodes and I want to save some of these permanently. Currently I am using the pstorage module and everything works as expected. There are quite some limitations: 
 
 Pstorage does not perform wear leveling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Sep 2015 12:06:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9238/how-to-reliably-save-data-using-pstorage" /><item><title>RE: How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/thread/34088?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2015 12:06:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6739847b-3979-49fa-82bb-e96b96c035ca</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Thank you Chris. I will report this for improvement in the documentation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/thread/34085?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2015 10:18:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:178be2f5-d9c2-48c8-8cff-81d06b3809bb</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;&lt;a href="http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00140.html"&gt;developer.nordicsemi.com/.../a00140.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;At the very bottom, first bullet under &amp;#39;Clear&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/thread/34084?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2015 10:06:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb9a7a7a-cbbb-4720-95b3-012b038f976b</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;@Chris    Where do you find this text exactly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/thread/34087?ContentTypeID=1</link><pubDate>Sat, 19 Sep 2015 22:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64980e95-5964-46bb-9656-ad86948877ad</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Nevermind, it works as I expected and only clears one page. Makes sense since the swap is only one page.  One of the rare cases where you don&amp;#39;t take the documentation literally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/thread/34086?ContentTypeID=1</link><pubDate>Sat, 19 Sep 2015 21:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:086c0f9e-fa0e-491e-a428-3caef072eaef</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;If an &amp;#39;application&amp;#39; requests 16 128-byte blocks, it will get 2 pages.  The documentations says, &amp;quot;Clear operation results in clearing all storage blocks allocated to the application.&amp;quot; Does that mean that a clear will really erase both pages even if I do pstorage_clear(&amp;amp;base_handle, 1024). I hope that is not the case and that it will only clear page one. And that pstorage_clear(&amp;amp;block8_handle, 1024) would then only clear page two. Is this how it works?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reliably save data using pstorage?</title><link>https://devzone.nordicsemi.com/thread/34083?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2015 12:30:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da2c3154-e77a-4ef0-bdc9-c5b1c18b7a32</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Marius&lt;/p&gt;
&lt;p&gt;Thank you for your message.&lt;/p&gt;
&lt;p&gt;I think you are correct in all your assumptions. The pstorage module is currently not designed to reliably handle sudden power cuts during pstorage operation. We have recommended so far that when i.e. battery is close to empty that you shut down gracefully before the supply voltage drops below 1.8V, so that ongoing flash operations will be completed.&lt;/p&gt;
&lt;p&gt;No, you are correct, there is no mechanism available from Nordic that handles the limited erase/write cycles allowed. If you write/erase the same page/pages very often, then you would need to implement a mechanism to spread the write/erase cycles on multiple pages.&lt;/p&gt;
&lt;p&gt;I think your thread is a good summary of improvement suggestions for the pstorage module. I will report this as such.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>