<?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>Re-Bonding Issue with Phone after DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81829/re-bonding-issue-with-phone-after-dfu</link><description>Using nRF52832 and nRF52840 
 nRF5 SKD 17.1.0 
 I have bonding running, and have bonded initially (first run with bonding enabled), and Buttonless DFU upgraded once (using a .zip file). It won’t repeat. 
 I erase and program the entire flash with a .hex</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Nov 2021 16:51:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81829/re-bonding-issue-with-phone-after-dfu" /><item><title>RE: Re-Bonding Issue with Phone after DFU</title><link>https://devzone.nordicsemi.com/thread/339504?ContentTypeID=1</link><pubDate>Wed, 17 Nov 2021 16:51:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0507c8c-baae-49e3-a638-4257a8e25ca4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not sure what the specific issue is here, perhaps you can elaborate? Until then, but combining&amp;nbsp;&amp;quot;&lt;em&gt;Re-Bonding Issue with Phone after DFU&lt;/em&gt;&amp;quot; with &amp;quot;&lt;em&gt;If this is run using the nRF52840 Dongle and the nRF Desktop tools I can run the DFU multiple times&lt;/em&gt;&amp;quot; I interpret this to perhaps be an issue that you can do DFU multiple times with nRF Connect fro desktop as DFU master, but not a phone? If that is the case, then it is important to note that all modern phone OSs / BT stacks prevent automatic repairing. If the nRF and phone has bonded, and the bonding information is lost on the nRF, the user must delete the bond on the phone manually before they can bond again.&lt;/p&gt;
&lt;p&gt;Bonds can be lost on the nRF for several reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deliberately deleted in some way&lt;/li&gt;
&lt;li&gt;Inadvertently deleted, for instance because of:
&lt;ul&gt;
&lt;li&gt;A full chip erase which (deleted the FDS pages where the peer manager stores bonding information)&lt;/li&gt;
&lt;li&gt;A DFU operation using a bootloader which is incorrectly configured with regards to the number of FDS pages used in the application. The NRF_DFU_APP_DATA_AREA_SIZE define in the bootloader&amp;#39;s sdk_config.h must be adjusted to match the number of FDS pages used by the applicaiton. If this is too small, FDS pages may be overwritten during a DFU operation, causing data loss including bonding data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
[quote user=""]Which of these are needed?[/quote]
&lt;p&gt;This depends a bit on your app. What you typically would use of what you list is pm_handler_secure_on_connection() should normally be called in your BLE event handler for all events.&amp;nbsp;pm_handler_disconnect_on_sec_failure() is normally called for alle vents in the applications peer manager event handler. I suggest you refer to a example application to see examples, and API doc for details. Other things like&amp;nbsp;&lt;/p&gt;
[quote user=""]By adding the case statement it appears to work, but are there things i am missing?[/quote]
&lt;p&gt;These are functions that provide various features you may or may not want (automatically try to secure link on connection,&amp;nbsp;automatically disconnect on insufficient security, etc. Whatever is the &amp;quot;correct&amp;quot; approach here is application specific.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>