<?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>pc-ble-driver - Connection Request Failed, reason 4</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25564/pc-ble-driver---connection-request-failed-reason-4</link><description>Hi,
I am trying to connect 4 devices with the pc-ble-driver. Therefore I modified the heartrate example. 
 3 Devices are connecting fine - on the 4th connection request I get:
Connection Request Failed, reason 4 =&amp;gt; No Memory for operation 
 In ble_stack_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Oct 2017 16:48:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25564/pc-ble-driver---connection-request-failed-reason-4" /><item><title>RE: pc-ble-driver - Connection Request Failed, reason 4</title><link>https://devzone.nordicsemi.com/thread/100783?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2017 16:48:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6db352-b087-49e5-9a0e-fbf100a420b8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The problem is that the parameter &lt;code&gt;ble_enable_params.common_enable_params.p_conn_bw_counts&lt;/code&gt; for &lt;code&gt;sd_ble_enable()&lt;/code&gt; is set to &lt;code&gt;NULL&lt;/code&gt;, while the &lt;code&gt;BLE_COMMON_OPT_CONN_BW&lt;/code&gt; option is set to &lt;code&gt;BLE_CONN_BW_HIGH&lt;/code&gt;. If &lt;code&gt;p_conn_bw_counts&lt;/code&gt; is set to &lt;code&gt;NULL&lt;/code&gt;, the stack will only reserve RAM for the default setting, which is &lt;code&gt;BLE_CONN_BW_MID&lt;/code&gt; for &lt;code&gt;BLE_GAP_ROLE_CENTRAL&lt;/code&gt;. See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__common__enable__params__t.html"&gt;this&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__common__opt__conn__bw__t.html"&gt;this&lt;/a&gt; infocenter page for more details.&lt;/p&gt;
&lt;p&gt;The solution is either to provide valid &lt;code&gt;p_conn_bw_counts&lt;/code&gt; parameter to &lt;code&gt;sd_ble_enable()&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_conn_bw_counts_t ble_conn_bw_counts;
memset(&amp;amp;ble_conn_bw_counts, 0, sizeof(ble_conn_bw_counts));
ble_conn_bw_counts.rx_counts.high_count = MAX_PEER_COUNT;
ble_conn_bw_counts.tx_counts.high_count = MAX_PEER_COUNT;
ble_enable_params.common_enable_params.p_conn_bw_counts = &amp;amp;ble_conn_bw_counts;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or to change &lt;code&gt;ble_options_set()&lt;/code&gt; to use medium bandwidth configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;common_opt.conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_MID;
common_opt.conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_MID;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver - Connection Request Failed, reason 4</title><link>https://devzone.nordicsemi.com/thread/100782?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 09:26:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a1fdf3e-2fe9-442b-a1a5-f53c995aa518</guid><dc:creator>Frederik</dc:creator><description>&lt;p&gt;Oh im sorry, there was some missing information about MAX_PEER_COUNT - I modified the example to use MAX_PEER_COUNT to be also used by ble_enable_params.gap_enable_params.central_conn_count as mentioned above.&lt;/p&gt;
&lt;p&gt;So it&amp;#39;s still the error described in the post:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- ble_enable_params.gap_enable_params.central_conn_count = 4 doesn&amp;#39;t work for 4 devices.
- ble_enable_params.gap_enable_params.central_conn_count = 5 doesn&amp;#39;t work for 4 devices
- ble_enable_params.gap_enable_params.central_conn_count = 6 works for 4 devices 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&amp;#39;s the parameter passed to sd_ble_enable()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver - Connection Request Failed, reason 4</title><link>https://devzone.nordicsemi.com/thread/100781?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 11:44:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd3bab20-087e-418e-ab0f-5952d8aa7483</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;&lt;code&gt;MAX_PEER_COUNT&lt;/code&gt; should not cause this error, unless you have modified the example to use this define in another way. Is the error returned from the call to &lt;code&gt;sd_ble_gap_connect()&lt;/code&gt;? From the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#gacb36dc9947591179acb83aef50b04282"&gt;API documentation&lt;/a&gt;, &lt;code&gt;NRF_ERROR_NO_MEM&lt;/code&gt; is caused by &lt;em&gt;&amp;quot;The configured memory pool (see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__conn__bw__counts__t.html"&gt;&lt;code&gt;ble_conn_bw_counts_t&lt;/code&gt;&lt;/a&gt;) is not large enough for the bandwidth selected for this connection&amp;quot;&lt;/em&gt;. Are you setting &lt;code&gt;BLE_COMMON_OPT_CONN_BW&lt;/code&gt; using &lt;code&gt;sd_ble_opt_set()&lt;/code&gt; in your code? What value do you pass to &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__common__enable__params__t.html#ad0357153e95e0016e4a50bd29fd2090c"&gt;&lt;code&gt;p_conn_bw_counts&lt;/code&gt;&lt;/a&gt; in param to &lt;code&gt;sd_ble_enable()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver - Connection Request Failed, reason 4</title><link>https://devzone.nordicsemi.com/thread/100780?ContentTypeID=1</link><pubDate>Mon, 02 Oct 2017 14:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34ae9cb2-0dfa-408d-aa5b-810beb183d9e</guid><dc:creator>Frederik</dc:creator><description>&lt;p&gt;Just did some further testing:
setting MAX_PEER_COUNT to 6 seems to work for 4 devices. Is this a bug?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>