DevAcademy Bluetooth LE connection problems

Hi,

I am going through the DevAcademy Bluetooth LE lessons, using nRF5 DK. But I run into problems directly in the exercise of the first lesson. Everything goes fine to step 4.2, but connecting doesn’t work. Connection is established, but almost immediately disconnection happens. LED2 is lit for a short moment. The print outs are like this:

No matter how many times I try, disconnection always happens this way. I have also tested to connect via the Bluetooth low energy desktop app using the Nordic BLE dongle. Then the connection works fine. I have tested with both nRF Connect SDK 2.3.0 and 2.0.0, and the scenario is the same for both versions.

In the desktop app it is possible to read the button state and activate notifications (and receive updates when the button is pressed). But I am not able to control LED3. I have put a breakpoint in write_led() in lbs.c (C:\...\v2.3.0\nrf\subsys\bluetooth\services\lbs.c), but the breakpoint isn't hit when I write to the LED characteristic. Though, a breakpoint in read_button() will be hit when I click "Nordic LED and Button Service", so I should be in the correct file.

 

Best regards,

Lars

  • The way it doesn't follow the standard has to do with the timing and sequencing of these update procedures.

    In this specific case, LL_CONNECTION_UPDATE_IND is a procedure that takes several BLE events to complete, but when the phone receives the LL_PHY_REQ from the peripheral it responds to this immediately instead of waiting for LL_CONNECTION_UPDATE_IND to complete first. That's where it violates the specification.

    The phones that are affected are the ones with the same Broadcom Bluetooth controller chipset as your Samsung phone. Possibly devices other than Samsung with the same chipset also.

    This firmware bug has actually been fixed by Broadcom, but Samsung has yet to push this fix to their phones.

    -Einar

  • Thanks a lot Einar for your help! This makes sense.

    I try to find the name of the chipset, but I'm not sure if I'm successful. Do you know if it is BCM4389? It seems to be for the Ultra-version of S21, but maybe it's also for the one just named S21 (SM-G991B/DS).

    /Lars

  • I have also stumbled into this issue with a Samsung 21. Works fine with a Sony Experia.

    I have tried Lars approach of setting: 

    CONFIG_BT_PHY_UPDATE=n
    But to no avail. I got the same behaviour on the Samsung regardless.
    But alas, removing the bond and restarting the phone makes it work!
    Hopefully this can save someone else some time...
  • This might be worth mentioning in the excersice FAQ as the Samsung S21 is a rather common device.

    Any knowledge if this is resolved in later bt-stacks from Samsung?

  • Just to add another data point, on a Samsung Note20,I was seeing the immediate disconnect too:

    [00:01:36.259,674] <inf> Lesson3_Exercise1: Connected
    [00:01:36.637,481] <inf> Lesson3_Exercise1: Disconnected. Reason 42

    On a 2nd phone (Samsung S24 Ultra), it did stay connected once, but then stopped.

    I rebooted both phones and now all is working fine.

Related