<?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>[CLOSED][nrf52832][S132 4.0.0] connection fails: exchange MTU request is not received on evt.common_evt.conn_handle=2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21322/closed-nrf52832-s132-4-0-0-connection-fails-exchange-mtu-request-is-not-received-on-evt-common_evt-conn_handle-2</link><description>Configuration: 
 (1) 52832 PCA10040;(2) softdevice: s132_nrf52_4.0.2; (3) sdk 13.0.0(4) 52832 configure 4 conccurent peripheral connections: 
 ble_cfg_t ble_cfg;
memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg));
ble_cfg.gap_cfg.role_count_cfg.periph_role_count</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Apr 2017 07:05:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21322/closed-nrf52832-s132-4-0-0-connection-fails-exchange-mtu-request-is-not-received-on-evt-common_evt-conn_handle-2" /><item><title>RE: [CLOSED][nrf52832][S132 4.0.0] connection fails: exchange MTU request is not received on evt.common_evt.conn_handle=2</title><link>https://devzone.nordicsemi.com/thread/83520?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 07:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbe0e226-7c18-47a2-be83-7884d4676111</guid><dc:creator>ffreturn</dc:creator><description>&lt;p&gt;Thanks for your answer. Problem is fixed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CLOSED][nrf52832][S132 4.0.0] connection fails: exchange MTU request is not received on evt.common_evt.conn_handle=2</title><link>https://devzone.nordicsemi.com/thread/83519?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 13:13:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3ecfaa4-96de-437c-895f-9ca4fde2928b</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The reason that there  only will a be MTU request/exchange for the two first links (0x00 and 0x01) is because of the default values used by the nrf_ble_gatt module.&lt;/p&gt;
&lt;p&gt;nrf_ble_gatt_on_ble_evt(..) in nrf_ble_gatt.c looks like the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void nrf_ble_gatt_on_ble_evt(nrf_ble_gatt_t * p_gatt, ble_evt_t const * p_ble_evt)
{
    uint16_t conn_handle = p_ble_evt-&amp;gt;evt.common_evt.conn_handle;

    if (conn_handle &amp;gt;= NRF_BLE_GATT_LINK_COUNT)
    {
        return;
    }
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The nrf_ble_gatt module will only do an action if &lt;code&gt;conn_handle &amp;lt; NRF_BLE_GATT_LINK_COUNT&lt;/code&gt;.
The root cause of the problem is how NRF_BLE_GATT_LINK_COUNT is set in nrf_ble_gatt.h:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_BLE_GATT_LINK_COUNT (NRF_BLE_PERIPHERAL_LINK_COUNT + NRF_BLE_CENTRAL_LINK_COUNT)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since both NRF_BLE_PERIPHERAL_LINK_COUNT and NRF_BLE_CENTRAL_LINK_COUNT by default only are defined in nrf_ble_gatt.h, their value is not related to the actual project settings, but instead the default value of &amp;#39;1&amp;#39;. Therefore, NRF_BLE_GATT_LINK_COUNT is by default &amp;#39;2&amp;#39;, and there the module will only do MTU request/exchange for the two first links. Changing the value of NRF_BLE_PERIPHERAL_LINK_COUNT and NRF_BLE_CENTRAL_LINK_COUNT to the correct values will solve the problem.&lt;/p&gt;
&lt;p&gt;When &amp;quot;re-defining&amp;quot; NRF_BLE_PERIPHERAL_LINK_COUNT and NRF_BLE_CENTRAL_LINK_COUNT, I would recommend to do so in sdk_config.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>