<?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>Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17854/connecting-a-peripheral-device-to-a-central-device</link><description>Hi, I am trying to connect a peripheral device which in this case is a BLE device called DELTA and I am trying to connect it to a central device which is the NRF52 board. However, I am not successful because they are not connected to each other somehow</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Nov 2016 15:21:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17854/connecting-a-peripheral-device-to-a-central-device" /><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68824?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2016 15:21:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ceb17580-54ab-41d9-a339-105f56554eb7</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Ok, thanks I solved the problem with the error. It was because I had the wrong UUID placed for the RX characterisitics, but I changed it and the central is successfully connected to the peripheral device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68823?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2016 10:30:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4089b4c1-bf63-48ab-b7c1-842403824665</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The function that is giving the error is &lt;code&gt;ble_nus_c_rx_notif_enable()&lt;/code&gt; at line 207.&lt;/p&gt;
&lt;p&gt;The two devices are connected, but this function tries to request the peripheral to start sending notification of RX characteristic. But the central has not discovered the NUS_RX_CHARACTERISTIC on the peripheral, and the function will return with &lt;code&gt;NRF_ERROR_INVALID_STATE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;What kind of code are you running on the DELTA device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68821?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 17:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36237b63-0ab2-4a7a-8e33-ebc21187fa59</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;So no the error code is not 579 now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68820?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 17:03:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6494c884-b2cc-46fc-a98b-7fa90210682c</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Hi Sigurd, in the p_error_info, the error code is 0x00000008. The line num is 0x000000D0. The p_filename is 0x00020880 now. The NRF_FALUT_ID_SDK_ERROR is 0x00004001. Is that helpful?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68819?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 16:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5efccc62-4790-4070-acd8-b201825cc3f6</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;But the error_code is still 579?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68818?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 16:03:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51682b48-6440-4625-8c56-94d1dae4db74</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Also, the NRF_FAULT_ID_SDK_ERROR within the  app_error_handler method is 0x00004001&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68817?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:59:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8678323b-7e58-4f83-8907-6195698f6a60</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Actually, for the m_error_data struct the err_info is 0x00000000, the pc is 0x0001089E, and the fault ID is  0x00000001. I will check app_error_handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68816?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27273f1a-eddd-4505-ba2d-7d72131a8013</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;579 is not a valid error code. However, I&amp;#39;m not sure why it would get &amp;quot;corrupted&amp;quot;. Is the &lt;code&gt;err_code&lt;/code&gt; also 579 in the &lt;code&gt;m_error_data&lt;/code&gt; struct and in the &lt;code&gt;app_error_handler&lt;/code&gt; scope?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68813?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a898f5b-e428-4be3-8ba7-5da28a310065</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;The value of line_num is 0x0400. The p_file_name is 0x000008E5 .  The error code is 0x00000579. Is that good?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68812?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:40:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05ed7f72-bcf4-4843-9a24-a0dceb4d5c24</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;In the &lt;code&gt;p_error_info&lt;/code&gt; struct, you have &lt;code&gt;line_num&lt;/code&gt;,&lt;code&gt;p_file_name&lt;/code&gt; and &lt;code&gt;err_code&lt;/code&gt;. What are the values of these 3?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68807?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:33:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2c151dd-0bfd-4235-86a3-faa52d23340b</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Hi Sigurd, I got the error code. Based off the m_error data the fault_id is 0x00000001. Also, the err_code from the &lt;strong&gt;p_error info is 0x00000579&lt;/strong&gt;. Is that what you wanted?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68805?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:16:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11dfa808-e1a1-4bbf-a24f-23ab8df94af1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Add the breakpoint at line 113( at while (loop); ) in app_error.c. Remeber to add DEBUG as a define in the C/C++ tab. Set the optimization to 0 in the C/C++ tab.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68806?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 15:15:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7bf8128-47bb-47d8-9608-3a17d8f7c754</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Actually please ignore my last comment. I found the error location, but it does not let me add a breakpoint here?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// The following variable helps Keil keep the call stack visible, in addition, it can be set to
// 0 in the debugger to continue executing code after the error check.
volatile bool loop = true;
UNUSED_VARIABLE(loop);

m_error_data.fault_id   = id;
m_error_data.pc         = pc;
m_error_data.error_info = info;

