<?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>MTU Update</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60709/mtu-update</link><description>Hi, 
 
 I am trying to update the MTU between the central and peripheral to the maximum MTU. 
 at the connection interrupt from the central side I added 
 
 but I got error 7, Invalid Parameter !! what parameter could be wrong !? 
 In my peripheral side</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Apr 2020 12:42:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60709/mtu-update" /><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/247098?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 12:42:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7cdadb9-be10-4aa9-a359-bd28fc6d8a6c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you enable logging in the GATT module to see if MTU requests are sent and received?&lt;/p&gt;
&lt;p&gt;Relevant message sequence charts for reference:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a title="GATTC ATT_MTU Exchange" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_c___m_t_u___e_x_c_h_a_n_g_e.html?cp=4_6_3_1_2_2_3_0"&gt;- GATTC ATT_MTU Exchange&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a title="GATTS ATT_MTU Exchange" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_s___m_t_u___e_x_c_h_a_n_g_e.html?cp=4_6_3_1_2_4_3_1"&gt;- GATTS ATT_MTU Exchange&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246818?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 12:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:484dc70f-728b-4a5c-bdff-e52d6a9cf28f</guid><dc:creator>jawadk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please see my reply above, it&amp;#39;s&amp;nbsp;edited.&lt;/p&gt;
&lt;p&gt;I already tried to remove this function, the central start to work fine, but the effective MTU not changing.&lt;/p&gt;
&lt;p&gt;see my ticket above please where I explained what every side( central/peripheral) is responsible of ..&lt;/p&gt;
&lt;p&gt;Please help me to fix this problem, I have a 40000 bytes to send over BLE as fast as possible !&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246810?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 12:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e559b634-419b-403b-b69c-9310c80fd2bf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;What I meant to suggest was that you could remove the call to&amp;nbsp;nrf_ble_gatt_att_mtu_central_set() from the gatt_init() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246801?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 12:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6dfcea6-1828-441c-92c0-70aeae2009e2</guid><dc:creator>jawadk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How long should&amp;nbsp;the central&amp;nbsp;wait after the connection until it can request the MTU exchange ?&lt;/p&gt;
&lt;p&gt;what do you mean by using&amp;nbsp;&lt;span&gt;gatt_init() and not&amp;nbsp;nrf_ble_gatt_att_mtu_central_set()?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;see the implementation of my gatt_init() below:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for initializing the GATT module.
 */
static void gatt_init(void)
{
    ret_code_t err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);
    
    err_code = nrf_ble_gatt_att_mtu_central_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;something else that maybe is related !&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I started my project with the ble_app_multilink_central example, and then added to it the nus service and the USB peripheral, and disabled the lbs_c_init() function that i don&amp;#39;t need.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;can this example be cause a problem with MTU exchange ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jawad&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246752?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 10:12:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96be10d3-4bbb-4393-9d46-0f2753e251b1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;No, I&amp;#39;m afraid I don&amp;#39;t have an explanation for that. Have you tried to only call gatt_init() and not &lt;span&gt;nrf_ble_gatt_att_mtu_central_set()?&amp;nbsp;nrf_ble_gatt_att_mtu_central_set() is redundant when you want to use the max.&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE anyway.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246748?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 10:05:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e85e3275-38de-4f1a-b8fa-4fba0acb3db8</guid><dc:creator>jawadk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;this is the weirdest thing I seen !&lt;/p&gt;
&lt;p&gt;the desired_mtu is 247&lt;/p&gt;
&lt;p&gt;the&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT is 23&lt;/p&gt;
&lt;p&gt;the&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE is 247&lt;/p&gt;
&lt;p&gt;and still this&amp;nbsp;&lt;span&gt;nrf_ble_gatt_att_mtu_central_set function return&amp;nbsp;NRF_ERROR_INVALID_PARAM&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any explenation for that ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I didn&amp;#39;t change the anything in this function !&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;JK&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246691?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 07:58:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4be35303-b36b-47ee-953a-028eb44fc5ed</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Is&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT still 23 (it should not be changed)?&lt;/p&gt;
&lt;p&gt;Here is the param check inside&amp;nbsp;nrf_ble_gatt_att_mtu_central_set:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;if ((desired_mtu &amp;lt; BLE_GATT_ATT_MTU_DEFAULT) || (desired_mtu &amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE))&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return NRF_ERROR_INVALID_PARAM;&lt;br /&gt; }&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246684?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 07:16:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9eec500-1e3d-4ab3-a72b-48cb152e8534</guid><dc:creator>jawadk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the function nrf_ble_gatt_att_mtu_central_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);&lt;/p&gt;
&lt;p&gt;return error invalid paramiter in the central side, in the&amp;nbsp;gatt_init module, before any connection !&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;JK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU Update</title><link>https://devzone.nordicsemi.com/thread/246674?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 06:57:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4face29a-cc92-4031-818a-f617f99d8309</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would recommend using the&amp;nbsp;&lt;a title="Experimental: GATT Module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_gatt.html?cp=7_1_3_2_13"&gt;GATT Module&lt;/a&gt;&amp;nbsp;to manage the MTU negotiation as the other SDK examples do. This module will also handle Data length extension requests.&amp;nbsp; But to answer the question, &amp;quot;invalid parameter&amp;quot; is returned when you reply with an invalid MTU size. You may want to double-check that NRF_SDH_BLE_GATT_MAX_MTU_SIZE is set to 247 on the client-side as well.&lt;/p&gt;
&lt;p&gt;From the API documentation (&lt;a title="sd_ble_gattc_exchange_mtu_request" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_c___f_u_n_c_t_i_o_n_s.html?cp=4_6_3_1_2_2_2_6#ga269894b0415de8c4ae76343b74f6e655"&gt;sd_ble_gattc_exchange_mtu_request&lt;/a&gt;):&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[in]client_rx_mtuClient RX MTU size.&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;The minimum value is&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t___d_e_f_i_n_e_s.html#ga56f8a5e50e3e703e466a122c4cab4efb"&gt;BLE_GATT_ATT_MTU_DEFAULT&lt;/a&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The maximum value is&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/structble__gatt__conn__cfg__t.html#a3fac0ed97a3a75cf21e9ed8432b95193"&gt;ble_gatt_conn_cfg_t::att_mtu&lt;/a&gt;&amp;nbsp;in the connection configuration used for this connection.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The value must be equal to Server RX MTU size given in&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html#gacb80e44fb1309fe388c6baf747f6f994"&gt;sd_ble_gatts_exchange_mtu_reply&lt;/a&gt;&amp;nbsp;if an ATT_MTU exchange has already been performed in the other direction.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>