<?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>BLE Notifications and MTU Negotiation on Bluetooth 4.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68320/ble-notifications-and-mtu-negotiation-on-bluetooth-4-0</link><description>I&amp;#39;ve managed to successfully increase BLE MTU Size and Data Length on a 52840 to 247 and 251 respectively. 
 This works fine with BLE Notifications on a recent MacBook Pro with Bluetooth 4.2 (it negotiates to 247 and 251) and I can transfer 244 bytes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Nov 2020 11:26:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68320/ble-notifications-and-mtu-negotiation-on-bluetooth-4-0" /><item><title>RE: BLE Notifications and MTU Negotiation on Bluetooth 4.0</title><link>https://devzone.nordicsemi.com/thread/280078?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 11:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50566fcc-989e-4a82-89ad-0406473e283f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It&amp;#39;s interesting that the hardfault appears occur inside the Softdevice, not sure if actually I&amp;#39;ve seen it before (except for internal SD assertions that makes it trigger it on purpose). Anyway. As you suspected, &lt;span&gt;BLE_GATT_ATT_MTU_DEFAULT is not supposed to be modified. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Would it be possible for you to test the same with the SDK ble_app_uart example? This is one of the SDK examples which is set up to request 247 bytes for the MTU and 251 for data length by default.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Notifications and MTU Negotiation on Bluetooth 4.0</title><link>https://devzone.nordicsemi.com/thread/279988?ContentTypeID=1</link><pubDate>Sat, 14 Nov 2020 00:02:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acad586c-f477-48b7-b0ce-d82099c92e99</guid><dc:creator>clell</dc:creator><description>&lt;p&gt;it does appear that changing&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT to a value other than 23,&amp;nbsp;causes issues with MTU negotiation if the client cannot handle the maximum MTU size requested and replies with a smaller value, this can be found in &amp;quot;on_exchange_mtu_request_evt&amp;quot; in &amp;quot;nrf_ble_gatt.c&amp;quot;:&lt;/p&gt;
&lt;p&gt;client_mtu = MAX(client_mtu, BLE_GATT_ATT_MTU_DEFAULT);&lt;/p&gt;
&lt;p&gt;This can be changed from MAX to MIN for a workaround to solve this.&lt;/p&gt;
&lt;p&gt;But I suspect that maybe&amp;nbsp;&lt;span&gt;BLE_GATT_ATT_MTU_DEFAULT should be left at 23 when increasing MTU size (however in my case that causes&amp;nbsp;this&amp;nbsp; hard fault on negotiation).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Q. So when changing NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 247, should&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT be changed to match ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And if not, then any ideas why if&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE is raised, and&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT is kept at 23, this happens in &amp;quot;sd_ble_gattc_exchange_mtu_request&amp;quot; in &amp;quot;nrf_ble_gatt.c&amp;quot; with all bluetooth clients (including 4.2) ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img class="align-left" style="float:left;" alt=" " src="https://i.ibb.co/hBCL2LJ/Screen-Shot-2020-11-13-at-12-25-22-PM.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Notifications and MTU Negotiation on Bluetooth 4.0</title><link>https://devzone.nordicsemi.com/thread/279978?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2020 19:29:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a13dbac5-4181-4dcd-90c2-657911580d8c</guid><dc:creator>clell</dc:creator><description>&lt;p&gt;Thanks for the fast reply. &amp;nbsp;That explains a), and i&amp;#39;ve found out that OSX is limiting and sending a smaller MTU of 104 bytes, however the&amp;nbsp;sdk receives it and sets to 247 anyway.&lt;/p&gt;
&lt;p&gt;Console log on Mac OSX:&lt;/p&gt;
&lt;p&gt;&lt;img class="align-left" style="float:left;" alt=" " src="https://devzone.nordicsemi.com/Users/zawie/Desktop/console1.png" /&gt;&lt;img alt=" " src="https://i.ibb.co/MZgYLDg/console1.png" /&gt;&lt;/p&gt;
&lt;p&gt;App log:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://i.ibb.co/kgcp4Mz/Screen-Shot-2020-11-13-at-11-51-29-AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could this have anything to do with setting:&lt;/p&gt;
&lt;p&gt;#define BLE_GATT_ATT_MTU_DEFAULT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_SDH_BLE_GATT_MAX_MTU_SIZE&amp;nbsp; &amp;nbsp;(which is 247)&lt;/p&gt;
&lt;p&gt;in ble_gatt.h ?&amp;nbsp; I.E. does BLE_GATT_ATT_MTU_DEFAULT ignore what central sends as the MTU and force the negotiation to&amp;nbsp;&lt;span&gt;BLE_GATT_ATT_MTU_DEFAULT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I had to change&amp;nbsp;&lt;span&gt;BLE_GATT_ATT_MTU_DEFAULT from 23 to get larger mtu&amp;#39;s, otherwise I was getting a&lt;/span&gt;&amp;nbsp;hard fault in&amp;nbsp;sd_ble_gattc_exchange_mtu_request when&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE was &amp;gt; 23 and BLE_GATT_MTU_DEFAULT was&lt;/span&gt;&amp;nbsp;23.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;RAM_START is correct btw, I have some code in there to refuse to run and error when it&amp;#39;s not correct for the settings.&lt;/p&gt;
&lt;p&gt;SDK16.0.0 S140 7.0.1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Notifications and MTU Negotiation on Bluetooth 4.0</title><link>https://devzone.nordicsemi.com/thread/279932?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2020 14:07:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:671ea6e5-026c-4820-833e-8ac2ae97cb86</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;a) Yes, the specification does not limit it to 23 bytes. The max. ATT MTU size implementation specific and thus dependent on the device you are connected to. Some 4.0 devices support long MTUs while others only support the default length (23 bytes). The same applies to newer devices. There is for instance no guarantee that a new Bluetooth 5.2 device will support long att MTU. &lt;/p&gt;
&lt;p&gt;Data length extension was however not supported in v4.0 of the specification, that was introduced in v4.2&lt;/p&gt;
&lt;p&gt;b) I&amp;#39;m afraid this doesn&amp;#39;t make sense to me either, it should not be possible. Is the notification sent from the nRF52840? In that case, could you maybe show the implementation of your send function? A sniffer trace may also be helpful (&lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;c) There isn&amp;#39;t any easy way for the app to determine what BT version the peer device is running.&lt;/p&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>