switch (id)
{
    case NRF_FAULT_ID_SDK_ASSERT:
        m_error_data.p_assert_info = (assert_info_t *)info;
        m_error_data.line_num      = m_error_data.p_assert_info-&amp;gt;line_num;
        m_error_data.p_file_name   = m_error_data.p_assert_info-&amp;gt;p_file_name;
        break;

    case NRF_FAULT_ID_SDK_ERROR:
        m_error_data.p_error_info = (error_info_t *)info;
        m_error_data.err_code     = m_error_data.p_error_info-&amp;gt;err_code;
        m_error_data.line_num     = m_error_data.p_error_info-&amp;gt;line_num;
        m_error_data.p_file_name  = m_error_data.p_error_info-&amp;gt;p_file_name;
        break;
}

UNUSED_VARIABLE(m_error_data);

// If printing is disrupted, remove the irq calls, or set the loop variable to 0 in the debugger.
__disable_irq();
while (loop);

__enable_irq();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68808?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 14:51:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8e59574-f40d-46ed-bba5-f152f8fe6649</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Where you able to read the &lt;code&gt;err_code&lt;/code&gt; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68809?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 14:45:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abc75671-fb1a-4bfc-909a-805bb26dd328</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;I am using softdevice 132 and the SDK version is nRF5_SDK_12.1.0_0d23e2a. So when I first started debugging, it placed a break point through (is_uuid_present(&amp;amp;m_nus_uuid, p_adv_report)). Then after that when stepping through, it goes to the method, is_uuid_present and successfully matches the UUID. However, I though that it would go through the BLE_GAP_EVT_CONNNECTED which is when the NRF52 board would be solid, but it is just blinking every 4 seconds and displaying the loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68815?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 14:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60f63745-7432-4a87-bead-7129c7e2f28e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;What you mean by &amp;quot;softdevice part&amp;quot;? What SDK version and SoftDevice version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68814?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 14:33:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e64e6fa-3935-4ee3-ba23-be4193da5890</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;I have been trying to debug for a while by following the guide and the while  debugging and stepping through it skips through the softdevice part, do you think wrong version of softdevice could cause this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68811?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 14:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e535fbb-6653-4acc-9266-df3769566441</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try to read the error code. Follow &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this guide&lt;/a&gt; on how to debug and read the error code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68810?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 14:04:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe0c46b8-e13c-4c62-908b-ebee6a8c6dbe</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Also, I don&amp;#39;t think the code is going through
case BLE_GAP_EVT_CONNECTED:. Do you think that could be a reason? Should I keep the scan parameters  m_scan_params as well?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68804?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 13:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d095edb-1e84-4b6e-a2f9-1cbbac9194ae</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;This is the nrf52 developer kit and is not a custom board. What do you think I should do? It gives me this&lt;/p&gt;
&lt;p&gt;Connecting to target 98fa6b00e1d9 Uart_c Scan started Connecting to target 98fa6b00e1d9 Uart_c Scan started Connecting to target 98fa6b00e1d9 Uart_c Scan started&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68803?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 13:39:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e663fd35-babd-43e4-a2fc-2c26198e8cbe</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;That means that the device is restarting. This happens because the function &lt;code&gt;APP_ERROR_CHECK()&lt;/code&gt; has registered an error in &lt;code&gt;err_code&lt;/code&gt;. Is this a custom board or the nRF52-DK ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68802?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 13:34:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27cd44a7-f9c3-44f8-b4e9-519e7557babb</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Yes it is printing UART c scan started also. Does that mean anything? There is a loop that continues with those two messages I mentioned.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68822?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 08:28:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6870584-2679-4cbe-abec-58e019123d26</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;It keeps printing only “Connected to target” ? Is it printing “Uart_c Scan started” also ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68801?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 22:35:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5a2f509-b108-4dc8-ace3-6b57decf8ec5</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Hi Sigurd, thank you it is connected. However, it keeps printing connecting to target in my terminal called Termite and did not go through this case listed below. What should I do?&lt;/p&gt;
&lt;p&gt;case BLE_GAP_EVT_CONNECTED:
//NRF_LOG_DEBUG(&amp;quot;Connected to target\r\n&amp;quot;);
err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
APP_ERROR_CHECK(err_code);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting a peripheral device to a central device</title><link>https://devzone.nordicsemi.com/thread/68800?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 09:51:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e6c723b-45df-4749-8aa0-a591abe6589d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The BLE_UUID_NUS_SERVICE is 0x0001. The NUS_SERVICE_UUID_TYPE is a BLE_UUID_TYPE_VENDOR_BEGIN, this is defined in ble_types.h as 0x02. I don’t believe you need to change the &lt;code&gt;is_uuid_present()&lt;/code&gt;, the UUID gets decoded from the advertising data using the &lt;code&gt;sd_ble_uuid_decode()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Also, If the goal is just to connect the devices, and you know what the extracted_uuid is, just add this as the target_uuid, and the central will connect to the device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>