<?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>Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77266/adding-peer-manager-to-ble_app_uart</link><description>Hi, 
 I&amp;#39;m developing with 52840 DK, trying to add peer manager to another project I&amp;#39;ve modified from ble_app_uart (basically I&amp;#39;ve added saadc, SPI, USB and I2C module based on original example. Also this project was migrated from 52832 DK to 52840 DK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Jul 2021 07:46:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77266/adding-peer-manager-to-ble_app_uart" /><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319942?ContentTypeID=1</link><pubDate>Wed, 14 Jul 2021 07:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5e16c28-f115-40f4-9038-028b2744c17f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="Avadacadabara"]I&amp;#39;m not quite sure if central app requires bonding to access it cuz previously it&amp;#39;s possible to connect it directly w/o bonding...[/quote]
&lt;p&gt;You are correct that the NUS service does not require bonding to access it by default, yes. I was under the impression that you would have liked to change this, but I might have misunderstood your intentions.&lt;/p&gt;
[quote user="Avadacadabara"]perhaps because I allowed &amp;quot;repairing&amp;quot; function in pm_evt_handler like below?[/quote]
&lt;p&gt;You can test this by disabling this again, to see if the behavior changes.&lt;/p&gt;
[quote user="Avadacadabara"]I might have some unnoticed modification somewhere else...[/quote]
&lt;p&gt;That does indeed make it harder to pintpoint exactly what led to the change - I thought you did not make any changes to the code when the behavior changed.&lt;br /&gt;&lt;br /&gt;If you would like to find out the root cause, please iteratively revert changes you have made and test the application again each time, to find out exactly what changed the behavior.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319922?ContentTypeID=1</link><pubDate>Wed, 14 Jul 2021 04:15:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0744e07d-45e9-4553-bd7e-1a4e99bdb8c0</guid><dc:creator>Avadacadabara</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using nordic uart service only. I&amp;#39;m not quite sure if central app requires bonding to access it cuz previously it&amp;#39;s possible to connect it directly w/o bonding...&lt;/p&gt;
&lt;p&gt;Now the bonding option pop up everytime when I hit &amp;quot;connect&amp;quot;(which is exactally what we were expecting), perhaps because I allowed &amp;quot;repairing&amp;quot; function in pm_evt_handler like below?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;		case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t cfg;
            cfg.allow_repairing = true;
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;cfg);
        } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or I might have some unnoticed modification somewhere else...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319758?ContentTypeID=1</link><pubDate>Tue, 13 Jul 2021 10:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f1ec4d8-e58f-4eae-82e8-a6f77fcd3313</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="Avadacadabara"]Thanks for reply.[/quote][quote user="Avadacadabara"]Thanks Karl and Einer.[/quote]
&lt;p&gt;No problem at all, we are happy to help!&lt;/p&gt;
[quote user="Avadacadabara"]After several attempts, this issue fixed somehow...But I didn&amp;#39;t change any part of the code.[/quote][quote user="Avadacadabara"]I think I&amp;#39;ll just let it be. But your advice is appreciated![/quote]
&lt;p&gt;I am glad to hear that it works as intended now, but it is strange that you the behavior changed without you making any changes to the code yourself.&lt;br /&gt;Could it be that your central tries to access a service that require bonding?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319730?ContentTypeID=1</link><pubDate>Tue, 13 Jul 2021 09:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb0d5ae0-7441-4e3b-aa52-0fdeb02664d3</guid><dc:creator>Avadacadabara</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;I was saying that peering option didn&amp;#39;t show up after ble connected and I have to hit &amp;quot;bond&amp;quot; option to call it out.&lt;/p&gt;
&lt;p&gt;After several attempts, this issue fixed somehow...But I didn&amp;#39;t change any part of the code.&lt;/p&gt;
&lt;p&gt;I think I&amp;#39;ll just let it be. But your advice is appreciated!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks Karl and Einer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319668?ContentTypeID=1</link><pubDate>Mon, 12 Jul 2021 17:05:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f404552d-9506-47ae-a4c0-1aee9fad772e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Avadacadabara,&lt;br /&gt;&lt;br /&gt;Einar is currently out of office, so I will be handling this case from now on.&lt;/p&gt;
[quote user="Avadacadabara"]I modified ble_evt_handler based on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35433/configuring-peer-manager-for-bonding"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/35433/configuring-peer-manager-for-bonding&lt;/a&gt;&amp;nbsp;and it works.[/quote]
&lt;p&gt;I am happy to hear&amp;nbsp;that bonding works now!&lt;/p&gt;
[quote user="Avadacadabara"]However bonding window does not pop up automatically, I have to press bond manually.[/quote]
&lt;p&gt;I am not sure that I understand what you mean when you say this - do you mean the bonding option in the nRF Connect application for smartphones? Is this option not showing up when you enter into the connection, or is the issue that you have to manually press the bond option that appears?&lt;br /&gt;In case of the latter, this is likely due to the security requirements of the service provided. If you take a look at the services_init function of the ble_app_hrs you could see where this may be configured. If the central tries to interact with a service that it does not have the required security for, the peripheral will send &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s112.api.v7.2.0/group___b_l_e___g_a_p___p_e_r_i_p_h___s_e_c___r_e_q___m_s_c.html"&gt;a security request&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319528?ContentTypeID=1</link><pubDate>Mon, 12 Jul 2021 08:00:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ce0a577-0c62-48d8-a1a6-35ebb101e047</guid><dc:creator>Avadacadabara</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here are&amp;nbsp;some updates.&lt;/p&gt;
&lt;p&gt;I modified ble_evt_handler based on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35433/configuring-peer-manager-for-bonding"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/35433/configuring-peer-manager-for-bonding&lt;/a&gt;&amp;nbsp;and it works.&lt;/p&gt;
&lt;p&gt;However bonding window does not pop up automatically, I have to press bond manually.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319509?ContentTypeID=1</link><pubDate>Mon, 12 Jul 2021 05:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7735817a-7949-4251-ac51-957f121763ba</guid><dc:creator>Avadacadabara</dc:creator><description>&lt;p&gt;Hi Einar!&lt;/p&gt;
&lt;p&gt;Thanks for your reply!&lt;/p&gt;
&lt;p&gt;I tried to add bonding to ble_app_uart based project again. This time it still won&amp;#39;t work but act differently...&lt;/p&gt;
&lt;p&gt;When I runned ble_app_bms example，bonding window popped up automatically when ble was connected, and RTT log shows as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[11:29:24.387]收←◆&amp;lt;info&amp;gt; app_timer: RTC: initialized.
&amp;lt;info&amp;gt; app: Bond Management example started.
&amp;lt;info&amp;gt; app: Erase bonds!
&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_PEER_DELETE_SUCCEEDED
&amp;lt;error&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 0
&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_PEERS_DELETE_SUCCEEDED
&amp;lt;info&amp;gt; peer_manager_handler: All peers deleted.
&amp;lt;info&amp;gt; app: Fast adverstising.

