Distance Measurement under BLE Secure Connection

We have been fighting with the Distance Measurement Toolkit for a while (see other ticket  Assert error when Coded PHY is used for BLE NUS ).

As we needed to move forward, we started the implementation of LE Secure Connection (Numeric Comparisson). We have a working version of our firmware that establishes L4 Security level.

Our problem is now that after the establishment of L4, we cannot get Distance Measurement to work (we start the Advertising and Scanning, but the DataReady callback never gets called, and we see a lot of errors when the dm_request_add returns -EBUSY. In the above mentioned ticket, we are having an assert, but we are at least getting initial measurements. Now with LE SC we have not been able to get at least one measurement from the DM. So our main question would be:

Q1: Is there any theoretical incompatibility between the Distance Measurement Toolkit and BLE Secure Connection Authenticated+Encrypted?

For reference, we have the same problem in SDK v2.8.0, v2.9.0, v2.9.1. We saw that there is a recent v3.0.0, but project is not even compiling in that version, so we are for now focusing on v2.8+

Thanks in advance for any clarification that helps us focus our efforts efficiently.

Kind regards


Javier Reyes

  • Hi, first of all, thank you for the confirmation that the DM would not work with LESC.

    I am still trying to understand how the connection manager understands the callbacks registered to the bt_conn_auth_cb structur. For now, we have only provided the following:

    • passkey_display
    • passkey_confirm
    • cancel

    If I try to request a security level other than L4 (for example L3 or L2) with my current callback setup, still the pairing process seem to report the L4 level after I confirm the passkey. Does that mean that the call to bt_conn_set_security(app_current_conn, BT_SECURITY_L2) will not actually trigger an L2 pairing process? Or how can I try to trigger a L2 or L3 only? What callbacks need to be present/absent? Is there any kind of guide that DIRECTLY indicates which callbacks determine which security level? The only information I have seen are tables in the DevAcademy, which only show the theory, but not a direct setup of the callbacks. The comments on the conn.h headers are also not clear about the relation between the callbacks and the security level...

    Thanks in advance for any guidance on the matter.

  • Hi Javier

    Sorry, but the user with the initial reply here seems to be a bot that included a link to a spam page. 

    The fix to the problem reported in your previous ticket was fixed as of NCS 3.0.0, as per the following pull request: https://github.com/nrfconnect/sdk-nrf/pull/21388/files#r2039064589 

    I just tried building the nrf_dm sample project on my end for NCS 3.0.0, and that seems to build just fine. What kind of compilation errors are you seeing on your end. DId you make sure to follow the migration notes (https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_guide_3.0.html) in the nRF Connect SDK when moving from NCS 2.8.x to 3.0.0? 

    Best regards,

    Simon

  • Hi, we got really confused in regard to that eliminated response. It seemed like a valid response, but it got deleted, as well as our reply there. Perhaps was a false positive? It didnt look like spam to us.

    So, to be clear on what you are saying: the error that was fixed in the SDK v3.0.0 is related to the assert on Distance Measurement? Or related to this ticket regarding Secure Connection L4 with Distance Measurement?

    Our build errors on v3.0.0 seem to be related to the definition of our custom board. As the sysbuild and HWMv2 documentation are rather difficult to follow, it might be a problem on our side, but we have not yet given it much thought, as the SDK version selected for tests has been v2.8.0.

  • Just for reference, here is the content (minus the hidden link) from the deleted reply in case it was in fact helpful:

    "There is currently a known incompatibility between the Distance Measurement (DM) Toolkit and LE Secure Connections (L4 security level) in the Nordic SDK (including v2.8.x–2.9.1). The DM feature is designed to operate with unencrypted or L2-level connections, and enabling L4 (Authenticated + Encrypted) may block the DM process, causing dm_request_add() to return -EBUSY and the DataReady callback to never trigger. Recommendation: Test with a lower security level (L2 or L3) to confirm DM works. Nordic may add support in a future SDK, so monitor changelogs (v3.0.0+)."

    I can not find a mention in our documentation with any issues with LESC + Distance Measurement Toolkit though, which is why I just removed it.

    As for your previous ticket (the assert error when Coded PHY is used for BLE NUS). It was not a fix, but a "known issue" that was added in the 3.0.0 documentation. Sorry about the confusion.

    Please also check out the migration guide from multi-image builds to sysbuild if you're moving to sysbuild from the old build setup: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_sysbuild.html 

    Best regards,

    Simon

Related