<?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>Proper way to delete bond information before DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20304/proper-way-to-delete-bond-information-before-dfu</link><description>Dear Nordic experts, 
 After experiencing a lot of random issues when retaining bond information during a DFU on some mobile devices, we&amp;#39;ve decided to choose the safest route and remove any bond information prior to performing a DFU.
However, this proves</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Mar 2017 15:16:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20304/proper-way-to-delete-bond-information-before-dfu" /><item><title>RE: Proper way to delete bond information before DFU</title><link>https://devzone.nordicsemi.com/thread/79106?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 15:16:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d15dd9be-f33e-4573-9cd7-6c879afe541a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi jj,&lt;/p&gt;
&lt;p&gt;yes it&amp;#39;s fine. It&amp;#39;s just a small inconvenient that end user have to manually remove bond on the phone.&lt;/p&gt;
&lt;p&gt;You can simply call dfu_ble_svc_peer_data_set() to send the address (not the bond info) to the bootloader before you delete bond on the device manager , then you switch to bootloader after you finish deleting (without calling dfu_ble_svc_peer_data_set() again).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to delete bond information before DFU</title><link>https://devzone.nordicsemi.com/thread/79105?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 14:43:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2e3d4fa-99fe-4b7c-9e08-758f525ad96e</guid><dc:creator>-jj-</dc:creator><description>&lt;p&gt;Hi Hung Bui, thank you for your reply.&lt;/p&gt;
&lt;p&gt;The reason we decided to remove the bond info before DFU is that we&amp;#39;ve seen phone specific issues while retaining the bond, which not occured when bonding was not used. One of the issues was that with a certain phone the peripheral disconnects somewhere during the transfer (around 70%) when we use bonding while it continues flawlessly without bonding. I assume due to some connection time-out which apparently does not occur when bonding is not used. We want to be sure that the DFU process is as stable as possible and in our current experience it is most stable when we don&amp;#39;t use bonding.&lt;/p&gt;
&lt;p&gt;Following your answer I am thinking of the following solution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;App sends DFU request&lt;/li&gt;
&lt;li&gt;Peripheral receives request, store (bonded) peer address temporarily&lt;/li&gt;
&lt;li&gt;Remove bond&lt;/li&gt;
&lt;li&gt;During the switch to DFU, call dfu_ble_svc_peer_data_set with the previously stored address&lt;/li&gt;
&lt;li&gt;Peripheral disconnects to switch to bootloader&lt;/li&gt;
&lt;li&gt;Upon receiving the disconnection event in the app, remove bond on the phone&lt;/li&gt;
&lt;li&gt;DFU lib tries to reconnect to peripheral in bootloader mode (which should accept the connection with the stored address)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Would this be a suitable solution? Do you foresee any risks with this approach?&lt;/p&gt;
&lt;p&gt;Thanks once again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to delete bond information before DFU</title><link>https://devzone.nordicsemi.com/thread/79104?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 14:29:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db2eb52e-bfd6-417a-a41f-7eb2531ec4d6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi jj,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s most likely because the dfu_app_peer_data_set(conn_handle); couldn&amp;#39;t find a central address to send to the bootloader. In the bootloader if there is no peer data is forwarded (either central address or bonding key) it will start with a new BLE address (application BLE address + 1).&lt;/p&gt;
&lt;p&gt;Please check dfu_transport_update_start() inside dfu_transport_ble.c&lt;/p&gt;
&lt;p&gt;I assume you plan to delete bond on the phone also before doing DFU update ?&lt;/p&gt;
&lt;p&gt;There are some option, first is to remove the code to change address in dfu_transport_update_start(). But you need to make sure bond info on the phone is also deleted.&lt;/p&gt;
&lt;p&gt;Another option is to modify the DFU master app to connect to the +1 address instead of the normal address. This requires modification of the DFU master app.&lt;/p&gt;
&lt;p&gt;A better solution is to try to retain the bond information. If you want to do that, you can tell me which issue you had. (Note that the current DFU library on Android, will try to delete bond info after it finished DFU update, you may need to modify it if you want to retain bonding).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>