[11:29:29.266]收←◆&amp;lt;debug&amp;gt; peer_manager_handler: Connected, securing connection. conn_handle: 0
&amp;lt;info&amp;gt; app: Connected

[11:29:29.390]收←◆&amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.

[11:29:29.439]收←◆&amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 27 on connection 0x0.
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
&amp;lt;debug&amp;gt; nrf
[11:29:29.509]收←◆_ble_gatt: max_tx_time: 2120

[11:29:33.229]收←◆&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ
&amp;lt;debug&amp;gt; peer_manager_handler: Security parameter request

[11:29:34.475]收←◆&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_CONN_SEC_START
&amp;lt;debug&amp;gt; peer_manager_handler: Connection security procedure started: role: Peripheral, conn_handle: 0, procedure: Bonding
&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ
&amp;lt;debug&amp;gt; peer_manager_handler: Security parameter request

[11:29:36.173]收←◆&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_CONN_SEC_SUCCEEDED
&amp;lt;info&amp;gt; peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Bonding data, action: Update
&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update

[11:29:36.418]收←◆&amp;lt;debug&amp;gt; peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Central address resolution, action: Update&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But my project was not showing bonding window after connection, so I have to hit &amp;quot;bond&amp;quot; manually on nrf_connect app.&lt;/p&gt;
&lt;p&gt;Then there will be an fatal error and assert. Also it seems like system reset when I tried to erase bonding data.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;info&amp;gt; app_timer: RTC: initialized.
00&amp;gt; 
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; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 251 on connection 0x0.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Connected
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Data len is set to 0xF4(244)
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x0.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 251
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7
00&amp;gt; 
00&amp;gt; &amp;lt;error&amp;gt; app: Fatal error&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t 100% sure which part is different from my last post(which cause the different log output) but I think I set the peer manager parameters as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SEC_PARAM_BOND                  1                                       //!&amp;lt; Perform bonding.
#define SEC_PARAM_MITM                  0                                       //!&amp;lt; Man In The Middle protection not required.
#define SEC_PARAM_LESC                  0                                       //!&amp;lt; LE Secure Connections not enabled.
#define SEC_PARAM_KEYPRESS              0                                       //!&amp;lt; Keypress notifications not enabled.
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_NONE                    //!&amp;lt; No I/O capabilities.
#define SEC_PARAM_OOB                   0                                       //!&amp;lt; Out Of Band data not available.
#define SEC_PARAM_MIN_KEY_SIZE          7                                       //!&amp;lt; Minimum encryption key size.
#define SEC_PARAM_MAX_KEY_SIZE          16&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Since this is how ble_app_bms works and all I need is the basic bonding function.&lt;/p&gt;
&lt;p&gt;Previously I tried to set LESC to 1 as another bonding example shows, then tons of source files(including crypto) and libraries need to be added. So I turned to ble_app_bms since it bit more simple.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding peer manager to ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/319394?ContentTypeID=1</link><pubDate>Fri, 09 Jul 2021 13:29:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96013e64-5f8c-4882-be7c-ab28195fbd5d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please provide the debug log in text (using Insert -&amp;gt; Code). It would be interesting to see the full log, particularly the whole line starting with &amp;quot;Could not perform security procedure&amp;quot;.&lt;/p&gt;
&lt;p&gt;Without knowing more I cannot say much, but this could for instance be because you have not included the required crypto libraries as in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43400/peer_manager_sm-could-not-perform-security-procedure-smd_params_reply-or-smd_link_secure-returned-nrf_error_invalid_addr"&gt;this thread&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>