<?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 pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31026/ble-pairing-issues-with-lenovo-x240</link><description>Hi, 
 We have a BLE peripheral device that is used as a mouse/keyboard (nRF52832 SDK 14.0) 
 The peripheral pairs with most central devices just fine (including Mac and PC), except it seems with some models of Lenovo laptops. 
 When attempting to pair</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Mar 2018 06:44:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31026/ble-pairing-issues-with-lenovo-x240" /><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/125263?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 06:44:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2d51e4b-8dad-44ef-8c44-e988fcf1cd2c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You way of adding a timer and letting master do an MTU exchange seems safe. There is nothing i can think of that could cause problems this way.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/124155?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 12:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a665100f-a0e3-486f-9332-8faf7df97a14</guid><dc:creator>ohtap</dc:creator><description>&lt;p&gt;Maybe I phrased it improperly - we&amp;#39;re not using osDelay, instead we&amp;#39;re using osTimer (asynchronous) with a callback to a new function we created inside nrf_ble_gatt.c. There we use&amp;nbsp;&lt;span&gt;sd_ble_gattc_exchange_mtu_request.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately the original suggestion didn&amp;#39;t work,&amp;nbsp;possibly because the next MTU exchange request came too soon after the first one (Slave-&amp;gt;Master). After adding the delay, the sniffer shows the Master initiating the exchange about 1 second after the initial connection, which succeeds.&lt;/p&gt;
&lt;p&gt;Our main concern with the timer we added is some race caused by external events related to the parameters passed to&amp;nbsp;sd_ble_gattc_exchange_mtu_request. Can those parameters change in short time periods?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/124146?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 11:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b1f2301-994d-438e-9fe4-a6d5490d63df</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;on_connected_evt happens in SWI2 interrupt context and adding a synchronous busy delay in any ISR is not recommended (if not forbidden). There will be a lot of side affects to it,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1) no other events will be able to processed during this time. trying to test the softdevice events buffering capacity on a busy link&lt;/p&gt;
&lt;p&gt;2) FreeRTOS tick handler is running on lower priority than SWI2 interrupt. So for 5 seconds, you are not allowing it to update ticks. If you set&amp;nbsp;configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG = 1 in your project, this will make the RTOS timer completely wrong. But if you do not disable autocorrection of internal timers, then the FreeRTOS will try to recover as soon as tick event gets a chance to run.&lt;/p&gt;
&lt;p&gt;Did you try the suggestion I gave? Did it not work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/124132?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 10:49:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c16560-79df-4040-9fba-4fd792dcc12a</guid><dc:creator>ohtap</dc:creator><description>&lt;p&gt;The delay was added&amp;nbsp;in on_connected_evt using a FREERTOS timer.&lt;/p&gt;
&lt;p&gt;After the callback, sd_ble_gattc_exchange_mtu_request uses the connection handle and the desired MTU, so we save those before we start the timer (conn_handle,&amp;nbsp;p_link).&lt;/p&gt;
&lt;p&gt;Any danger of possible races? any external entities changing those parameters?&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 pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/124034?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 19:26:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2968e62a-81ca-4ec7-8d04-98438ab8e60f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;where exactly have you added 5 secs delay? i hope that you did it in thread context and not inside any ISR&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/123884?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 11:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6afddd32-e0fb-417f-8aef-2bfaf9c374aa</guid><dc:creator>ohtap</dc:creator><description>&lt;p&gt;We&amp;#39;ve added a 5 sec delay to the MTU exchange process, it seems it&amp;nbsp;gives the central device enough time to initiate the exchange correctly.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We had to edit nrf_ble_gatt.c (on_connected_evt specifically), so we&amp;#39;re hoping not to introduce new issues. Do you have any recommendations to make sure the rest of the environment wasn&amp;#39;t negatively affected?&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 pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/123421?ContentTypeID=1</link><pubDate>Thu, 08 Mar 2018 12:05:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45980756-d61d-4956-af48-eda764a76dd4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;we can do a small workaround without breaking the state machine of the SDK&lt;/p&gt;
&lt;p&gt;in nrf_ble_gatt.c-&amp;gt;on_connected_evt replace&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        err_code = sd_ble_gattc_exchange_mtu_request(conn_handle, p_link-&amp;gt;att_mtu_desired);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;with&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        // err_code = sd_ble_gattc_exchange_mtu_request(conn_handle, p_link-&amp;gt;att_mtu_desired);
        err_code = NRF_ERROR_BUSY;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This will tell the module to retry it after sometime (after getting new ble event). This should work fine in your case.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/123243?ContentTypeID=1</link><pubDate>Wed, 07 Mar 2018 12:42:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b928a4e-6a3b-4f21-a5dd-261db311f9a5</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Any recommend way to postpone the MTU exchange?&lt;br /&gt;I don&amp;#39;t want to break the SDK&amp;#39;s internal state machine, which I&amp;#39;m guessing that exists and depends on MTU exchange triggering.&lt;/p&gt;
