<?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>Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88457/android-asking-for-pairing-after-dfu</link><description>Using SDK 15.3 on the embedded side and Android 10 I think it is on the mobile side. 
 We&amp;#39;ve implemented whitelists and hanging onto the bonding information on the embedded side. The idea is that once the mobile side is talking to us we only want to talk</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Sep 2022 15:28:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88457/android-asking-for-pairing-after-dfu" /><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/385358?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 15:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:addd22ec-7065-4536-9712-91a30160375b</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Randy Lee"]Is it possible for the android app to be asking for connections and keys before something is ready on the device side to deal with it so that it thinks that the information hasn&amp;#39;t been stored?[/quote]
&lt;p&gt;I did not test this, but if you start advertising before initializing the peer manager that might be the case. Normally you will do all initialization in the firmware before starting to advertise, though. Can you check that in your firmware?&lt;/p&gt;
&lt;p&gt;However, I do not expect this is the issue. Normally, if the bonds were lost on the nRF for some reason, the Android phone would first try to secure the link using the existing bond, and if that does not exist on the nRF, securing the link would fail and it would disconnect. However, in both your description and the sniffer trace there is no sign of the Android trying to secure the link using an existing bond. Instead, it attempts to bond right away. This is not expected behavior.&amp;nbsp;Can you double check if the bond gets erased on the Android at some point before connecting again after the DFU? (I cannot say what should delete it).&lt;/p&gt;
[quote user="Randy Lee"]about the DFU port: This is pretty much a straight up SDK.. the backport from another SDK is in the main application not the bootloader itself.[/quote]
&lt;p&gt;I see. Based on what I have seen so far there is nothing pointing to an issue in the nRF firmware, but for some reason the Android device misbehaves (trying to re-pair to a device it is already bonded to). The question is why this happens. And to be frank, I have never seen any reports of this before.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/385108?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 17:51:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f714c47d-bb5f-4834-a38d-fbc274acf1ef</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;thought:&amp;nbsp; The device is using all the normal Nordic code and mechanisms for this stuff along with the soft device.&amp;nbsp; Keys and such are stored in FDA areas as usual (see above).&amp;nbsp; Is it possible for the android app to be asking for connections and keys before something is ready on the device side to deal with it so that it thinks that the information hasn&amp;#39;t been stored?&lt;/p&gt;
&lt;p&gt;Thinking outside the box here. I don&amp;#39;t see how, but then again, things happen with embedded systems that aren&amp;#39;t always obvious.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/385088?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 15:44:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1581450-e888-4bcf-912f-2e250e009d4a</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Greetings Einar!&lt;/p&gt;
&lt;p&gt;Yes, this is generally reproduced using mobile version of nRFconnect on Android phones.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/385087?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 15:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54ba44de-f876-4d09-ba5b-7344fb92d07f</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;about the DFU port: This is pretty much a straight up SDK.. the backport from another SDK is in the main application not the bootloader itself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/385038?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 13:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ea81174-244c-4d6a-8eb3-b5fde5259d24</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have inherited this case from Edvin.&lt;/p&gt;
&lt;p&gt;Looking at&amp;nbsp;connection after DFU.pcapng, everything looks normal, as if connecting to a device with no existing bond. My first gut feeling after reading this thread was that perhaps the nRF BT address was different, but that is the same in both traces, so that is not it. Could it be that your custom app for some reason deletes the bond&amp;nbsp;when performing DFU? Are you able to reproduce this using &lt;em&gt;only&lt;/em&gt; nRF Connect for mobile and not your app at all (make sure it is not running in the background as well)?&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/384774?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 11:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39e14e95-22c1-4894-8b53-10b420119a27</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;TOok some time as we had to get the hardware to do this, but attached are the sniffer logs&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/connection-after-DFU.pcapng"&gt;devzone.nordicsemi.com/.../connection-after-DFU.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/normal-connection.pcapng"&gt;devzone.nordicsemi.com/.../normal-connection.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/379571?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2022 14:03:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:102fe3bf-f40a-4b1b-ac12-d17613e34c84</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Ok. I am back (and will stay for a while this time).&lt;/p&gt;
&lt;p&gt;Can you please try to capture a sniffer trace of the connection being entered. Preferably one after a DFU, and one with a normal connection (where the bonding is not requested). Please note that in order for the sniffer to be able to follow into a bonded connection, you probably need to erase the bonds, connect -&amp;gt; bond -&amp;gt; disconnect -&amp;gt; reconnect for the sniffer to be able to capture the LTK. If you are using OOB (6-digit passkey), you need to enter this manually in the sniffer.&lt;/p&gt;
&lt;p&gt;To capture a sniffer trace, you can use the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;nRF Sniffer for Bluetooth LE&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And again, if there is some way for me to reproduce this, please zip a project application that can reproduce the issue. You say that it is a slightly modified ble_app_buttonless_dfu application, but please zip the one that is used for reproducing the issue. I also see that you are mixing a few different SDK versions. Can you please try to stick to one, and see if it is still reproducible, just to make sure that it is not the backport that is causing something to behave weirdly?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/378162?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 15:15:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:749807f8-4b69-4a1b-8734-83d62e21ae06</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Oh, and, I understand the time thing in the summer.... Thank you for being able to keep following this thing...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/378161?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 15:14:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2c68bbf-30aa-4300-8427-7a6af8537af9</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;The &amp;quot;Allow repairing&amp;quot; thing is a code note to myself meaning, in this case, that we&amp;#39;ve got something in the whitelist and to allow that MAC address to talk to me.&amp;nbsp; The app is very locked down here using whitelists to not allow anyone to connect to it unless it&amp;#39;s gone through some serious upper level handshakes.&amp;nbsp; This notation just says that, yes, the whitelists survived the update.&amp;nbsp; Those whitelists use fds so that are hasn&amp;#39;t been wiped (this was a previous bug that we had in the code)&lt;/p&gt;
&lt;p&gt;1) Yes, we&amp;#39;re using a couple of different ones. One team tends to use a Pixel and most of the other teams tend to use a Lenovo tablet.&amp;nbsp; Different versions of Android.&lt;/p&gt;
&lt;p&gt;2) The bootstrap here is effectively the buttonless dfu using SDK15.3 (with a couple of mods backporting some SDK17 fixes). &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5707.bootloader.zip"&gt;devzone.nordicsemi.com/.../5707.bootloader.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/378105?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 13:07:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76870f8c-2305-42c2-a7ef-68423c229490</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I assume that since the log says &amp;quot;Allow repairing: 1&amp;quot;, that the phone requests to pair again, as if it has lost the bonding information. Exactly why the phone decides to do that, I am not sure.&lt;/p&gt;
&lt;p&gt;1: Did you test this with different android phones? If not, can you please do?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2: Is there some way for me to reproduce this? Did you try to reproduce it using the ble_app_buttonless_dfu example? If so, can you zip that modified ble_app_buttonless_dfu example so that I can try to reproduce the issue, preferably without doing too many changes to the rest of the SDK?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am sorry for the long response time. We are a bit understaffed during the summer holidays. Sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/376479?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2022 14:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54b79f4d-9c58-4477-8f71-4b2b40e47934</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Yes, I get that... interestingly enough a couple of times...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; [1634809769.258] Baby service: Version=0.8.4.10, Family=91, ProgramChecksum=05107740
00&amp;gt; [1634809769.261] BLE: bounds: peer_count: 1
00&amp;gt; [1634809769.261] BLE: bounds: peer id 0 is valid
00&amp;gt; [1634809769.261] BLE: bounds: peer address: f0:5c:77:f5:2f:63
00&amp;gt; [1634809769.262] FDS: File found
00&amp;gt; [1634809769.262] FDS: File read successfully
00&amp;gt; [1634809769.262] BLE: Whitelist contains a peer. Start advertising.
00&amp;gt; [1634809769.262] Whitelist: Applied whitelist with addr_cnt=1 irk_cnt=1
00&amp;gt; [1634809200.272] SIM Restart
00&amp;gt; [1634809200.274] temperature: 26.0C
00&amp;gt; [1634809200.275] Vbat: 100% (2.52V)
00&amp;gt; [1634809200.290] LOG: 242,9,0x00,0x00
00&amp;gt; [1634809200.345] Motion set: a=-0.158072, A[xyz]=0.005859,-0.115234,-0.833984
00&amp;gt; [1634809200.516] Switched from event 0 to event 11
00&amp;gt; [1634809200.536] LOG: 11,9,0x00,0x00
00&amp;gt; [1634809201.766] BLE: Unhandled PeerManager event 5 (PM_EVT_CONN_SEC_PARAMS_REQ?)
00&amp;gt; [1634809201.766] BLE: Unhandled PeerManager event 8 (PM_EVT_PEER_DATA_UPDATE_SUCCEEDED)
00&amp;gt; [1634809201.766] BLE: Bonded Peer Connected (PM_EVT_PEER_DATA_UPDATE_SUCCEEDED)
00&amp;gt; [1634809201.767] BLE: Unhandled PeerManager event 14 (PM_EVT_LOCAL_DB_CACHE_APPLIED)
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
00&amp;gt; [1634809201.768] BLE: Peer connected (PM_EVT_BONDED_PEER_CONNECTED)
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 27 bytes.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
00&amp;gt; [1634809201.951] BLE: Data len is set to 0xF4(244)
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 328
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120
00&amp;gt; [1634809204.405] BLE: Unhandled PeerManager event 1 (PM_EVT_CONN_SEC_START)
00&amp;gt; [1634809204.409] BLE: Unhandled PeerManager event 5 (PM_EVT_CONN_SEC_PARAMS_REQ)
00&amp;gt; [1634809204.410] FDS: File found
00&amp;gt; [1634809204.410] FDS: File read successfully
00&amp;gt; [1634809204.410] Whitelist: check Whitelist file found. peer_id=0
00&amp;gt; [1634809204.410] BLE: Allow repairing: 1
00&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
00&amp;gt; [1634809206.511] BLE: Unhandled PeerManager event 8 (PM_EVT_PEER_DATA_UPDATE_SUCCEEDED)
00&amp;gt; [1634809206.511] BLE: Unhandled PeerManager event 2 (PM_EVT_CONN_SEC_SUCCEEDED)
00&amp;gt; [1634809206.515] BLE: Unhandled PeerManager event 8 (PM_EVT_PEER_DATA_UPDATE_SUCCEEDED)
00&amp;gt; [1634809206.519] BLE: Unhandled PeerManager event 8 (PM_EVT_PEER_DATA_UPDATE_SUCCEEDED)
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x0.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120
00&amp;gt; [1634809207.347] BLE: Unhandled PeerManager event 8
00&amp;gt; [1634809211.634] Play Sound 13, 0xD
00&amp;gt; [1634809216.951] Whitelist: Applied whitelist with addr_cnt=1 irk_cnt=1
00&amp;gt; [1634809216.952] BLE: Peer disconnected&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/375258?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 08:31:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ae6a90f-ed87-4da1-8c17-41b09bc3224b</guid><dc:creator>Edvin</dc:creator><description>[quote user="Randy Lee"] I don&amp;#39;t know what the second one is, but it&amp;#39;s possible it&amp;#39;s the same device as Android phones can apparently change MAC addresses from time to time[/quote]
&lt;p&gt;Yes they do, but they shouldn&amp;#39;t take up more than one peer. There are mechanisms to recognize peers that have changed addresses using an IRK (Identity resolving key).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When you connect to the bonded device after the DFU is performed, do you get the event (on the nRF)&amp;nbsp;PM_EVT_BONDED_PEER_CONNECTED?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/374414?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 21:01:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a90f2ec5-307e-4056-9dcf-cf9260deca09</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;so we got that code to work... I&amp;#39;ve annotated the output from that code with &amp;quot;bounds: &amp;quot; so as to note it specifically from the other things that are logging... You&amp;#39;ll find it towards the back.&amp;nbsp; This output here is right after the thing is booting after a DFU:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;00&amp;gt; [1634810895.013] POR Vbat: (2.41V)&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Creating a SoftDevice task.&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; ble_scan: Adding filter on RWStudentID name&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Enter softdevice_task.&lt;br /&gt;00&amp;gt; [1634810895.253] FDS: File found&lt;br /&gt;00&amp;gt; [1634810895.253] FDS: File read successfully&lt;br /&gt;00&amp;gt; [1634810895.253] Whitelist: Whitelist file found. peer_id=0&lt;br /&gt;00&amp;gt; [1634810895.255] FDS: File found. Writing data into it&lt;br /&gt;00&amp;gt; [1634810895.255] FDS: Write succeeded.&lt;br /&gt;00&amp;gt; [1634810895.260] Baby service: Version=0.8.4.9, Family=91, ProgramChecksum=87778671&lt;br /&gt;00&amp;gt; [1634810895.263] BLE: bounds: peer_count: 2&lt;br /&gt;00&amp;gt; [1634810895.263] BLE: bounds: peer id 0 is valid&lt;br /&gt;00&amp;gt; [1634810895.263] BLE: bounds: peer address: f0:5c:77:f5:2f:63&lt;br /&gt;00&amp;gt; [1634810895.263] BLE: bounds: peer id 1 is valid&lt;br /&gt;00&amp;gt; [1634810895.263] BLE: bounds: peer address: 94:be:46:11:e2:5b&lt;br /&gt;00&amp;gt; [1634810895.265] FDS: File found&lt;br /&gt;00&amp;gt; [1634810895.265] FDS: File read successfully&lt;br /&gt;00&amp;gt; [1634810895.265] BLE: Whitelist contains a peer. Start advertising.&lt;br /&gt;00&amp;gt; [1634810895.265] Whitelist: Applied whitelist with addr_cnt=1 irk_cnt=1&lt;/p&gt;
&lt;p&gt;The first one (peer ID 0) is the current MAC address of the device talking to it.. I don&amp;#39;t know what the second one is, but it&amp;#39;s possible it&amp;#39;s the same device as Android phones can apparently change MAC addresses from time to time (this one is a Pixel 4 running Android 11&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/374214?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 18:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a6995f8-c4a3-4e35-9b40-06171f690d45</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Our app uses the Nordic buttonless bootloader as the base for the bootloader portion and is called by the application to get it started..&lt;/p&gt;
&lt;p&gt;The version we&amp;#39;re running has those parameters set:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; add_char_params.cccd_write_access = SEC_OPEN;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; add_char_params.write_access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SEC_OPEN;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; add_char_params.read_access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SEC_OPEN;&lt;/p&gt;
&lt;p&gt;since we can&amp;#39;t get there but by a bonded thing that is explicitly whitelisted.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m still attempting to get the number of peers seen.&amp;nbsp; For some interesting reason that particular piece of code is being an issue in situ.&amp;nbsp; It gives me an output using SES directly but not if I&amp;#39;m using RTT viewer. Curiously all the stuff around it gives me output so I&amp;#39;m having some experiments done to figure out just why that it... I hope to have some usable data early next week.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/373372?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 09:02:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4f5f0eb-7d7e-4fb9-9676-068d5a81060c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;As it is mentioned in that ticket, you need to enable the SERVICE_CHANGED in sdk_config.h of your application. Ironically, adding it later wouldn&amp;#39;t help, but if you add it in your initial application, that should solve that. So for the phones that have already cached the services, First forget the device from the iPhone&amp;#39;s bluetooth menu, then turn off bluetooth from the phone&amp;#39;s settings (Settings menu, not the &amp;quot;drag up from bottom menu&amp;quot;). Wait for about 15 seconds, and turn bluetooth back on. Then it should be forgotten. Then, if you have the service changed service enabled, then the peer manager will use this to tell the phone to do a new service discovery if it has new services.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now, regarding our issue:&lt;/p&gt;
&lt;p&gt;I need you to check the number of peers in the peer manager (using the snippets in my answer from 13th of june.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does this also happen if you use the &amp;quot;normal&amp;quot; bootloader and e.g. the ble_app_buttonless_dfu example to perform the update? Did you test this? If you test this with ble_app_buttonless_dfu, there is a setting in sdk_config.h called&amp;nbsp;NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS. Leave this set to 0, because this does a couple of things. Then try to open ble_dfu_unbonded.c, and set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    add_char_params.cccd_write_access = SEC_JUST_WORKS;
    add_char_params.write_access      = SEC_JUST_WORKS;
    add_char_params.read_access       = SEC_OPEN;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in ble_dfu_buttonless_char_add(). That should trigger the pairing/bonding in the app, and then you can perform a DFU and try to connect again. Does that trigger the issue where you need to bond again?&lt;/p&gt;
&lt;p&gt;NB: This example already have the NRF_SDH_BLE_SERVICE_CHANGED set to 1.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/373273?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 13:51:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61a44472-5d31-40f5-b0f3-24685ba905cb</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;iOS: my engineers are reporting that iOS does not have this problem..&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;They did run into a services cache problem on that platform, but that&amp;#39;s another problem (see &lt;a id="" href="https://developer.apple.com/forums/thread/76339"&gt;https://developer.apple.com/forums/thread/76339&lt;/a&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/373163?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 08:03:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebe2a0b1-a340-4352-b1be-1f7f24378526</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I understand.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Well, sometimes a custom log can give some insight in whats going on, but it is not always conclusive.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For the iOS part, if you are using the standard bootloader from the nRF5 SDK (without too much modifications), you should be able to use the nRF Connect for iOS app to perform the update, and then try to connect to it afterwards, to see if it also requires to re-bond. This is just for debugging purposes, to see whether this issue is limited to Android, or on all platforms. Perhaps it can narrow down possible reasons for this behavior.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/373071?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 14:19:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82c116df-872b-49f7-aebf-7e67a4a73bdf</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;This is full custom hardware; I rarely use a dev kit from anyone as they are so limiting to what I do. Reproducing it on the DK would be difficult as there is so much code there that assumes custom hardware.&amp;nbsp; Also we&amp;#39;ve seen this over 5 or 6 products all with the same basic code base.&lt;/p&gt;
&lt;p&gt;As to Android version, We&amp;#39;ve seen it on 10 and 11 (these logs were produced with an 11 connection). Never tried it on iOS as we don&amp;#39;t have the app we use with it on iOS and it&amp;#39;s rather difficult to get the connection to begin with without the app.&amp;nbsp; We can try it at some point here tho as that would be something instructive I think.&lt;/p&gt;
&lt;p&gt;Line 52 is saying that, when it comes back from POR, that there whitelist is still intact in flash storage.&amp;nbsp; That implies to me that any bonding information kept in the same basic storage place would be still intact.&amp;nbsp; I will have to verify that with your code suggestion the next time I get a chance.&lt;/p&gt;
&lt;p&gt;Line 54 has what I assume is step 3 pairing requests and whatnot coming through. Ignore anything labeled &amp;quot;RFID:&amp;quot;&amp;nbsp; It&amp;#39;s about 5 seconds later (line around 188) where we see the bonding completion....&lt;/p&gt;
&lt;p&gt;The upshot is that these logs aren&amp;#39;t as informative as they could possibly be.&amp;nbsp; I don&amp;#39;t have an air sniffer at present to see the traffic here, which would be far more informative, and for that I apologize.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/372922?ContentTypeID=1</link><pubDate>Fri, 17 Jun 2022 06:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e80293-53ae-4ca7-acd8-4f6f6ccf7b7c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Are you reproducing this on a DK or custom HW? If custom, can you try to reproduce it on a DK? And does it only happen on a certain Android version (10) or on any android version? And have you tried iOS? Is there some way for me to replicate this issue on a DK with a phone? Preferably iOS, but I can try to get hold of an Android if I need to.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;From the logs, you are saying that on line 52, when it says &amp;quot;applied whitelist with addr_cnt=1 irk_cnt=1&amp;quot;, it will still go through the pairing process? Is there anything in the logs saying when you need to pair or not?&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/372852?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 14:17:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dd8683a-1840-404d-a120-9c13121db5d0</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Sorry, I forgot to say what we did exactly here... This is using Android 11 as the initiator&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set DFU mode
&lt;ul&gt;
&lt;li&gt;Set promiscuous mode on device (put it into a reception state where it is ready for bonding)&lt;/li&gt;
&lt;li&gt;Connect&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Pair&lt;/li&gt;
&lt;li&gt;Join (this is our special thing that tells it to whitelist the thing that bonded)&lt;/li&gt;
&lt;li&gt;Send BOOTLOADER command (line 38)&lt;/li&gt;
&lt;li&gt;Disconnect&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;DFU (this wouldn&amp;#39;t be in the logs because the bootloader doesn&amp;#39;t have that kind of instrumentation)&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Connect with nRFconnect&lt;/li&gt;
&lt;li&gt;Do DFU&lt;/li&gt;
&lt;li&gt;Disconnect&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Restore bonding
&lt;ul&gt;
&lt;li&gt;Connect with nRFconnect (line 53)&lt;/li&gt;
&lt;li&gt;Pair&lt;/li&gt;
&lt;li&gt;Disconnect&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Search the document for POR; That the Power On Reset points so those are the points where the application running is regaining control from the bootloader.&lt;/p&gt;
&lt;p&gt;Special note: the lines tagged with e.g. [1634809205.873] are part of the logging from the application itself.&amp;nbsp; Things tagged e.g. &amp;lt;debug&amp;gt; are Nordic code logs... you can ignore most of the lines from the application I think.&lt;/p&gt;
&lt;p&gt;Note that the whitelist is still populated coming back so I have problems thinking that the bonding information is gone too...&lt;/p&gt;
&lt;p&gt;Line 245: This is in response to PM_EVT_CONN_SEC_CONFIG_REQ on a pm event&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll be able to focus back on this next week and get your code implanted and a log back to you on it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/372812?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 12:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78eebc27-c333-4b3c-9f7b-4e9765571583</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So in this log (baby_logs.txt), is this from after the DFU, or is it the first time you turn it on (before ever bonding with the phone)?&lt;/p&gt;
&lt;p&gt;If that is the case, then it doesn&amp;#39;t have any devices in the whitelist, and I would assume that it doesn&amp;#39;t have any devices in the peer manager either, since the whitelist typically uses the peer manager to load the addresses for the whitelist.&lt;/p&gt;
&lt;p&gt;If that is not the case, then can you please describe to me what I am looking at in the baby_logs.txt log?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/372390?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2022 12:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bb8700c-a580-4a66-b659-0f915cad6480</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;One of my other engineers managed to grab the following logs (before I had time to get your suggested code in them) which might shed some light on things.&amp;nbsp; On the Baby Logs, you can ignore the RFID: lines as those are the application itself and have nothing to do with BLE..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/baby-logs.txt"&gt;devzone.nordicsemi.com/.../baby-logs.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Android-logs.txt"&gt;devzone.nordicsemi.com/.../Android-logs.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/372048?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 08:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e81e38d5-57ca-4516-b921-a065f5a0055b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Edvin Holmseth"]And also, what does the log from your application say? Please copy paste the log from before you DFU, i.e. when you don&amp;#39;t have to pair again and when you do have to pair again. Do they look the same?[/quote]
&lt;p&gt;I was actually thinking of the log from the nRF chip, if you have any.&lt;/p&gt;
&lt;p&gt;I see from the log 6.txt that it receives a pairing request. The address of the nRF chip is the same before and after the DFU (I&lt;span&gt; &lt;/span&gt;13:14:35.703&lt;span&gt; &lt;/span&gt;Connected to DF:A0:E4:ED:42:5C), so that should not be the issue. Perhaps the the nRF doesn&amp;#39;t have the bonding data after the DFU process.&lt;/p&gt;
&lt;p&gt;Please check that&amp;nbsp;delete_bonds() is not called after the DFU. Try setting a breakpoint or add some logging in the&amp;nbsp;delete_bonds() function to see whether this is triggered.&lt;/p&gt;
&lt;p&gt;Also, you can add this before you start advertising:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void check_bonds(void)
{
    ret_code_t err_code;
    uint32_t peer_count;
    pm_peer_id_t peer_id = PM_PEER_ID_INVALID;
    pm_peer_data_bonding_t peer_data;
    
    peer_count = pm_peer_count();
    NRF_LOG_INFO(&amp;quot;peer_count: %d&amp;quot;, peer_count);
    
    peer_id = pm_next_peer_id_get(PM_PEER_ID_INVALID);
    if (peer_id != PM_PEER_ID_INVALID)
    {
        while (peer_id != PM_PEER_ID_INVALID)
        {
            NRF_LOG_INFO(&amp;quot;peer id %d is valid&amp;quot;, peer_id);
            err_code = pm_peer_data_bonding_load(peer_id, &amp;amp;peer_data);
            APP_ERROR_CHECK(err_code);
            NRF_LOG_INFO(&amp;quot;peer address: %02x:%02x:%02x:%02x:%02x:%02x&amp;quot;, peer_data.peer_ble_id.id_addr_info.addr[5],
                                                                        peer_data.peer_ble_id.id_addr_info.addr[4],
                                                                        peer_data.peer_ble_id.id_addr_info.addr[3],
                                                                        peer_data.peer_ble_id.id_addr_info.addr[2],
                                                                        peer_data.peer_ble_id.id_addr_info.addr[1],
                                                                        peer_data.peer_ble_id.id_addr_info.addr[0]);
            
            peer_id = pm_next_peer_id_get(peer_id);
        }
    }
    else 
    {
        NRF_LOG_INFO(&amp;quot;no valid peers&amp;quot;);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It will print the address of all the peers that are bonded with the nRF. Add it right before you start advertising.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/371738?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 19:48:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62fb4542-d5ae-4a09-8d2c-2d276c916670</guid><dc:creator>Randy Lee</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/88457/android-asking-for-pairing-after-dfu/370792#370792"]And also, what does the log from your application say?[/quote]
&lt;p&gt;Attached is the log from nRFconnect on Android.&amp;nbsp; This has a complicated connection scheme so I have not attempted this on iOS to see if there is a difference in it.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Once the device is paired and bonded through our application, close the application and then connect back up with nRFconnect (this bypasses all the oddities of our application&lt;/li&gt;
&lt;li&gt;Then put the device into DFU mode via struct command 0x0000000007 in nRF Connect (line 53). This causes the device to change to bootloader mode.&amp;nbsp; In this mode, we aren&amp;#39;t using the whitelists and such...&lt;/li&gt;
&lt;li&gt;run DFU&lt;/li&gt;
&lt;li&gt;Allow reconnect of nRFconnect when done (line 985- ~994)&lt;/li&gt;
&lt;li&gt;Android asks pairing again (starting at line 995 or so)...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;#39;ll be looking at the embedded side to answer some questions a bit later (this is going to take awhile to do here so you&amp;#39;ll have to bear with me please)&lt;/p&gt;
&lt;p&gt;Thank you for your help so far in this.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Log-6.txt"&gt;devzone.nordicsemi.com/.../Log-6.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android asking for pairing after DFU</title><link>https://devzone.nordicsemi.com/thread/370792?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 06:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b2b0385-7042-456e-bbd5-8650ed334bbc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok. Then you need to start investigating the other things that I have mentioned:&lt;/p&gt;
[quote user="Edvin Holmseth"]Do you see whether the peripheral device has changed anything? Or did you try to debug the applciation? Is the bonding data still present on the peripheral? Does the peripheral use the same Bluetooth LE address as before the DFU update took place?[/quote]
&lt;p&gt;&lt;/p&gt;
[quote user="Edvin Holmseth"]You can also make your application to tell you how many peers that are stored in the beginning of your application, to verify that it is in fact the nRF that has lost the bonding data. What does it say?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And also, what does the log from your application say? Please copy paste the log from before you DFU, i.e. when you don&amp;#39;t have to pair again and when you do have to pair again. Do they look the same?&lt;/p&gt;
&lt;p&gt;Does this only happen on Android? Did you try with iOS?&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>