<?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 Allocating More Flash Pages Moves Existing Pages</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10203/pstorage-allocating-more-flash-pages-moves-existing-pages</link><description>Hello, 
 Setup:
SDK 9.0
SD 8.0.0 
 I have an application where we are using Pstorage to store persistent system settings. 
 When I flashed the device we were using this setting in pstorage_platform.h
#define PSTORAGE_NUM_OF_PAGES (2)
Everything</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Nov 2015 16:40:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10203/pstorage-allocating-more-flash-pages-moves-existing-pages" /><item><title>RE: Pstorage Allocating More Flash Pages Moves Existing Pages</title><link>https://devzone.nordicsemi.com/thread/37869?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 16:40:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90be9649-cf84-4107-a34b-55a63fe25dca</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;In dfu_types.h I have defined&lt;/p&gt;
&lt;p&gt;#define DFU_APP_DATA_RESERVED           0x0800&lt;/p&gt;
&lt;p&gt;The bond_table and persistent_settings are meant to be preserved and this currently works. Declaring them last will this method of preserving the pages still work. I guess the DFU preserves the tables in the reverse order that they are allocated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pstorage Allocating More Flash Pages Moves Existing Pages</title><link>https://devzone.nordicsemi.com/thread/37868?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 16:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:933f1a68-8b4d-4377-b888-df04d87d500a</guid><dc:creator>John</dc:creator><description>&lt;p&gt;No problem, yours filled in more of the details than mine so no harm no foul.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pstorage Allocating More Flash Pages Moves Existing Pages</title><link>https://devzone.nordicsemi.com/thread/37867?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 15:30:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc0647aa-9075-4fb2-97fd-260da2270c35</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Didn&amp;#39;t see your answer before after I posted mine. Had left this thread open in a different tab and didn&amp;#39;t refresh it before I posted:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pstorage Allocating More Flash Pages Moves Existing Pages</title><link>https://devzone.nordicsemi.com/thread/37870?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 15:17:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:085ad069-8725-4135-b5a5-c2bff86c9347</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi, the pstorage instance registered first will be placed at the bottom of the allocated flash area. That is, bootloader address - swap page - (PSTORAGE_NUM_OF_PAGES*1024 bytes). This is also illustrated here &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/lib_pstorage.html?cp=4_1_0_3_17"&gt;pstorage -&amp;gt; memory layout.&lt;/a&gt; So assuming the default bootloader address the new bond table will be placed at 0x39400 after doing DFU, instead of 0x3B400 where it was initially located. As a result the old bond information will no longer be visible for the device manager in the new application.&lt;/p&gt;
&lt;p&gt;The bond table takes typically one page with the default settings (max 8 bonds, etc.)If you need these additional pages for the application data, you can solve this by registering these instances before initializing the device manager.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pstorage Allocating More Flash Pages Moves Existing Pages</title><link>https://devzone.nordicsemi.com/thread/37866?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 13:34:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c34daa23-57be-4324-bf13-dc974f209bff</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Yes, changing the number of pstorage pages will change the start address of your allocated pstorage memory. If you look in pstorage_platform.h you can see how the start address of the pstorage memory is allocated base on the number of pages. So, when you do your pstorage_register during initialization you will end up with a different pstorage location. You could probably get back to your data location if you allocate the additional 8 pages before registering for your previous pstorage data. I have never tried that, so it is just a guess.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>