<?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>Random disconnect -&amp;gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29780/random-disconnect---timeout-0x08</link><description>Hi,
i got a random disconnect and cant find the cause.
I found this post devzone.nordicsemi.com/.../ and tried to folow the procedure. 
 I have set up breakpoints wherever sd_ble_gap_disconnect() is called. 
 
 on_conn_params_evt() line 183 : 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Feb 2017 14:26:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29780/random-disconnect---timeout-0x08" /><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118107?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 14:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea936c53-072c-4910-8d4c-b4deaef042da</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;Now it starts. I have to check it more out too see if it is improved. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118106?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 13:35:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4293cc38-36c3-4842-8467-45de34f5acd7</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Ok. Seems to be a bug in the documentation, please try:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_clock_lf_cfg_t rc_cfg = {
    .source = NRF_CLOCK_LF_SRC_RC,
    .rc_ctiv = 16, // check every 4 * 250ms
    .rc_temp_ctiv = 2, // only calibrate if temperature has changed.
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118108?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 07:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:891cef09-e265-4ae2-90cc-5fea35737855</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;When i add the code you suggested it compiles and flash-es but device seems like dead.
I added you code,  commented &lt;code&gt;nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;&lt;/code&gt; and replaced &lt;code&gt;SOFTDEVICE_HANDLER_INIT(&amp;amp;clock_lf_cfg, NULL);&lt;/code&gt; with &lt;code&gt;SOFTDEVICE_HANDLER_INIT(&amp;amp;rc_cfg, NULL);&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118105?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 19:54:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba234775-0b46-4475-9d39-237a7c22070f</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What do you mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118100?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 10:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84263fb9-8ad3-4fd4-b08c-02c62b5c2e04</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;It does not start at all if i make this changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118102?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 10:27:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:441872c7-3acc-4545-804c-3542afb6a838</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;However, you can try to use the internal RC oscillator to see if that changes anything:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_clock_lf_cfg_t rc_cfg = {
   .source = NRF_CLOCK_LF_SRC_RC,
   .rc_ctiv = 4, // check every 4 * 250ms
   .rc_temp_ctiv = 1, // only calibrate if temperature has changed.
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Change it inside ble_stack_init().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118101?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 10:24:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a4477c7-124f-4386-98a5-10babf982aca</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Ok. That&amp;#39;s good. It is actually the central device that dictates the supervision timeout. You can check it when you get the BLE_GAP_EVT_CONNECTED event:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_ble_evt-&amp;gt;evt.gap_evt.params.connected.conn_params.conn_sup_timeout
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should also check it when you get the BLE_GAP_EVT_CONN_PARAM_UPDATE event.&lt;/p&gt;
&lt;p&gt;But if you have tested with several central devices I believe this is a dead end, you could check it to be sure of course.&lt;/p&gt;
&lt;p&gt;Ohh, I thought you were using one of our DKs, the PCA10040, not a module. Then it could be a crystal issue. The PCA100040 has a LF crystal with 20 ppm, and this is what the examples assume is used. If the ppm of the crystal used in Nina-B1 is higher than 20 ppm you can see issues like this. I had a look at the datasheet, but I was able to find the and ppm value for the crystal used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118109?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 09:54:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a102c8f-10d7-43f3-a646-752b1918ae43</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;I have &lt;code&gt;#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)&lt;/code&gt;. Is it possible that the Master changes the supervision timeout? I saw that i have in &lt;code&gt;conn_params_init()&lt;/code&gt; function &lt;code&gt;cp_init.p_conn_params = NULL;&lt;/code&gt; which means that the Master can change the parameters?
I have tried with few devices (android/linux) and 2 nrf52832 (evk-nina-b1) boards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118099?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 09:43:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17b23d39-76cc-4293-a4f1-63032649a3f2</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I see. The BLE_HCI_CONNECTION_TIMEOUT disconnect reason means that the connection timed out, no packets were received from the peer and the supervision timer expired.&lt;/p&gt;
&lt;p&gt;If you haven&amp;#39;t changed the supervision timeout or the output power, this is typically because of hardware issues (assuming the distance between the devices are small). For example that the antenna is not working properly, that the crystal isn&amp;#39;t working properly and so on.&lt;/p&gt;
&lt;p&gt;The problem could be with the PCA10040, or the device you are connecting to. Do you have any other devices to test with?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118103?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 08:57:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36af1b6d-da25-45f7-a3e0-56fad3c77251</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;This is a separate problem. Not related to 30s timeout. It happens randomly evan if i don&amp;#39;t do anything. Sometimes instantly, sometimes after 3 seconds, sometime after 2 minutes. It is not related to write/read response.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnect -&gt; timeout 0x08</title><link>https://devzone.nordicsemi.com/thread/118104?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 08:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:055e76db-394d-44b5-9949-6f8f02999b73</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Why didn&amp;#39;t you just edit &lt;a href="https://devzone.nordicsemi.com/question/113403/no-response-on-readwrite-request/"&gt;your question&lt;/a&gt; and add the this information there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>