<?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>Peripheral disconnected ，Disconnected, reason 40</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67272/peripheral-disconnected-disconnected-reason-40</link><description>when I use central and Peripheral all concerned, Eight Peripheral connected to the central 。when I&amp;#39;ll connect my phone to the central Peripheral . Device Error 
 Here&amp;#39;s the RTT message: 
 &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Nov 2020 16:54:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67272/peripheral-disconnected-disconnected-reason-40" /><item><title>RE: Peripheral disconnected ，Disconnected, reason 40</title><link>https://devzone.nordicsemi.com/thread/278505?ContentTypeID=1</link><pubDate>Wed, 04 Nov 2020 16:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2428103-b327-4e97-b72e-62a20e9299a1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Try increasing the connection interval, and see if that helps. If you are using the scanner module to connect, and not setting any other values when you call nrf_ble_scan_init(), then increase the value of&amp;nbsp;NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL and&amp;nbsp;NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL in sdk_config.h&lt;/p&gt;
&lt;p&gt;We have a&amp;nbsp;unofficial multilink version of the ble_app_uart_c here,&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nrf52-ble-app-uart-c-multilink"&gt;https://github.com/NordicPlayground/nrf52-ble-app-uart-c-multilink&lt;/a&gt;&amp;nbsp;,you might find that useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral disconnected ，Disconnected, reason 40</title><link>https://devzone.nordicsemi.com/thread/275442?ContentTypeID=1</link><pubDate>Sat, 17 Oct 2020 01:22:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3becb762-b287-49b3-97b0-3c67531e8c4b</guid><dc:creator>see you Monkey King</dc:creator><description>&lt;p&gt;hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/2708.svg" title="Airplane"&gt;&amp;#x2708;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&amp;nbsp; &amp;nbsp;I tried to change&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#define SLAVE_LATENCY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;gap_conn_params.slave_latency&amp;nbsp; &amp;nbsp; &amp;nbsp;= SLAVE_LATENCY;&lt;/p&gt;
&lt;p&gt;#ifndef NRF_BLE_SCAN_SCAN_INTERVAL&lt;br /&gt;#define NRF_BLE_SCAN_SCAN_INTERVAL 375&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;#ifndef NRF_BLE_SCAN_SCAN_WINDOW&lt;br /&gt;#define NRF_BLE_SCAN_SCAN_WINDOW 80&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;But it doesn&amp;#39;t help.&amp;nbsp;Instead, it&amp;#39;s more error reporting 0x8.。What else could I do?&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 251 on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: MAC: 736AE5563478&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Peripheral connected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: m_conn_handle 0x8&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x8 (response).&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: ATT MTU exchange completed.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Ble NUS max data length set to 0xF4(244)&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 328&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; app: PHY update request.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Peripheral disconnected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Disconnected, reason 8&lt;br /&gt; 0&amp;gt; &lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 251 on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: MAC: 736AE5563478&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Peripheral connected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: m_conn_handle 0x8&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x8 (response).&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: ATT MTU exchange completed.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Ble NUS max data length set to 0xF4(244)&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 328&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; app: PHY update request.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Peripheral disconnected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Disconnected, reason 8&lt;/p&gt;
&lt;p&gt;0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 251 on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: MAC: 736AE5563478&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Peripheral connected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: m_conn_handle 0x8&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x8 (response).&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: ATT MTU exchange completed.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Ble NUS max data length set to 0xF4(244)&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x8.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 328&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; app: PHY update request.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Peripheral disconnected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Disconnected, reason 40&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral disconnected ，Disconnected, reason 40</title><link>https://devzone.nordicsemi.com/thread/275382?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 13:21:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad1d7227-0139-4464-9e10-590a721e85c0</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Disconnect reason 40 in hex is 0x28, that points to;&lt;/p&gt;
&lt;p&gt;#define BLE_HCI_INSTANT_PASSED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Instant Passed. */&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What I suspect is the problem is that a link layer procedure is started, some of these procedures assume that a change should occur in a instant&amp;nbsp;after&amp;nbsp;6 connection intervals + slave latency. If the peer/link is somehow blocked during this complete period (e.g. due to scanning and/or flash erase operations), then the instant might have passed. You could try to adjust the&amp;nbsp;scanning window/interval, increase connection interval, and/or maybe try slave latency=2 for the&amp;nbsp;peripheral link.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>