<?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 preserve app data??</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4791/how-to-preserve-app-data</link><description>Hi nordics! 
 I want to using app_data for preserving data. 
 For that. 
 First, I change the value DFU_APP_DATA_RESERVED to &amp;quot;0x0400&amp;quot; 
 Second, I change the memory start address and size of the application. 
 
 Finally, I uploaded the bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Dec 2014 08:54:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4791/how-to-preserve-app-data" /><item><title>RE: how to preserve app data??</title><link>https://devzone.nordicsemi.com/thread/16970?ContentTypeID=1</link><pubDate>Mon, 15 Dec 2014 08:54:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d6cd8aa-7baf-4366-97fa-fe27a18adc2d</guid><dc:creator>Kyu</dc:creator><description>&lt;p&gt;It solved. I really appreciate you help!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to preserve app data??</title><link>https://devzone.nordicsemi.com/thread/16969?ContentTypeID=1</link><pubDate>Fri, 12 Dec 2014 10:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a054a2f4-925c-4568-bd3a-9483de78ad6b</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I think that examining the pstorage_platform.h file will tell you where the application data is stored in flash. Generally, the rules are like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When there is no bootloader present on the device, the application data is stored at the top of the flash. The 256kB flash has range of 0x00000000 - 0x00040000 in the memory map. The last page (addresses 0x3FC00 - 0x3FFFF) is the pstorage swap page, and application data is on two pages below that in the memory map (addresses 0x3F400 - 0x3FBFF), if there are two pages reserved for the application data, see the pstorage_platform.h defines, i.e. the PSTORAGE_MAX_APPLICATIONS constant. In the case where there is no bootloader and value of PSTORAGE_MAX_APPLICATIONS is 2, then the application data is stored at location 0x3F400 and you can read out the memory content of the two pages  from the command prompt with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  nrfjprog --memrd 0x0003F400 --n 2048
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the device manager is used and is initialized, it will use one flash page. If you initialize the the device manager before calling pstorage_register for your application data, device manager will use the first page (starting with address 0x3F400) and the application data will be stored in the second page (starting with address 0x3F800).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When there is a bootloader present, it is located on the top of flash and the application data is below the bootloader in the memory map, as shown &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/doc/7.1.0/s110/html/a00069.html#ble_sdk_app_bootloader_banked_memory_layout_sec"&gt;here&lt;/a&gt;. For the bootloader in SDK 7.1.0, it&amp;#39;s start address is 0x3C000, but to check the location, you can read out the bootloader start address from UICR by with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  nrfjprog --memrd 0x10001014 --n 4
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the start address of the bootloader is 0x3C000, then the swap page start address is at 0x3C000-0x400=0x3BC00 and the two pages of application data is located from 0x3BC00-0x800=0x3B400 to 0x3BC00, so you can read out the memory contents of the two application data pages with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog --memrd 0x0003B400 --n 2048
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In your specific case where you apparently have only one page reserved for application data and have the bootloader present, then your application data can be read out with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog --memrd 0x0003F800 --n 1024
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So in order not to override the application data when you upload the applicaton via the bootloader, I think you need to put&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define DFU_APP_DATA_RESERVED           0x0800
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in dfu_types.h file in order not to override your application data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to preserve app data??</title><link>https://devzone.nordicsemi.com/thread/16968?ContentTypeID=1</link><pubDate>Thu, 11 Dec 2014 09:37:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fff0bb3-da88-4864-b69f-4d8f998f9676</guid><dc:creator>wlgrd</dc:creator><description>&lt;p&gt;Could the &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/doc/7.1.0/s110/html/a00982.html"&gt;device manager&lt;/a&gt; be of help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>