<?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>Ble Bonding - error of unknown cause</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77969/ble-bonding---error-of-unknown-cause</link><description>Hi, Dev Zone. 
 thanks for help : ) 
 
 I&amp;#39;m try to porting DK Board&amp;#39;s Ble Bonding function to Target Board. 
 1st_question &amp;lt;- this is my first question links 
 main problem is freezing and reason is mutex error, that use cc310 mutex lock function, 
 so</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Aug 2021 02:13:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77969/ble-bonding---error-of-unknown-cause" /><item><title>RE: Ble Bonding - error of unknown cause</title><link>https://devzone.nordicsemi.com/thread/324566?ContentTypeID=1</link><pubDate>Thu, 12 Aug 2021 02:13:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5826ae0d-e8c9-4d91-b047-06a765e1d500</guid><dc:creator>Empe</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks for reply and sorry for late update.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/77969/ble-bonding---error-of-unknown-cause/322827#322827"]Have you tried to debug the app to see if the program maybe gets stuck in one of your threads?[/quote]
&lt;p&gt;now, i&amp;#39;m solve stuck problem, i don&amp;#39;t now true reason but maybe thread&amp;#39;s size problem&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;links &amp;lt;- this is my new post&lt;/p&gt;
&lt;p&gt;try to insert debug code and looks like find some error point&lt;/p&gt;
&lt;p&gt;when your not busy, please check it once&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;thanks for help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ble Bonding - error of unknown cause</title><link>https://devzone.nordicsemi.com/thread/322827?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 10:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad25e95c-bb4d-466a-a9e9-1da2708fb89a</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="Empe"]situation are same both get BLE event fleg : 0x19 &amp;quot;Authentication procedure completed with status&amp;quot;[/quote]
&lt;p&gt;&amp;nbsp;What&amp;#39;s the status code? PM_EVT_CONN_SEC_SUCCEEDED indicate that the bonding procedure completed succesfully, so maybe it&amp;#39;s something else that causes your program to hang. Have you tried to debug the app to see if the program maybe gets stuck in one of your threads? &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ble Bonding - error of unknown cause</title><link>https://devzone.nordicsemi.com/thread/322349?ContentTypeID=1</link><pubDate>Thu, 29 Jul 2021 06:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c939e30-1211-4082-b676-5287a8de7f93</guid><dc:creator>Empe</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks for answer&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/77969/ble-bonding---error-of-unknown-cause/322260#322260"]if you disable LESC support (i.e. set SEC_PARAM_LESC = 0)?[/quote]
&lt;p&gt;yes, i try Enable and disable both result are same&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;here is full log (i was turn on Error, Warning, Info, Debug Message ) - using LESC 0&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Generating ECC key pair
Erase bonds!
Event PM_EVT_PEERS_DELETE_SUCCEEDED
All peers deleted.

BLE event: 0x10.
Requesting to update ATT MTU to 247 bytes on connection 0x0.
Updating data length to 251 on connection 0x0.
Connected

BLE event: 0x1c.
BLE event: 0x3a.
ATT MTU updated to 247 bytes on connection 0x0 (response).
Data len is set to 0xF4(244)
ATT MTU exchange completed. central 0xf7 peripheral 0xf7
BLE event: 0x24.
Data length updated to 123 on connection 0x0.
max_rx_octets: 123
max_tx_octets: 123
max_rx_time: 1096
max_tx_time: 1096
ATT MTU exchange completed. central 0xf7 peripheral 0xf7
BLE event: 0x12.
BLE event: 0x23.
Peer on connection 0x0 requested a data length of 123 bytes.
Updating data length to 123 on connection 0x0.
BLE event: 0x24.
Data length updated to 123 on connection 0x0.
max_rx_octets: 123
max_tx_octets: 123
max_rx_time: 1096
max_tx_time: 1096
ATT MTU exchange completed. central 0xf7 peripheral 0xf7
BLE event: 0x12.
BLE event: 0x13.
Event PM_EVT_CONN_SEC_START
Connection security procedure started: role: Peripheral, conn_handle: 0, procedure: Bonding
Event PM_EVT_CONN_SEC_PARAMS_REQ
Security parameter request
BLE event: 0x12.
BLE event: 0x1a.
BLE event: 0x19.
Event PM_EVT_CONN_SEC_SUCCEEDED&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;here is full log ( also turn on Error, Warning, Info, Debug Message ) - using LESC 1&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Generating ECC key pair
Erase bonds!
Event PM_EVT_PEERS_DELETE_SUCCEEDED
All peers deleted.
BLE event: 0x10.
Requesting to update ATT MTU to 247 bytes on connection 0x0.
Updating data length to 251 on connection 0x0.
Connected

