<?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>The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted</link><description>Hello! 
 I am developing an application which is connecting to an nRF52 board using the Android-BLE-Library implemented by Nordic The application is doing the following: 
 
 Perform an LE scan using Google&amp;#39;s recommended Android stock class, which is BluetoothLeScanner</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Jun 2021 15:58:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted" /><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315469?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 15:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af6cca36-0014-458d-9086-ae546170a812</guid><dc:creator>Poorp</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315360#315360"]I don&amp;#39;t think this is&amp;nbsp;caused by FW side, I think it is the app side,[/quote]
&lt;p&gt;That has been my conclusion as well&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315360#315360"]. Are you able to modify back the FW to make it work with the app, [/quote]
&lt;p&gt;Yes, and no. The bug seems to have started happening when we switched &lt;em&gt;from&lt;/em&gt; &amp;#39;numerical comparison&amp;#39;- &lt;em&gt;to &lt;/em&gt;&amp;#39;just works&amp;#39; bonding. Switching back stops it, but requires a different build of the app&lt;br /&gt;&lt;br /&gt;Two things that may be relevant:&lt;/p&gt;
&lt;p&gt;* In my limited testing, the bug does not occur in android when using the nrf connect app to trigger bonding by writing to an attribute that requires bonding, even with &amp;#39;just works&amp;#39;&lt;/p&gt;
&lt;p&gt;* My understanding is that the bug does not occur if my colleague calls &amp;#39;startDiscovery&amp;#39; on the android side before initiating &amp;#39;just works&amp;#39; bonding&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315360?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 11:23:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5088090f-5b96-4cff-b298-d4c90dda3066</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Thanks for the clarification.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think this is&amp;nbsp;caused by FW side, I think it is the app side, though it&amp;#39;s not something we have seen before. Are you able to modify back the FW to make it work with the app, and possible narrow down the cause that way?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315142?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 12:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2a46671-ad16-4343-8de8-c4c19f45d7cc</guid><dc:creator>Cornel Gligan</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315122#315122"]I assume that you first see an issue on the re-connect?[/quote]
&lt;p&gt;As I said before, disconnect/reconnect works just fine. No errors triggered.&lt;/p&gt;
&lt;p&gt;So before rebooting the phone, I tried disconnect/reconnect dozens of times and it just worked fine. The reconnection always happened successfully.&lt;/p&gt;
&lt;p&gt;When the phone is rebooted then the bond is removed&amp;nbsp;and that is the issue that the device is not bonded anymore (not present anymore int&amp;nbsp;bonded devices list on Android side).&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315122#315122"]If one of the devices are out of range and/or turned OFF[/quote]
&lt;p&gt;The issue happens even when is just one device connected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315128?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 12:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e143ce9-4c80-481a-9d9c-0c0621f832ab</guid><dc:creator>Poorp</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315122#315122"]If one of the devices are out of range and/or turned OFF, then there will a disconnect, until the peer again is in-range or turned ON, then there will be re-connect. I assume that you first see an issue on the re-connect?[/quote]
&lt;p&gt;&lt;br /&gt;No, I should have been more clear. The short version is&lt;br /&gt;&lt;br /&gt;1) Phone and one device are bonded/connected&lt;br /&gt;2) device is turned off and never turned on again (so no more traffic)&lt;br /&gt;[At this point the Phone still has the bond, and can reconnect if the device is turned on again (which it never is, but we tested]&lt;br /&gt;3) Phone is rebooted, once it has started again the bond is gone&lt;br /&gt;&lt;br /&gt;It is also worth noting that this bug does not happen if one uses nrf connect to trigger bonding by writing to one of the attributes. Only if it is done by our app&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="99439" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315120#315120"]Can you try to comment out&amp;nbsp;CONFIG_BT_TINYCRYPT_ECC and possible add&amp;nbsp;CONFIG_BT_ECC=n. I guess I should try this myself first.[/quote]
&lt;p&gt;&lt;br /&gt;That fails to compile due to smp requiring them, I didn&amp;#39;t investigate further than the compilation error. So there may be a workaround&lt;br /&gt;&lt;br /&gt;subsys/bluetooth/host/libsubsys__bluetooth__host.a(smp.c.obj): in function `bt_smp_init&amp;#39;:&lt;br /&gt;/home/censored/.local/opt/ncs/zephyr/subsys/bluetooth/host/smp.c:5564: undefined reference to `bt_pub_key_gen&amp;#39;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315122?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 12:17:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9074ad24-93d7-4a00-98cc-c2613ba044ee</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;If one of the devices are out of range and/or turned OFF, then there will a disconnect, until the peer again is in-range or turned ON, then there will be re-connect. I assume that you first see an issue on the re-connect?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315120?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 12:15:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9495b937-e344-4bb1-b3fc-aab18bd5253d</guid><dc:creator>Poorp</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315117#315117"]&amp;nbsp;This log doesn&amp;#39;t show the re-connect though.&amp;nbsp;[/quote]
&lt;p&gt;What do you mean &amp;quot;the reconnect&amp;quot;? In the steps to perform the bug there is only one connection, the inital on-boarding. After that the device is turned off and left off. Only the phone is turned on when the bond is deleted.&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315117#315117"]Can you try to comment out&amp;nbsp;CONFIG_BT_TINYCRYPT_ECC and possible add&amp;nbsp;CONFIG_BT_ECC=n. I guess I should try this myself first.[/quote]
&lt;p&gt;I&amp;#39;ll try that and report back&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315117?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 12:11:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcfa10a7-b133-405e-a5e3-2fedbc43aedb</guid><dc:creator>Kenneth</dc:creator><description>[quote user="Poorp"]Here is an updated capture with the patch applied. The bug was triggered in the same manner as above[/quote]
&lt;p&gt;&amp;nbsp;This log doesn&amp;#39;t show the re-connect though.&amp;nbsp;&lt;/p&gt;
[quote user="Poorp"]Could you instruct me in how to do that? I know I can use e.g BT_SMP_SC_PAIR_ONLY to disable &amp;#39;legacy just works&amp;#39;, but I can&amp;#39;t see any option to disable &amp;#39;le just works&amp;#39;&lt;br /&gt;thanks[/quote]
&lt;p&gt;Can you try to comment out&amp;nbsp;CONFIG_BT_TINYCRYPT_ECC and possible add&amp;nbsp;CONFIG_BT_ECC=n. I guess I should try this myself first.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315063?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 09:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbd02820-8037-4eb4-aabf-f4984c0ba35f</guid><dc:creator>Poorp</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315047#315047"]Please enable the patch before bonding, and use the patch. It may influence the issue in some way.[/quote]
&lt;p&gt;Here is an updated capture with the patch applied. The bug was triggered in the same manner as above&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-at-2021_2D00_06_2D00_14-11_2D00_33_2D00_08.png" /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/withPatchAplliedTriggered.pcapng"&gt;devzone.nordicsemi.com/.../withPatchAplliedTriggered.pcapng&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315047#315047"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you can disable LE secure connection (and instead use just works) for security it could be interesting to see if the issue also exists. &lt;/p&gt;[/quote]
&lt;p&gt;&lt;br /&gt;Could you instruct me in how to do that? I know I can use e.g BT_SMP_SC_PAIR_ONLY to disable &amp;#39;legacy just works&amp;#39;, but I can&amp;#39;t see any option to disable &amp;#39;le just works&amp;#39;&lt;br /&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315047?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 08:40:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ad1b316-3a46-4f12-9dc4-b364fcb06899</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Please enable the patch before bonding, and use the patch. It may influence the issue in some way.&lt;/p&gt;
&lt;p&gt;If you can disable LE secure connection (and instead use just works) for security it could be interesting to see if the issue also exists. With just works it would be possible to decrypt the link also.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315046?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 08:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:076bd559-947e-4226-85ad-99224f82e1fc</guid><dc:creator>Poorp</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315030#315030"]This means (or at least suggests) that if the nRF52 is the peripheral device, then this FW have not followed the:[/quote][quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/315030#315030"]Can you double check with your collegues what may be calling&amp;nbsp;bt_conn_set_security() here in the project, if not done by the bt_gatt_connected() in gatt.c?[/quote]
&lt;p&gt;&lt;br /&gt;That patch isn&amp;#39;t integrated into our build system yet, since we need to patch the OS.&lt;br /&gt;Because of that some builds have it, others don&amp;#39;t. &lt;br /&gt;&lt;br /&gt;I have previously tested this bug both with and without this patch, and the behavior was the same in both cases. Which is the reason it was (accidentally) left disabled when running the logs in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/315030?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 07:12:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58e68040-f254-4e54-97d0-b500b4e9a7b5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The reason we are not able to decrypt the connection is due to LE secure connection is used (with diffie-hellman), unfortunately such connection can&amp;#39;t be decrypted.&lt;/p&gt;
&lt;p&gt;However, I can find that the slave send a security request upon re-connection here, ref:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/0020.pastedimage1623654661911v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This means (or at least suggests) that if the nRF52 is the peripheral device, then this FW have not followed the:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;I have been working on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/74771/pairing-not-supported-when-reconnecting-to-multiple-devices-using-android-ble-library/309991#309991"&gt;this problem&lt;/a&gt;&amp;nbsp;in a different case, I want to find out if your issue is&amp;nbsp;related. To confirm please comment out the line&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_conn_set_security() that is found in&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_gatt_connected()&amp;nbsp;in gatt.c and repeat your setup.&amp;nbsp;Please do this test first.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you double check with your collegues what may be calling&amp;nbsp;bt_conn_set_security() here in the project, if not done by the bt_gatt_connected() in gatt.c?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/314793?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 17:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eced5bfd-d319-4c27-ac8a-4762a66e534a</guid><dc:creator>Poorp</dc:creator><description>&lt;p&gt;Here is a third log where encryption seemingly succeed, but the bug was still triggered. Unfortunately it seems that the sniffer failed to capture the encryption keys. And despite several more runs the sniffer failed each time&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve also added a fourth log, it is an bt snoop log from android from a run where the bug was triggered. If I&amp;#39;m reading it correctly, then encryption succeed in that case.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please let me know if there is anything else you need in order to be able to help us solve this bug.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/firstTriggeredButEncrypted.pcapng"&gt;devzone.nordicsemi.com/.../firstTriggeredButEncrypted.pcapng&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/fourth_5F00_btsnoop_5F00_hci.log"&gt;devzone.nordicsemi.com/.../fourth_5F00_btsnoop_5F00_hci.log&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/314783?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 16:40:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9518faf-82e1-4252-880a-88305b47c93d</guid><dc:creator>Poorp</dc:creator><description>&lt;p&gt;Yeah, I noticed after posting. &lt;br /&gt;Here are the correct files: &lt;br /&gt;The file named triggered is when the bug happened, notTriggered is the same procedure (except maybe not with step 5 above) but the bug did not happen, peripheral remained after reboot of the phone&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Edit: looking at the logs it seems the setup of encryption fails for some reason, it is worth noting that I did not see a disconnect on the peripheral side before pulling power. &lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/NOTtriggered.pcapng"&gt;devzone.nordicsemi.com/.../NOTtriggered.pcapng&lt;/a&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/triggered.pcapng"&gt;devzone.nordicsemi.com/.../triggered.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/314782?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 16:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89e5a2eb-24c0-4a98-88dd-2ea4346cbea7</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I could only find one log file here?&lt;/p&gt;
&lt;p&gt;Unfortunately you likely forgot to select the device you wanted to sniff from the device list:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/action_advertisement.html"&gt;https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/action_advertisement.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please do that.&lt;/p&gt;
&lt;p&gt;Tip: In the filter text box you can add the following: &amp;quot;btle.data_header.llid &amp;gt; 0 &amp;amp;&amp;amp; btle.length &amp;gt; 0&amp;quot; Then you should see in specific when connected when there is data between the central and peripheral, if you can&amp;#39;t see anything with this filter, then it means you have not been able to pick up the communication.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/314779?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 16:18:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4885ac0f-5f4b-43e4-bd84-b21bc8daecb8</guid><dc:creator>Poorp</dc:creator><description>&lt;p&gt;&lt;br /&gt;Here is the log. The perephrials address is ce:d1:0e:8b:17:66 &lt;br /&gt;&lt;br /&gt;The exact steps performed were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Peripheral was erased using nrfjprog --ereaseall&lt;/li&gt;
&lt;li&gt;Peripheral was flashed with firmware and power cycled&lt;/li&gt;
&lt;li&gt;Made sure the peripheral was not listed under &amp;quot;previously connected devices&amp;quot; in android&lt;/li&gt;
&lt;li&gt;Rebooted the phone&lt;/li&gt;
&lt;li&gt;After the phone is rebooted turn OFF and then turn ON Bluetooth on the phone (may not be required, but it appears the bug happens more reliably with this step)&lt;/li&gt;
&lt;li&gt;Installed the android application from scratch and made sure its data was erased&lt;/li&gt;
&lt;li&gt;On-boarded the peripheral - it was on-boarded successfully&lt;/li&gt;
&lt;li&gt;Turned OFF the peripheral, it was disconnected from the phone&lt;/li&gt;
&lt;li&gt;Rebooted the phone while the peripheral was still turned OFF&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Expected Result: peripheral should still be bonded&lt;br /&gt;&lt;br /&gt;Actual Result: peripheral was not bonded&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/313893#313893"]1. Does the problem also occur if you disconnect and reconnect the peripheral before step 6?[/quote]
&lt;p&gt;When turning off/on the Bluetooth on the phone between steps 7 and 8 above:&lt;br /&gt;Sometimes the peripheral disappears immediately, that is without a reboot&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bugtriggnorpa.pcapng"&gt;devzone.nordicsemi.com/.../bugtriggnorpa.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sometimes the peripheral remains, and in those cases it remained after steps 8 and 9 were performed (peripheral turned off/ phone rebooted)&lt;br /&gt;&lt;br /&gt;When the phone is rebooted without turning off/on bluetooth between steps 7 and 8, it seems the peripheral always disappears.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/313966?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 14:09:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e09e2f96-807b-4443-97c0-2a7be8c5be49</guid><dc:creator>Cornel Gligan</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/313893#313893"]Does the problem also occur if you disconnect and reconnect the peripheral before step 6?[/quote]
&lt;p&gt;Before rebooting the phone, the connection is stable. The app reconnects every time with no problems.&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/313893#313893"]I have been working on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/74771/pairing-not-supported-when-reconnecting-to-multiple-devices-using-android-ble-library/309991#309991"&gt;this problem&lt;/a&gt;&amp;nbsp;in a different case, I want to find out if your issue is&amp;nbsp;related.[/quote]
&lt;p&gt;That post is for one of our issues. One of my colleagues from the FW team posted it and my colleague said that the fix Nordic suggested is already integrated in the FW code. This issue doesn&amp;#39;t trigger any error while connecting or while bonding as the issue in the link. So it is not the same issue.&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/313893#313893"]&lt;span&gt;To confirm please comment out the line&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_conn_set_security() that is found in&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_gatt_connected()&amp;nbsp;in gatt.c and repeat your setup. &lt;span style="text-decoration:underline;"&gt;Please do this test first.&lt;/span&gt;&lt;/span&gt;[/quote]
&lt;p&gt;My FW colleague told me this code is also already in.&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/76024/the-nrf52-bonded-device-is-automatically-unbonded-when-the-android-phone-is-rebooted/313893#313893"] think we&amp;nbsp;might need an on air sniffer log here to find the problem. Maybe you can do that with nRF sniffer tool if you have an nRF52-DK you can use for sniffer. [/quote]
&lt;p&gt;I will ask my FW colleagues to take the sniffer log and attach it to this ticket.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/313893?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 11:14:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a9767e9-707b-4111-9c2e-d766cf08d6b7</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think we&amp;nbsp;might need an on air sniffer log here to find the problem. Maybe you can do that with nRF sniffer tool if you have an nRF52-DK you can use for sniffer. Some other questions while waiting for your sniffer log&lt;/p&gt;
&lt;p&gt;1. Does the problem also occur if you disconnect and reconnect the peripheral before step 6?&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;&lt;span&gt;I have been working on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/74771/pairing-not-supported-when-reconnecting-to-multiple-devices-using-android-ble-library/309991#309991"&gt;this problem&lt;/a&gt;&amp;nbsp;in a different case, I want to find out if your issue is&amp;nbsp;related. To confirm please comment out the line&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_conn_set_security() that is found in&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_gatt_connected()&amp;nbsp;in gatt.c and repeat your setup. &lt;span style="text-decoration:underline;"&gt;Please do this test first.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Edit: Do make sure you re-bond after doing the change in step 2.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/313814?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 07:01:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0d25fbd-c038-4c20-8465-d142077d8648</guid><dc:creator>Cornel Gligan</dc:creator><description>&lt;p&gt;My colleague from FW side managed to narrow down the change which is reproducing the issue:&lt;/p&gt;
&lt;p&gt;from&lt;/p&gt;
&lt;p&gt;static struct bt_conn_auth_cb conn_auth_callbacks = {&lt;br /&gt; .passkey_display = &lt;span style="color:#ff00ff;"&gt;&lt;strong&gt;auth_passkey_display&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt; .passkey_entry = NULL,&lt;br /&gt; .passkey_confirm = &lt;span style="color:#ff00ff;"&gt;&lt;strong&gt;passkey_confirm&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt; .cancel = auth_cancel,&lt;br /&gt; .pairing_confirm = pairing_confirm,&lt;br /&gt; .pairing_complete = pairing_complete,&lt;br /&gt; .pairing_failed = pairing_failed,&lt;br /&gt; .bond_deleted = bond_deleted&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;into&lt;/p&gt;
&lt;p&gt;static struct bt_conn_auth_cb conn_auth_callbacks = {&lt;br /&gt; .passkey_display = &lt;span style="color:#008000;"&gt;&lt;strong&gt;NULL&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt; .passkey_entry = NULL,&lt;br /&gt; .passkey_confirm = &lt;span style="color:#008000;"&gt;&lt;strong&gt;NULL&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt; .cancel = auth_cancel,&lt;br /&gt; .pairing_confirm = pairing_confirm,&lt;br /&gt; .pairing_complete = pairing_complete,&lt;br /&gt; .pairing_failed = pairing_failed,&lt;br /&gt; .bond_deleted = bond_deleted&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;I also noticed on the Android app side: after connecting and just before sending any request to the device, if the app code runs a&amp;nbsp;&lt;strong&gt;remote device discovery&lt;/strong&gt; (using the function bluetoothAdapter.startDiscovery()) until the nRF52 board is discovered, then the problem is not reproducing anymore.&lt;/p&gt;
&lt;p&gt;Is the discovery required for the bond to be strong and not removed after phone reboots? Is the application missing something else?&lt;/p&gt;
&lt;p&gt;Is the FW implementation missing anything triggering the need of running a discovery to make the bond stronger?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The nRF52 bonded device is automatically unbonded when the Android phone is rebooted.</title><link>https://devzone.nordicsemi.com/thread/313729?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 15:31:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23152afc-ff87-4c4c-8321-6369bc45807e</guid><dc:creator>Cornel Gligan</dc:creator><description>&lt;p&gt;I forgot to mention that the bond removal issue was tested and reproduced on the following phones:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Google Pixel 2 &amp;amp; Pixel 4 running Android 11&lt;/li&gt;
&lt;li&gt;Oneplus 5 running Android 10&lt;/li&gt;
&lt;li&gt;Doro 8080 running Android 9&lt;/li&gt;
&lt;li&gt;Google Nexus 5X running Android 8.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Minimum Android supported version in the Android app is set to Android 8 (SDK 26).&lt;/p&gt;
&lt;p&gt;I am using version 2.2.4 version of the Android-BLE-Library from Nordic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>