<?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>Bonding information lost after DFU OTA update SDK 10.0 SD 8.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21599/bonding-information-lost-after-dfu-ota-update-sdk-10-0-sd-8-0</link><description>Hi, 
 We are currently facing this issue, where after a DFU application firmware update (or bootloader update) the bonding information gets wiped out. 
 We are using a custom board as peripheral based on NRF51822, with Soft Device S110 8.0 and SDK 10</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Apr 2017 08:48:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21599/bonding-information-lost-after-dfu-ota-update-sdk-10-0-sd-8-0" /><item><title>RE: Bonding information lost after DFU OTA update SDK 10.0 SD 8.0</title><link>https://devzone.nordicsemi.com/thread/84795?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2017 08:48:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e5eb376-0ce6-4096-b875-75728ebf259a</guid><dc:creator>NateABC</dc:creator><description>&lt;p&gt;Hi, the issue seems to be resolved for us.&lt;/p&gt;
&lt;p&gt;We&amp;#39;ve tried quite a few combinations, settings and code changes to get this working, so I&amp;#39;m not quite sure what exactly resolved it, (it could have been really simple) but it had to be of the following things:&lt;/p&gt;
&lt;p&gt;-- We were using &amp;quot;nRFConnect Mobile&amp;quot; (from Android 7.0 smartphone). We failed to notice that there were Settings for &amp;quot;DFU options&amp;quot; and the &amp;quot;Keep bond information&amp;quot; in that menu was  by default disabled. We have since enabled this option. This has the side-effect of creating a &amp;quot;cached services&amp;quot; issue after a DFU update, but I&amp;#39;ll be creating a separate question thread for this and another issue. This option was definitely responsible for what we were seeing on the end of the DFU update (the nRFConnect disconnected from the boards and became unbonded).&lt;/p&gt;
&lt;p&gt;-- Our application had some code in-place that in-case it read &amp;quot;garbage&amp;quot; or values that didn&amp;#39;t make sense it some of the application context data fields, it would delete all bonding device information, and start over. I don&amp;#39;t believe this could have been the culprit though, since this should only be responsible for clearing those data once after a new firmware update, and we were experiencing the issue consistently upon subsequent (multiple) updates of the same firmware image. We have not removed this code (because it is useful), but we added some extra code whereby after a new firmware update, if a persisted (in external memory) revision number has changed (indicating radical changes), then we explicitly enforce deletion of all bonding data to ensure that the new firmware won&amp;#39;t be reading &amp;quot;garbage&amp;quot; in case it mistakes them for valid data.&lt;/p&gt;
&lt;p&gt;-- In the Keil settings for our application firmware project, in the IROM1 size we now account for the restricted space that the application firmware should fit into, due to dual banking, and preserving application data. This value is identical to the DFU_IMAGE_MAX_SIZE_BANKED macro from dfu_types.h from the dfu firmware project.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IROM1: 0x18000, size: 0x11800 
IRAM1: 0x20002000, size: 0x2000
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-- In the bootloader firmware project, the DFU_APP_DATA_RESERVED is now set to 0x1000 which is 4 * CODE_PAGE_SIZE. I don&amp;#39;t think that this should change anything. The previous value was 0xC00 (3 code pages), and the bootloader was using padding to get it to a multiple of 0x800 which again was 0x1000, so this change shouldn&amp;#39;t do anything different effectively. In the application firmware project, the PSTORAGE_NUM_OF_PAGES   remained as   2.&lt;/p&gt;
&lt;p&gt;And I think that is all. We&amp;#39;ve checked with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog -f nrf51 --readcode firmwareyyy.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and &amp;quot;diff&amp;quot; the dumps among subsequent firmware updates, and the bonding data seem to be preserved as they should, starting from the 0x3B400 address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding information lost after DFU OTA update SDK 10.0 SD 8.0</title><link>https://devzone.nordicsemi.com/thread/84794?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 12:48:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42fc3aa3-b938-439a-8882-ff423d997ee9</guid><dc:creator>NateABC</dc:creator><description>&lt;p&gt;For the bootloader the settings (as entered in the Keil &amp;quot;Options for Target&amp;quot; dialogue) are:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IROM1: 0x3C000, size: 0x3C00
IRAM1: 0x20002C00, size: 0x1380
IRAM2: 0x20003F80, size: 0x80 (NoInit checked)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For the application:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IROM1: 0x18000, size: 0x24000 (also tried 0x23400 (= 0x24000 - 0xC00 ) here
IRAM1: 0x20002000, size: 0x2000
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;#39;ll try increasing the DFU_APP_DATA_RESERVED in the bootloader and the PSTORAGE_NUM_OF_PAGES define in the application firmware accordingly and report if anything changes.&lt;/p&gt;
&lt;p&gt;Just in case it is related, the pstorage_platform.h in the bootloader project is different than the one for the application project. The bootloader one also has 2 flash code pages reserved, but that space is reserved at the end of the flash memory (NRF_FICR-&amp;gt;CODESIZE). I have made no changes to that file. It&amp;#39;s as it was from the SDK (10.0.0).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding information lost after DFU OTA update SDK 10.0 SD 8.0</title><link>https://devzone.nordicsemi.com/thread/84793?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 12:06:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2446b821-4c33-478f-8ca3-4fec623d28ce</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;As far as I know the bootloader should only erase bank 1 when the DFU start packet is received, i.e. you should see the new application image lying in both bank 0 and bank 1 after the DFU. Have you tried increasing the DFU_APP_DATA_RESERVED define , e.g. 4 or 5 pages? Also could you post the IROM and IRAM settings for your bootloader?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>