<?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>Bonding Problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29227/bonding-problem</link><description>Hello 
 I am trying to create secure connection between peripheral device and mobile app &amp;amp; central device. 
 I created my own custom service and want to make them secure. 
 But i am getting 
 
 app: ERROR 2 [NRF_ERROR_SOFTDEVICE_NOT_ENABLED] at </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jan 2018 12:31:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29227/bonding-problem" /><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116252?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 12:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:131df2ab-4dce-4d9d-adb4-901d4ec84024</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;thanks for your effort. BTW. i like to share again. i realy spend much time on this issue. debuging and coding. i am not expecting from any body to write some code or some thing like this.
Thanks againg.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116250?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 12:00:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75fcf6a7-f421-4866-bae1-eedc909e7b02</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Great! Then this question seems to be answered. Your other questions should be asked separately. You can store your data using FDS, &lt;a href="https://github.com/hubuhubu/nRF52-fds-example"&gt;here&lt;/a&gt; is an example showing you how to do it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116251?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 14:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0cd9bb9-ef78-4f7d-84b3-e605bd43508b</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;You are correct. When i comment config_init function it works.&lt;/p&gt;
&lt;p&gt;How can i store my data without external eeprom?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116249?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 14:08:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aad1e406-8487-42b0-8bcf-428b22dda5ec</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not entirely sure what is going on, but if you comment out config_init() it seems to be working. I see that you are using fstorage directly. Peer Manager uses FDS which uses Fstorage, so I think you are getting a conflict there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116248?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 15:35:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a1d9a8c-9f55-45d7-ac4e-8ef841d36694</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;I am using Keil 5.2&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116247?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 14:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96631460-08b2-4c41-93f1-14be60801b5a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m trying to get your project to work. Which toolchain have you been using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116246?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 14:29:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f92f61c-5691-4d83-88c8-6935c6c0637e</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;I still did not solve this problem. Can some one help a little?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116243?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 06:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6612a2df-d96d-4cf6-9745-697c582b01dd</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;Hello Peter.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Which SDK and SoftDevice are you using?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I am using SD132, nRF5_SDK_14.2.0_17b948a, nRF52840.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Did you start off with an example using Peer Manager?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes i did. In fact i used ble_app_gls example.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Do you have any logs showing what is going on?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is my project definetions. &lt;code&gt;DEBUG BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52 NRF52832_XXAA NRF52_PAN_74 NRF_SD_BLE_API_VERSION=5 S132 SOFTDEVICE_PRESENT SWI_DISABLE0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here is my console log (i opened colored log);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[0m&amp;lt;info&amp;gt; app: First time boot[0m
[0m&amp;lt;info&amp;gt; app: --&amp;gt; Event received: wrote 44 bytes at address 0x3E000.[0m
[0m&amp;lt;info&amp;gt; app: Fast advertising[0m
[0m&amp;lt;info&amp;gt; app: Blinky example started.[0m
[0m&amp;lt;info&amp;gt; app: Connected[0m
[1;31m&amp;lt;error&amp;gt; app: ERROR 2 [NRF_ERROR_SOFTDEVICE_NOT_ENABLED] at ..\..\..\main.c:548[0m
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;You are getting PM_EVT_ERROR_UNEXPECTED?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is right. In the &lt;code&gt;pm_evt_handler&lt;/code&gt; case&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case PM_EVT_ERROR_UNEXPECTED:
{
    // Assert.
    APP_ERROR_CHECK(p_evt-&amp;gt;params.error_unexpected.error);
} break;
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;Have you tried to debug further to see where it originates from?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I made some debug to see what is going on. But did not get much more info. In fact, i did not find explanation for this error code. Usally when i get an error code, i am looking for some explanation for that. And that helps me alot.But i did not find for this error.&lt;/p&gt;
&lt;p&gt;Some how i got some feelings that i am getting this because my main loop is this;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// any pending write request?
		if( pending_write == true )
		{
			// clear write request
			pending_write = false;
			
			// write to flash and check for errors
			err_code = nrf_fstorage_write( &amp;amp;fstorage, APP_FLASH_START_ADDRESS, &amp;amp;config, sizeof( config_t ), NULL );
			APP_ERROR_CHECK( err_code );
		}
		
        if (NRF_LOG_PROCESS() == false)
        {
            power_manage();
        }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Am i feeling right?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Also consider uploading your complete project so I can test it here. You can do it by editing your question clicking the paper clip icon.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I guess this is best way. BTW i need docs to understand ble and nordic sdk. I may have a little confuse.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116242?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2018 16:27:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebaaf370-97e6-4238-81d9-2e4cedf79f95</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Which SDK and SoftDevice are you using? Did you start off with an example using Peer Manager? Do you have any logs showing what is going on?&lt;/p&gt;
&lt;p&gt;You are getting PM_EVT_ERROR_UNEXPECTED? Have you tried to debug further to see where it originates from?&lt;/p&gt;
&lt;p&gt;Also consider uploading your complete project so I can test it here. You can do it by editing your question and clicking the paper clip icon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116245?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2018 08:22:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b13b600b-a428-49a5-b316-440c5f2cd8a1</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;Here is an update:&lt;/p&gt;
&lt;p&gt;Now i get this error:  &lt;strong&gt; app: ERROR 2 [NRF_ERROR_SOFTDEVICE_NOT_ENABLED] at ......\main.c:525&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Which is in the handler function &lt;strong&gt;case PM_EVT_ERROR_UNEXPECTED&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void pm_evt_handler(pm_evt_t const * p_evt)
{
    ret_code_t err_code;

    switch (p_evt-&amp;gt;evt_id)
    {
        case PM_EVT_BONDED_PEER_CONNECTED:
        {
            NRF_LOG_INFO(&amp;quot;Connected to a previously bonded device.&amp;quot;);
            // Start Security Request timer.
            err_code = app_timer_start(m_sec_req_timer_id, SECURITY_REQUEST_DELAY, NULL);
            APP_ERROR_CHECK(err_code);
        } break;

        case PM_EVT_CONN_SEC_SUCCEEDED:
        {
            pm_conn_sec_status_t conn_sec_status;

            // Check if the link is authenticated (meaning at least MITM).
            err_code = pm_conn_sec_status_get(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_status);
            APP_ERROR_CHECK(err_code);

            if (conn_sec_status.mitm_protected)
            {
                NRF_LOG_INFO(&amp;quot;Link secured. Role: %d. conn_handle: %d, Procedure: %d&amp;quot;,
                             ble_conn_state_role(p_evt-&amp;gt;conn_handle),
                             p_evt-&amp;gt;conn_handle,
                             p_evt-&amp;gt;params.conn_sec_succeeded.procedure);
            }
            else
            {
                // The peer did not use MITM, disconnect.
                NRF_LOG_INFO(&amp;quot;Collector did not use MITM, disconnecting&amp;quot;);
                err_code = pm_peer_id_get(m_conn_handle, &amp;amp;m_peer_to_be_deleted);
                APP_ERROR_CHECK(err_code);
                err_code = sd_ble_gap_disconnect(m_conn_handle,
                                                 BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
                APP_ERROR_CHECK(err_code);
            }
        } break;

        case PM_EVT_CONN_SEC_FAILED:
        {
            NRF_LOG_INFO(&amp;quot;Failed to secure connection. Disconnecting.&amp;quot;);
            err_code = sd_ble_gap_disconnect(m_conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            if (err_code != NRF_ERROR_INVALID_STATE)
            {
                APP_ERROR_CHECK(err_code);
            }
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
        } break;

        case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = false};
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_config);
        } break;

        case PM_EVT_STORAGE_FULL:
        {
            // Run garbage collection on the flash.
            err_code = fds_gc();
            if (err_code == FDS_ERR_BUSY || err_code == FDS_ERR_NO_SPACE_IN_QUEUES)
            {
                // Retry.
            }
            else
            {
                APP_ERROR_CHECK(err_code);
            }
        } break;

        case PM_EVT_PEERS_DELETE_SUCCEEDED:
        {
            NRF_LOG_DEBUG(&amp;quot;PM_EVT_PEERS_DELETE_SUCCEEDED [ advertising_start ]&amp;quot;);
            advertising_start(/*false*/);
        } break;

        case PM_EVT_LOCAL_DB_CACHE_APPLY_FAILED:
        {
            // The local database has likely changed, send service changed indications.
            pm_local_database_has_changed();
        } break;

        case PM_EVT_PEER_DATA_UPDATE_FAILED:
        {
            // Assert.
            **APP_ERROR_CHECK(p_evt-&amp;gt;params.peer_data_update_failed.error);**
        } break;

        case PM_EVT_PEER_DELETE_FAILED:
        {
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.peer_delete_failed.error);
        } break;

        case PM_EVT_PEERS_DELETE_FAILED:
        {
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.peers_delete_failed_evt.error);
        } break;

        **case PM_EVT_ERROR_UNEXPECTED:**
        {
            // Assert.
            APP_ERROR_CHECK(p_evt-&amp;gt;params.error_unexpected.error);
        } break;

        case PM_EVT_CONN_SEC_START:
        case PM_EVT_PEER_DATA_UPDATE_SUCCEEDED:
        case PM_EVT_PEER_DELETE_SUCCEEDED:
        case PM_EVT_LOCAL_DB_CACHE_APPLIED:
        case PM_EVT_SERVICE_CHANGED_IND_SENT:
        case PM_EVT_SERVICE_CHANGED_IND_CONFIRMED:
        default:
            break;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bonding Problem</title><link>https://devzone.nordicsemi.com/thread/116244?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2018 08:14:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a18b039-7874-47cc-afd0-381d92cde0a8</guid><dc:creator>Muhammet YILDIZ</dc:creator><description>&lt;p&gt;can some one help? I still could not solve this problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>