BLE event: 0x1c.
BLE event: 0x3a.
ATT MTU updated to 247 bytes on connection 0x0 (response).
Data len is set to 0xF4(244)
ATT MTU exchange completed. central 0xf7 peripheral 0xf7
BLE event: 0x24.
Data length updated to 123 on connection 0x0.
max_rx_octets: 123
max_tx_octets: 123
max_rx_time: 1096
max_tx_time: 1096
ATT MTU exchange completed. central 0xf7 peripheral 0xf7
BLE event: 0x12.
BLE event: 0x23.
Peer on connection 0x0 requested a data length of 123 bytes.
Updating data length to 123 on connection 0x0.
BLE event: 0x24.
Data length updated to 123 on connection 0x0.
max_rx_octets: 123
max_tx_octets: 123
max_rx_time: 1096
max_tx_time: 1096
ATT MTU exchange completed. central 0xf7 peripheral 0xf7
BLE event: 0x12.
BLE event: 0x13.
Event PM_EVT_CONN_SEC_START
Connection security procedure started: role: Peripheral, conn_handle: 0, procedure: Bonding
Event PM_EVT_CONN_SEC_PARAMS_REQ
Security parameter request
BLE event: 0x18.
BLE_GAP_EVT_LESC_DHKEY_REQUEST
BLE_GAP_EVT_LESC_DHKEY_REQUEST
Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0
BLE event: 0x12.
BLE event: 0x12.
BLE event: 0x1a.
BLE event: 0x19.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;situation are same both get BLE event fleg : 0x19 &amp;quot;Authentication procedure completed with status&amp;quot;&lt;/p&gt;
&lt;p&gt;and send PM_EVT_CONN_SEC_SUCCEEDED and stuck in somewhere&lt;/p&gt;
&lt;p&gt;after that log, device go to reset mode via watch-dog&lt;/p&gt;
&lt;p&gt;( when i block watch-dog, stuck in somewhere and no-respons)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/77969/ble-bonding---error-of-unknown-cause/322260#322260"]nrf_ble_lesc_request_handler() function[/quote]
&lt;p&gt;this function is run on another thread,&lt;/p&gt;
&lt;p&gt;it means using freeRTOS, useing several thread, initialize in main thread and lesc handler is working on ble thread&lt;/p&gt;
&lt;p&gt;ble thread&amp;#39;s job is only work update app&amp;#39;s time and call lesc handler&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;++&amp;nbsp;test&amp;nbsp;that run (initialize and lesc handler) as same thread, it&amp;#39;s situation result is same&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Best Regards, Empe&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ble Bonding - error of unknown cause</title><link>https://devzone.nordicsemi.com/thread/322260?ContentTypeID=1</link><pubDate>Wed, 28 Jul 2021 13:32:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c86d1de5-c4ed-4818-a66d-884e3708527d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Have you tried to see if bonding works ok if you disable LESC support (i.e. set SEC_PARAM_LESC = 0)? Also, are you calling the nrf_ble_lesc_request_handler() function periodically like in the ble_app_hrs example?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit: &lt;/strong&gt;Forgot that we do have an example with Freertos+LESC in our nRF5 Thread &amp;amp; Zigbee SDK. Maybe that example could serve as a reference: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/74337/use-the-le-secure-connections-in-the-ble_thread_dyn_mtd_coap_cli-example"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/74337/use-the-le-secure-connections-in-the-ble_thread_dyn_mtd_coap_cli-example&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>