&lt;p&gt;We&amp;#39;re using S132, SDK 14.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/123207?ContentTypeID=1</link><pubDate>Wed, 07 Mar 2018 10:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be762f49-7b58-4805-b0e6-9eb9b96afb5a</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi, Looking at the logs I can&amp;#39;t find anything showing that the softdevice doesn&amp;#39;t behave as expected.From&amp;nbsp;your description it seems to be an issue with the internal state machine of the driver/link layer in the Lenovo in this case. My recommendation is to&amp;nbsp; delay the MTU exchange request initiated by the peripheral (for instance add a 5second delay after connection is established before requesting an MTU exchange, in case it has not yet been updated.)&amp;nbsp;Or instead of a fixed delay, you may trigger the MTU exchange after notifications (cccd) handles have been executed. In general I have seen a few issues using long MTU, they have been caused by central device does not always properly handle an MTU exchange shortly after connection established.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/122884?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 15:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36c4439c-1262-4026-96cc-cd66139cfa8e</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;Also, this issue is reproducible with example HID projects when increasing the ATT MTU to higher than 23.&lt;/p&gt;
&lt;p&gt;Further checking that with reducing ATT MTU to 23, the above Lenovo is able to pair successfully with our device.&lt;br /&gt;Was this experienced ever?&amp;nbsp;Could&amp;nbsp;the SoftDevice be exchanging MTU incorrectly?&lt;/p&gt;
&lt;p&gt;We need the higher MTU for part of our application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/122818?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 12:45:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39310b3d-2649-4146-8028-bbdc604682e7</guid><dc:creator>gkovelman_tap</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/htc_5F00_m9_5F00_pairing_5F00_1.pcapng"&gt;devzone.nordicsemi.com/.../htc_5F00_m9_5F00_pairing_5F00_1.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/lenovo_5F00_x240_5F00_pairing_5F00_2.pcapng"&gt;devzone.nordicsemi.com/.../lenovo_5F00_x240_5F00_pairing_5F00_2.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The attached session in the opening&amp;nbsp;question is of a failed connection with the Lenovo.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m attaching two more sessions. Sorry for not trimming them.&lt;/p&gt;
&lt;p&gt;One, where the connection succeeds, is with an HTC M9 phone. Connection is from time index 1284.&lt;br /&gt;Second, where the connection fails, is with the same lenovo laptop. Connection is from time index 8766.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m seeing these differences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bonding: Lenovo is&amp;#39;s Initiator Key(s) list is only CSRK and HTC&amp;#39;s is LTK, IRK, CSRK, Linkkey and slave is responding with none&lt;/li&gt;
&lt;li&gt;MTU: Lenovo is not accepting MTU exchange request from the&amp;nbsp;slave but initiating it&amp;#39;s own (with MTU 525).&lt;/li&gt;
&lt;li&gt;Termination: the Lenovo sent LL_TERMINATE_ID after service discovery, before reading encrypted characteristics.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE pairing issues with Lenovo X240</title><link>https://devzone.nordicsemi.com/thread/122744?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 08:12:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5438b9d-851c-4747-98b3-2e4fdbae6888</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;It is really hard to say what went wrong with the information provided. Have you tried taking a sniffer log and see of few phones are doing something differently in air which is not compatible with the BLE spec. If you attach a sniffer log when trying to pair with Lenovo (or devices that does not pair), then we will try to narrow it down.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>