<?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>[nRF52833] Bonding again with already bonded Central fails</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94847/nrf52833-bonding-again-with-already-bonded-central-fails</link><description>Hi, 
 I&amp;#39;m working on a legacy program (Peripheral) using nRF52833 and nRF5 SDK using SoftDevice S113. 
 I&amp;#39;m using the Peer Manager module to manage bonded hosts/data. It seems the Peripheral is failing to bond (the second time, via JustWorks pairing)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Dec 2022 07:42:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94847/nrf52833-bonding-again-with-already-bonded-central-fails" /><item><title>RE: [nRF52833] Bonding again with already bonded Central fails</title><link>https://devzone.nordicsemi.com/thread/400985?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2022 07:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64bab139-fc9a-4bc4-866d-0e3911e944e6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Marco, Good catch! I am happy to hear you found the problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Calling&amp;nbsp;&lt;span&gt;ble_conn_state_init() after Peer manager init can lead to various hard to debug issues as it will clear the flags set by the peer manager during initialization. I have suggested to the SDK team that we&amp;nbsp;have to find a way to make this clearer to users. For instance, by adding a note in the API documentation.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52833] Bonding again with already bonded Central fails</title><link>https://devzone.nordicsemi.com/thread/400961?ContentTypeID=1</link><pubDate>Thu, 15 Dec 2022 22:58:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f6c2b92-a857-4b03-af36-c9dc5d0aef52</guid><dc:creator>Marco R</dc:creator><description>&lt;p&gt;Hi Vidar, thank you very much for providing the example and especially for pointing me to the security_dispatcher.c relevant code.&lt;/p&gt;
&lt;p&gt;I found the bug in my code. My call to&amp;nbsp;pm_conn_sec_config_reply() was getting ignored by the security_dispatcher due to user_flag_is_acquired(m_flag_allow_repairing) failing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason it was failing is because when I copy-pasted code between two example apps, I inherited the call to&amp;nbsp;ble_conn_state_init() (which some examples call in&amp;nbsp;services_init() ) which internally memsets to zero the global user flags&amp;nbsp;m_bcs.acquired_flags -- which are checked by&amp;nbsp;user_flag_is_acquired(m_flag_allow_repairing).&lt;/p&gt;
&lt;p&gt;Removing that call fixed my issue.&lt;/p&gt;
&lt;p&gt;Thanks for the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52833] Bonding again with already bonded Central fails</title><link>https://devzone.nordicsemi.com/thread/400957?ContentTypeID=1</link><pubDate>Thu, 15 Dec 2022 21:16:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63440a4e-8c47-4bd3-88bc-3cd3f4529d15</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Marco, we have not been able to reproduce this here, unfortunately. I used the ble_app_hrs example from SDK 17.1.0 and created a new configuration for the nRF52833 DK (pca10100) with s113 and then tested it with an iPhone 12.&lt;/p&gt;
&lt;p&gt;Here is the debug log&amp;nbsp;I got when I had the phone bond again with the nRF:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1671138589978v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And the project I used:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6305.ble_5F00_app_5F00_hrs.zip"&gt;devzone.nordicsemi.com/.../6305.ble_5F00_app_5F00_hrs.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Maybe you can try to place a breakpoint at the two lines I have highlighted below to confirm where the security status ends up being set to&amp;nbsp;BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP (133).&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1671138890815v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52833] Bonding again with already bonded Central fails</title><link>https://devzone.nordicsemi.com/thread/400709?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2022 18:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce1a94ad-9747-4861-8524-2e61804ebea3</guid><dc:creator>Marco R</dc:creator><description>&lt;p&gt;Hi Sigurd, thanks for the reply. I&amp;#39;m using&amp;nbsp;nRF5_SDK_17.1.0_ddde560. It reproduces with both iOS (iPhone13) and Android (Pixel 7)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52833] Bonding again with already bonded Central fails</title><link>https://devzone.nordicsemi.com/thread/400700?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2022 16:50:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e748956-4608-4b31-b770-e3739843d14b</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would also have assumed that&amp;nbsp;passing&amp;nbsp;&lt;span&gt;allow_repairing=true was enough. I can try to reproduce&amp;nbsp;the behavior&amp;nbsp;here. What SDK version are you using? What kind of device did you use as central?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>