<?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>How to correctly set MTU size in Nordic Connect SDK V2.0?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90152/how-to-correctly-set-mtu-size-in-nordic-connect-sdk-v2-0</link><description>Hello, 
 I setup a BLE Peripheral that advertises a service with 2 notifications. Each notification has 240 bytes of payload data. When I connect with a client and subscribe to either one, I have the following output on the serial monitor (I modified</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Jul 2022 13:49:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90152/how-to-correctly-set-mtu-size-in-nordic-connect-sdk-v2-0" /><item><title>RE: How to correctly set MTU size in Nordic Connect SDK V2.0?</title><link>https://devzone.nordicsemi.com/thread/377894?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 13:49:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6efe17cf-c773-425b-87da-ada2d34c9a15</guid><dc:creator>MehdiZ</dc:creator><description>&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;I tested the peripheral_uart as is and it works correctly although there are some warnings during build phase&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: BT_CTLR_DATA_LENGTH_MAX (defined at
/opt/nordic/ncs/v2.0.0/nrf/subsys/bluetooth/services/fast_pair/Kconfig.fast_pair:83,
/Users/mehdizemzem/nRF53/peripheral_uart_throughput/build/subsys/bluetooth/controller/Kconfig:379) was assigned the value &amp;#39;251&amp;#39; but got the value &amp;#39;&amp;#39;. Check
these unsatisfied dependencies: ((BT_FAST_PAIR_GATT_SERVICE &amp;amp;&amp;amp; BT_FAST_PAIR &amp;amp;&amp;amp; BT) ||
(BT_CTLR_DATA_LENGTH &amp;amp;&amp;amp; BT_CONN &amp;amp;&amp;amp; BT_CTLR &amp;amp;&amp;amp; BT_HCI &amp;amp;&amp;amp; BT)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_CTLR_DATA_LENGTH_MAX and/or look up
BT_CTLR_DATA_LENGTH_MAX in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: BT_SETTINGS (defined at /Users/mehdizemzem/nRF53/peripheral_uart_throughput/build/subsys/bluetooth/host/Kconfig:169,
/Users/mehdizemzem/nRF53/peripheral_uart_throughput/build/subsys/bluetooth/host/Kconfig:169) was assigned the value &amp;#39;y&amp;#39; but got the value &amp;#39;n&amp;#39;. Check these
unsatisfied dependencies: ((SETTINGS &amp;amp;&amp;amp; BT_HCI_HOST &amp;amp;&amp;amp; BT_RPC_STACK) || (SETTINGS &amp;amp;&amp;amp; BT_HCI_HOST &amp;amp;&amp;amp;
BT_HCI &amp;amp;&amp;amp; BT)) (=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_SETTINGS and/or
look up BT_SETTINGS in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: BT_PRIVACY (defined at /Users/mehdizemzem/nRF53/peripheral_uart_throughput/build/subsys/bluetooth/host/Kconfig:322,
/Users/mehdizemzem/nRF53/peripheral_uart_throughput/build/subsys/bluetooth/host/Kconfig:322) was assigned the value &amp;#39;y&amp;#39; but got the value &amp;#39;n&amp;#39;. Check these
unsatisfied dependencies: ((BT_SMP &amp;amp;&amp;amp; BT_CONN &amp;amp;&amp;amp; BT_HCI_HOST &amp;amp;&amp;amp; BT_RPC_STACK) || (BT_SMP &amp;amp;&amp;amp; BT_CONN
&amp;amp;&amp;amp; BT_HCI_HOST &amp;amp;&amp;amp; BT_HCI &amp;amp;&amp;amp; BT)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_PRIVACY and/or look up BT_PRIVACY in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I retested my code with the nRF BLE desktop app and this is the log I have for now:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;14:27:27.705	Scan started
14:27:29.207	Connecting to device
14:27:30.028	Connected to device F6:2B:E4:76:38:34: interval: 7.5ms, timeout: 4000ms, latency: 0
14:27:30.070	Data length updated for device F6:2B:E4:76:38:34, new value is 251
14:27:30.156	Phy updated for device F6:2B:E4:76:38:34, tx: 2 Mb/s, rx: 2 Mb/s
14:27:30.315	Attribute value read, handle: 0x0B, value (0x): 5A-65-70-68-79-72
14:27:34.401	Attribute value changed, handle: 0x13, value (0x): 01-00
14:27:34.407	Attribute value written, handle: 0x13, value (0x): 01-00
14:27:35.078	Connection parameters updated for device F6:2B:E4:76:38:34: interval 12.5ms, timeout 30000ms, latency: 0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Can you recommend another sniffer to use?&lt;/p&gt;
&lt;p&gt;On the bright side, I solved my problem by adding the following functions to my code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int update_connection_parameters(void);
static void request_mtu_exchange(void);
static void request_data_len_update(void);
static void request_phy_update(void);
static void MTU_exchange_cb(struct bt_conn *conn, uint8_t err, struct bt_gatt_exchange_params *params);
static void le_phy_updated(struct bt_conn *conn,
			   struct bt_conn_le_phy_info *param);
static void le_data_length_updated(struct bt_conn *conn,
				   struct bt_conn_le_data_len_info *info);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I suppose that what you said is correct about the ATT MTU negotiations&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correctly set MTU size in Nordic Connect SDK V2.0?</title><link>https://devzone.nordicsemi.com/thread/377842?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 11:48:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:427b7354-793f-45fe-9ed6-74f9b7701089</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mehdi,&amp;nbsp;&lt;br /&gt;You may want to capture a sniffer trace so we get to understand what happens over the air.&amp;nbsp;&lt;br /&gt;I suspect that the ATT MTU negotiation didn&amp;#39;t happen and you don&amp;#39;t have the MTU = 247 so you can&amp;#39;t send the notification of that size.&amp;nbsp;&lt;br /&gt;Note that the throughput example requires the control from both sides. Actually it&amp;#39;s the central that request the ATT MTU update.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have made a blog and an example to test throughput. You can have a look &lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/building-a-bluetooth-application-on-nrf-connect-sdk-part-3-optimizing-the-connection"&gt;here&lt;/a&gt;. The example when act as a peripheral will pro-actively request ATT MTU exchange to increase the MTU.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>