<?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>Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19019/pairing-bonding-with-ble_app_template-example-not-working-for-me</link><description>Hi, 
 I just recently got into designing Bluetooth devices and I am experimenting with NRF51822 and BLE400 board. I managed to compile and upload the examples from SDK 11.0.0 to the device with SEGGER Embedded Studio and I can advertise and connect to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Oct 2018 23:23:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19019/pairing-bonding-with-ble_app_template-example-not-working-for-me" /><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/154734?ContentTypeID=1</link><pubDate>Fri, 26 Oct 2018 23:23:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84719fef-09c0-40a2-8cab-bb1aeb782dda</guid><dc:creator>EggplantSystems</dc:creator><description>&lt;p&gt;I had a similar problem with the &lt;kbd&gt;ble_app_bms&lt;/kbd&gt; example.&lt;/p&gt;
&lt;p&gt;My first pairing (with my smartphone) worked.&amp;nbsp; After unpairing and trying to reconnect, I would get &lt;kbd&gt;PM_EVT_ERROR_UNEXPECTED&lt;/kbd&gt;.&lt;/p&gt;
&lt;p&gt;In another answer, Hung Bui advised setting &lt;kbd&gt;allow_repairing = true&lt;/kbd&gt; in the call to &lt;kbd&gt;pm_conn_sec_config_reply()&lt;/kbd&gt;.&amp;nbsp; That fixed it for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73530?ContentTypeID=1</link><pubDate>Fri, 27 Jan 2017 14:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b042d6a2-4cc7-401f-81e7-4c84bab1a513</guid><dc:creator>Matej</dc:creator><description>&lt;p&gt;Hi, unfortunately no. I didn&amp;#39;t have that much time although. After not being able to make it work with the template from github I decided to follow the tutorial for Segger Studio from this page. But I get two leds that are always on and not one blinking like it would be if device was advertising. I don&amp;#39;t know exactly why that would be as the precompiled hex file that comes with the SDK works. Is there something that you have to set up in the environment for specific board or no? The github project has a file for ble400 pins but I don&amp;#39;t know how would the precompiled hex file then work out of the box.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73529?ContentTypeID=1</link><pubDate>Thu, 26 Jan 2017 09:45:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f27d446-53a9-4c9a-a57f-de268dea7f2a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Have you solved the issue? If not, what memory setting are you using? Have you been able to do a sniffer trace?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73528?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2017 12:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cef82294-c4d3-47b9-9599-bde6293fa81b</guid><dc:creator>Matej</dc:creator><description>&lt;p&gt;I managed to enable the logs and I got NRF_ERROR_INTERNAL I also tracked the  PM_EVT_ERROR_UNEXPECTED and it gets called by SM_EVT_ERROR_UNEXPECTED on line 300 in peer_manager.c&lt;/p&gt;
&lt;p&gt;I will look at the tutorials maybe I will find something useful. To set up the project I just opened the GitHub project that I mentioned before. That worked out of the box. Then I imported the project from examples to SEGGER Studio and changed the .emProject file to resemble the file from GitHub project. I think that I might have missed out some detail in that process that may have caused this behavior.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73524?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2017 11:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4c98399-80f7-455f-bebf-c52d2bc1db62</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;The error value is in p_evt-&amp;gt;params.error_unexpected.error, you can use SEGGER_RTT_printf to print out.&lt;/p&gt;
&lt;p&gt;There are only 3 place where PM_EVT_ERROR_UNEXPECTED is assigned inside peer_manager, you can track them down.&lt;/p&gt;
&lt;p&gt;I assume you have followed the tutorial &lt;a href="https://devzone.nordicsemi.com/blogs/845/segger-embedded-studio-cross-platform-ide-w-no-cod/"&gt;here&lt;/a&gt; (a bit out of date) and &lt;a href="https://devzone.nordicsemi.com/blogs/1020/"&gt;here&lt;/a&gt; ?&lt;/p&gt;
&lt;p&gt;Also make sure you erase the chip completely when you test. There could be that earlier data stored can cause an issue when bonding is stored.&lt;/p&gt;
&lt;p&gt;You can try to capture a &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;sniffer trace&lt;/a&gt; to see what happens over the air.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73527?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 17:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88be8a01-427c-4467-af88-410ce8623aa3</guid><dc:creator>Matej</dc:creator><description>&lt;p&gt;Hmm ... the precompiled hex works. Could there be something in the project settings that might interfeere? I used the SEGGER Studio template: &lt;a href="https://github.com/monpetit/inventus-factory-examples/tree/master/nrf51822_s130_ble_app_uart"&gt;github.com/.../nrf51822_s130_ble_app_uart&lt;/a&gt; from here but it is somewhat outdated so I changed the .emProject file a bit to make it work. I just added some preprocessor paths.&lt;/p&gt;
&lt;p&gt;How can I display the error code of PM_EVT_ERROR_UNEXPECTED. Right now the only way I know to display debug data is through SEGGER_RTT_WriteString function while I debug in SEGGER Studio. I tried to display the code like that but it didnt show.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73523?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 15:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc455ad1-6b1e-4686-88c3-7eb404f16f54</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please try to test again with unmodified example, you can test with the precompiled hex file.
It works fine for me here. You can also try to test with another example, for example hrs or proximity.&lt;/p&gt;
&lt;p&gt;Please find the error code when the PM_EVT_ERROR_UNEXPECTED happen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73526?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 13:28:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccbb00de-0233-40a1-9ce4-1f4c6fa6c239</guid><dc:creator>Matej</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I dug a little bit deeper and I get the PM_EVT_ERROR_UNEXPECTED error pm_evt_handler (I also switched to example from 12.2.0 now but the problem is still there)&lt;/p&gt;
&lt;p&gt;This is what happens:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I upload the code to device&lt;/li&gt;
&lt;li&gt;Device starts advertising (led is blinking)&lt;/li&gt;
&lt;li&gt;I scan with nRF Connect&lt;/li&gt;
&lt;li&gt;I connect with nRF Connect (led is off)&lt;/li&gt;
&lt;li&gt;I start bonding with nRF Connect (led is off)&lt;/li&gt;
&lt;li&gt;Bonding fails (led is still off)&lt;/li&gt;
&lt;li&gt;Device automatically disconnects (led is off)&lt;/li&gt;
&lt;li&gt;Device automatically disconnects (led is off)&lt;/li&gt;
&lt;li&gt;If I run scan again device isn&amp;#39;t found anymore&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I managed to make it work but with this setup:
#define SEC_PARAM_BOND                  0&lt;br /&gt;
#define SEC_PARAM_MITM                  0&lt;br /&gt;
#define SEC_PARAM_LESC                  0&lt;br /&gt;
#define SEC_PARAM_KEYPRESS              0&lt;br /&gt;
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_NONE&lt;br /&gt;
#define SEC_PARAM_OOB                   0&lt;br /&gt;
#define SEC_PARAM_MIN_KEY_SIZE          7&lt;br /&gt;
#define SEC_PARAM_MAX_KEY_SIZE          16&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;sec_param.kdist_own.enc  = 0;
sec_param.kdist_own.id   = 0;
sec_param.kdist_peer.enc = 0;
sec_param.kdist_peer.id  = 0;&lt;/p&gt;
&lt;p&gt;If I want to do any other combination with
#define SEC_PARAM_BOND                  1
it fails&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing/bonding with ble_app_template example not working for me</title><link>https://devzone.nordicsemi.com/thread/73525?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 12:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f484ed49-eada-4d1f-af72-6bbc7c59d456</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Matej,&lt;/p&gt;
&lt;p&gt;When it &amp;quot;hang&amp;quot; what happened after that ? Would the device advertise ?&lt;/p&gt;
&lt;p&gt;Please follow &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/#60126"&gt;this guide&lt;/a&gt; and find out where in the code it stuck.&lt;/p&gt;
&lt;p&gt;The ble_app_template does support bonding. Did you add any modification to the code ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>