<?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>Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20719/protect-nvm-from-being-overwritten-during-reflash</link><description>I&amp;#39;m using the pstorage driver on the nRF51 to maintain several NVM variables. The NVM functions correctly and maintains state between power cycles. However, when I reflash the device using OTA reflash (application only, not SoftDevice), all of my NVM</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Apr 2017 19:01:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20719/protect-nvm-from-being-overwritten-during-reflash" /><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80849?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 19:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:366b3e97-7bc8-4b91-88c3-7f5c6bd49fa3</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Thanks Kristin - that worked!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80848?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 11:08:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2036d02b-4518-47e6-a72d-3ff839d11fef</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;dfu_bl_image_validate() does only check the old DFU_BANK_1_REGION_START, in addition, you need to add a check for the new DFU_BANK_1_REGION_START.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80846?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 22:39:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e52389dd-51df-43eb-ae3c-16b3cd1ac66c</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Thank you for the links above.  I&amp;#39;m calling device_manager_init() before calling pstorage_register, so I&amp;#39;ve set DFU_APP_DATA_RESERVED to CODE_PAGE_SIZE * 3.  I&amp;#39;ve also looked at the map files for both my bootloader and app.  I should have plenty of free space to update both of these together.  My bootloader starts at 0x3b800, and my app goes from 0x18000 to 0x24A28, which has a length of 0xca28.  With DFU_APP_DATA_RESERVED set to CODE_PAGE_SIZE * 3,  I believe that the App Data section then goes from 0x3ac00 to 0x3b800.  This leaves a Free Space section from 0x24a28 to 0x3ac00, which is 0x161d5 in length.  I&amp;#39;ve now tried to update my bootloader only over-the-air using the following command to generate the .zip file:
nrfutil dfu genpkg my_bootloader.zip --bootloader my_bootloader.hex --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe
I copy the resulting file to my Android phone, and using nRF Toolbox, I reflash the bootloader.  The reflash process indicates it is successful, however, my device will no longer boot up!  The only change I&amp;#39;ve made is adding:
#define DFU_APP_DATA_RESERVED           CODE_PAGE_SIZE * 3
to dfu_types.h.
I see in the last link above a reference to a similar problem.  The suggested solution is to modify dfu_bl_image_validate() because the DFU_BANK_1_REGION_START has changed from the old bootloader to the new bootloader.  Could you explain further what that modification should be?
Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80844?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 12:37:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fa19ce7-79c4-4787-9661-aa2d18a87e6b</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The principle of dual bank update is that there has to be enough available free space for what you want to update. So yes, if there is not enough space for a new bootloader and a new application at the same time, they will have to be updated in two separate steps. First bootloader and then the application would be the best.&lt;/p&gt;
&lt;p&gt;DFU_APP_DATA_RESERVED is just a size, so the start address for the bootloader will still be the same. Note: If using pstorage and reserving 0x400, 0x400 will only correspond to the swap page in pstorage, see more in &lt;a href="https://devzone.nordicsemi.com/question/81300/setting-dfu_app_data_reserved/?answer=81442#post-id-81442"&gt;this&lt;/a&gt; post.&lt;/p&gt;
&lt;p&gt;Regarding DFU_APP_DATA_RESERVED, I would recommend you to take a look at &lt;a href="https://devzone.nordicsemi.com/question/54242/updating-bootloader-to-bootloader-which-preserves-app-data/"&gt;this&lt;/a&gt; post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80845?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 18:03:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27f5fb96-9457-4ad4-ad87-889f6cd5e680</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;I&amp;#39;m using the dual-bank bootloader - based off of the Makefile in .../examples/dfu/bootloader/pca10028/dual_bank_ble_s110/armgcc.  Is it possible that trying to update both bootloader and application at the same time did not fit in the available free space?  Does this mean I need to perform the updates as 2 separate steps - first the bootloader, then the application?  I&amp;#39;m assuming the change I made to DFU_APP_DATA_RESERVED does not change the actual code size of the bootloader, correct?
Thanks...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80847?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 09:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:678566b4-ee21-4093-9e05-c0b2b3d05c85</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Do you use single bank or dual bank DFU?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80843?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 18:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e234b738-6c6b-4db7-9cf0-cc3ddacd825c</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Thanks Kristin!  I&amp;#39;m using SDK 9.0, and found the dfu_types.h file used by my bootloader.  I changed the #define of DFU_APP_DATA_RESERVED from 0 to CODE_PAGE_SIZE (which is 0x400).  I then rebuilt my bootloader and app, and combined them into a .zip file with nrfutil, like this:
&amp;quot;nrfutil dfu genpkg strobe.zip --application myApplication.hex --bootloader myBootloader.hex --application-version 0xffff --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe&lt;/p&gt;
&lt;p&gt;When I try to reflash this zip file to my device using  nRF Toolbox, I get a message that says it is updating part 1 of 2, then a message that it is disconnecting from the device, and then a message saying the upload failed.  My device no longer boots up now.  Any idea what went wrong?  Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protect NVM from being overwritten during reflash</title><link>https://devzone.nordicsemi.com/thread/80842?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a33df7c-3829-411f-b096-156d5add13cc</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The &amp;quot;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Flib_bootloader_dfu_banks.html&amp;amp;cp=4_0_0_3_4_1_2_2&amp;amp;anchor=lib_bootloader_dfu_appdata"&gt;Preserving application data&lt;/a&gt;&amp;quot; section in the bootloader documentation explains what to do to avoid loosing data during the DFU operation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>