<?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 exchange leads to LMP error if sd_ble_gap_data_length_update is called</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36665/mtu-exchange-leads-to-lmp-error-if-sd_ble_gap_data_length_update-is-called</link><description>Hello, 
 we are facing a weird issue with a few models of smartphone since we increased the max MTU size. We are testing at the office with the Xperia E6553 but the Samsung Galaxy S5 Neo from one of our customers may also suffer from the same bug. After</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Aug 2018 13:57:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36665/mtu-exchange-leads-to-lmp-error-if-sd_ble_gap_data_length_update-is-called" /><item><title>RE: MTU exchange leads to LMP error if sd_ble_gap_data_length_update is called</title><link>https://devzone.nordicsemi.com/thread/142643?ContentTypeID=1</link><pubDate>Thu, 02 Aug 2018 13:57:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b235b81-0736-4889-a386-3e50b89b1029</guid><dc:creator>Cyril</dc:creator><description>&lt;p&gt;Thank you Bjorn for the clarification. That makes sense.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We are not sending LL_LENGTH_REQ anymore&amp;nbsp;and there is no LL_LENGTH_REQ from the peer &lt;strong&gt;when using the Sony&amp;nbsp;&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;Xperia E6553&lt;/strong&gt;. &lt;br /&gt;I do have&amp;nbsp;the request from master using&amp;nbsp;another phone&amp;nbsp;though (One Plus 3T) with RX and TX time set to 1096us, and the nRF stack is responding as expected.&lt;br /&gt;Despite that, I can transfer packets with higher MTU using the Sony smartphone anyway... which shouldn&amp;#39;t be possible (as far as the LE Data Packet Length Extension is not supported).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How&amp;nbsp;can we know that the data length exchange is required or not?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Cyril&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU exchange leads to LMP error if sd_ble_gap_data_length_update is called</title><link>https://devzone.nordicsemi.com/thread/142329?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 08:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43d135ca-34f6-4566-8897-144c23c2f977</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Cyril,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I apologize for the delayed reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is the&amp;nbsp;BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS printed in the debug log output from the nRF52832? And is you application peripheral only or a combined central and peripheral?&lt;/p&gt;
&lt;p&gt;From the trace I found the following:&lt;/p&gt;
&lt;p&gt;The nRF52832 is issuing a LL_LENGTH_REQ with the following parameters&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Max RX Octets:&amp;nbsp; 127&lt;/li&gt;
&lt;li&gt;Max RX Time:&amp;nbsp; &amp;nbsp; &amp;nbsp;1128us&lt;/li&gt;
&lt;li&gt;Max TX Octets:&amp;nbsp; 127&lt;/li&gt;
&lt;li&gt;Max TX Time:&amp;nbsp; &amp;nbsp; 1128us&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;the link master replies with a LL_LENGTH_RSP&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Max RX Octets:&amp;nbsp;&amp;nbsp;140&lt;/li&gt;
&lt;li&gt;Max RX Time:&amp;nbsp; &amp;nbsp; &amp;nbsp;256us&lt;/li&gt;
&lt;li&gt;Max TX Octets:&amp;nbsp; 770&lt;/li&gt;
&lt;li&gt;Max TX Time:&amp;nbsp; &amp;nbsp; 1284us&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;According to the BLUETOOTH SPECIFICATION Version 5.0 | Vol 6, Part B, Section 2.4.2.21 LL_LENGTH_REQ and LL_LENGTH_RSP, the following rules apply:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MaxRxOctets shall be set to the sender’s connMaxRxOctets value, as&lt;br /&gt;defined in Section 4.5.10. The MaxRxOctets field shall have a value not less&lt;br /&gt;than 27 octets.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;MaxRxTime shall be set to the sender’s connMaxRxTime value, as defined&lt;br /&gt;in Section 4.5.10. The MaxRxTime field shall have a value not less than 328&lt;br /&gt;microseconds.&lt;/li&gt;
&lt;li&gt;MaxTxOctets shall be set to the sender’s connMaxTxOctets value, as&lt;br /&gt;defined in Section 4.5.10. The MaxTxOctets field shall have a value not less&lt;br /&gt;than 27 octets.&lt;/li&gt;
&lt;li&gt;MaxTxTime shall be set to the sender’s connMaxTxTime value, as defined&lt;br /&gt;in Section 4.5.10. The MaxTxTime field shall have a value not less than 328&lt;br /&gt;microseconds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hence, it appears that the Link master is passing an invalid value in its&amp;nbsp;LL_LENGTH_RSP, i.e.&amp;nbsp;Max RX Time: 256us &amp;lt; 328us.&amp;nbsp; However, it is wierd that the Link Master replies with these values at all because in the LL_FEATURE_REQ from the Master to the Slave it states that it does &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/span&gt; support&amp;nbsp;&amp;nbsp;LE Data Packet Length Extension.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We cant do much about the invalid LL_LENGTH_RSP from the peer, but modifying the code so that&amp;nbsp; &amp;nbsp;LL_LENGTH_REQ is sent not sent by the nRF52832 should be OK, the nRF52832 will still reply to LL_LENGTH_REQ from centrals. The con is that you will not be able to use the increased payload size unless the central initiates the&amp;nbsp;LL_LENGTH_REQ.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU exchange leads to LMP error if sd_ble_gap_data_length_update is called</title><link>https://devzone.nordicsemi.com/thread/141394?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 15:54:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b71d2e15-c5b5-4c02-bbaf-2f2f63fec5a2</guid><dc:creator>Cyril</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes you&amp;#39;re right, I removed the call to&amp;nbsp;data_length_update(conn_handle, p_gatt);&lt;/p&gt;
&lt;p&gt;Here&amp;nbsp;is the GATT information before trying to update data_length:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1532532033278v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No error code is returned by&amp;nbsp;sd_ble_gap_data_length_update.&lt;/p&gt;
&lt;p&gt;Here is the Wireshark trace using the Sony Xperia E6553, Android 7.1.1&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/connection_5F00_fail.pcapng"&gt;devzone.nordicsemi.com/.../connection_5F00_fail.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you have an idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MTU exchange leads to LMP error if sd_ble_gap_data_length_update is called</title><link>https://devzone.nordicsemi.com/thread/141373?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 15:07:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72f97aea-555c-4940-85f9-b6cf9ed59c98</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI Cyril,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;just to make sure I understand the changes you have done in&amp;nbsp;nrf_ble_gatt.c . Is it so that you commented out the following snippet in&amp;nbsp;on_connected_evt()&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Send a data length update request if necessary.
if (p_link-&amp;gt;data_length_desired &amp;gt; p_link-&amp;gt;data_length_effective)
{
    data_length_update(conn_handle, p_gatt);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;which is called when the BLE_GAP_EVT_CONNECTED is received? If so, did you examine the the&amp;nbsp;data_length_desired and&amp;nbsp;data_length_effective variables that is checked in a debug session? Does&amp;nbsp;sd_ble_gap_data_length_update return anything else than&amp;nbsp;NRF_SUCCESS?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It would also be helpful if you could capture a sniffer trace when the&amp;nbsp;sd_ble_gap_data_length_update call is included in the application code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>