This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE pairing issues with Lenovo X240

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 with the X240 model (Windows 10) , we get "Driver error" on the Bluetooth menu. Pairing with an example Nordic keyboard seems to work fine. The problem is reproduced with different 53832 boards.

Sniffing yields the results in the attached file.

We tried updating the drivers and disabling/enabling the Bluetooth device (via Device Manager) but it only fixes the issue once every few dozen attempts. When it actually manages to pair, it works just fine, but getting there is a problem. The "fix" itself is also temporary and has to be done again if the device is unpaired.

We're not sure if it's an issue with our app or some issues with the drivers. Would appreciate help.

Thanks.

Pairing with x240.pcapng

Parents Reply
  • 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, 

    1) no other events will be able to processed during this time. trying to test the softdevice events buffering capacity on a busy link

    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 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.

    Did you try the suggestion I gave? Did it not work?

Children
  • Maybe I phrased it improperly - we're not using osDelay, instead we're using osTimer (asynchronous) with a callback to a new function we created inside nrf_ble_gatt.c. There we use sd_ble_gattc_exchange_mtu_request.

    Unfortunately the original suggestion didn't work, possibly because the next MTU exchange request came too soon after the first one (Slave->Master). After adding the delay, the sniffer shows the Master initiating the exchange about 1 second after the initial connection, which succeeds.

    Our main concern with the timer we added is some race caused by external events related to the parameters passed to sd_ble_gattc_exchange_mtu_request. Can those parameters change in short time periods?

  • 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. 

Related