<?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>Random Bonding problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118678/random-bonding-problem</link><description>We experience that under some conditions at one moment an already bonded device causes that at the moment of BLE connection the MCU crashes. Possible solution is only to erase all bonding&amp;#39;s which is not acceptable at the current stage in the field. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Feb 2025 11:24:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118678/random-bonding-problem" /><item><title>RE: Random Bonding problem</title><link>https://devzone.nordicsemi.com/thread/523026?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2025 11:24:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed15a2ce-6518-451e-8ca7-fbf4bcc3a88a</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="DaniSi"]Ok, I&amp;#39;ve reverted back. We will probably need some more time to again verify if the problem still persist.[/quote]
&lt;p&gt;Sounds good thanks. You will not get the exact same error at least.&lt;/p&gt;
[quote user="DaniSi"]&lt;p&gt;The assert happens at the same spot as I wrote in the first topic. In the modified code this was line 300&lt;/p&gt;
&lt;p&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;sd_ble_gatts_sys_attr_get&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;conn_handle&lt;/span&gt;&lt;span&gt;, sys_attr_data, &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;peer_data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;p_local_gatt_db&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;flags&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ASSERT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;NRF_SUCCESS&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;I see.&amp;nbsp;I realize now that it is from the code I posted and that it does not exist in the original SDK 17.1.0&amp;nbsp;code which I was looking at.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Bonding problem</title><link>https://devzone.nordicsemi.com/thread/522998?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2025 09:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e73e80b-10c8-4a7b-a673-3b4fdadc38f4</guid><dc:creator>DaniSi</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/118678/random-bonding-problem/522995"]I recommend reverting your changes to the peer manager if it&amp;#39;s not too late and use the official fix which was tested as a part of the SDK release.[/quote]
&lt;p&gt;Ok, I&amp;#39;ve reverted back. We will probably need some more time to again verify if the problem still persist.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/118678/random-bonding-problem/522995"]This indicates that the attribute table has changed. Was there anything that happened prior to this (e.g., a device firmware update)?&amp;nbsp;[/quote]
&lt;p&gt;The last scenario occurred during development. We have different branches so maybe&amp;nbsp;attribute table has changed, but I cant confirm. But we got already a report that suddenly crashes started occurring with no changes in attribute table.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/118678/random-bonding-problem/522995"]What is the ASSERT you have at this line? This is also different from the error you reported initially.&amp;nbsp;[/quote]
&lt;p&gt;The assert happens at the same spot as I wrote in the first topic. In the modified code this was line 300&lt;/p&gt;
&lt;p&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;sd_ble_gatts_sys_attr_get&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;conn_handle&lt;/span&gt;&lt;span&gt;, sys_attr_data, &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;peer_data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;p_local_gatt_db&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;flags&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ASSERT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;NRF_SUCCESS&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Bonding problem</title><link>https://devzone.nordicsemi.com/thread/522995?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2025 09:17:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa2aacae-4c1c-4bab-a245-0ab4034dea50</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The issue discussed in the linked Q&amp;amp;A was already fixed in nRF5 SDK 17.1.0:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;*** Bug fixes&lt;/em&gt;&lt;br /&gt;&lt;em&gt;****************&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;NRFFOETT-2519: The local db data will not be written to flash if it is already up to date.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; This means that if a client updates a CCCD to the same value as before,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; no flash operation will happen.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I recommend reverting your changes to the peer manager if it&amp;#39;s not too late and use the official fix which was tested as a part of the SDK release.&lt;/p&gt;
[quote user="DaniSi"][1;33m&amp;lt;warning&amp;gt; peer_manager_gcm: The local database has changed, so some subscriptions to notifications and indications could not be restored for conn_handle 0[0m&lt;br /&gt;[1;33m&amp;lt;warning&amp;gt; peer_manager_handler: Local DB could not be applied: conn_handle: 0, peer_id: 0[0m[/quote]
&lt;p&gt;This indicates that the attribute table has changed. Was there anything that happened prior to this (e.g., a device firmware update)?&amp;nbsp;&lt;/p&gt;
[quote user="DaniSi"][1;31m&amp;lt;error&amp;gt; app: ASSERTION FAILED at /home/dani/projects/tq/hpr-disp-04-05-fw/nRF5-SDK/components/ble/peer_manager/gatt_cache_manager.c:300[/quote]
&lt;p&gt;What is the ASSERT you have at this line? This is also different from the error you reported initially.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Bonding problem</title><link>https://devzone.nordicsemi.com/thread/522599?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 09:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b9414a8-b05e-4d7d-a73e-2cb265029178</guid><dc:creator>DaniSi</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;It took us a while to reproduce it again, and once more I can confirm the error code=12. Bellow are the logs:&lt;br /&gt;[0m&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change[0m&lt;br /&gt;[1;33m&amp;lt;warning&amp;gt; peer_manager_gcm: The local database has changed, so some subscriptions to notifications and indications could not be restored for conn_handle 0[0m&lt;br /&gt;[1;33m&amp;lt;warning&amp;gt; peer_manager_handler: Local DB could not be applied: conn_handle: 0, peer_id: 0[0m&lt;br /&gt;[0m&amp;lt;info&amp;gt; peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption[0m&lt;br /&gt;[0m&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change[0m&lt;br /&gt;[1;31m&amp;lt;error&amp;gt; app: ASSERTION FAILED at /home/dani/projects/tq/hpr-disp-04-05-fw/nRF5-SDK/components/ble/peer_manager/gatt_cache_manager.c:300&lt;/p&gt;
&lt;p&gt;I forgot to mention that we have included the fix&lt;br /&gt;&lt;a title="RE: Peer manager and FDS, new records at each connection. " href="https://devzone.nordicsemi.com/f/nordic-q-a/64609/peer-manager-and-fds-new-records-at-each-connection/263786"&gt;RE: Peer manager and FDS, new records at each connection. &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;which as I see now was implemented by you.&lt;/p&gt;
&lt;p&gt;Additionally, I noticed that this is caused by the 0x2902 Service changed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Bonding problem</title><link>https://devzone.nordicsemi.com/thread/521856?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 06:44:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b8200e8-3b2b-4726-91cb-3eabcf1c5f69</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It is not clear how the program is crashing even if&amp;nbsp;&lt;span&gt;sd_ble_gatts_sys_attr_get()&amp;nbsp;is returning with NRF_ERROR_DATA_SIZE.&amp;nbsp;Are you able to get debug logs from the device? And does the program enter the&amp;nbsp;app_error_fault_handler()?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>