nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Incompatibility between mcumgr cli and hci_usb when running with BT_LL_SOFTDEVICE enabled

Hello everyone,

I'm dealing with mcumgr-cli to exchange commands between a host machine (running Ubuntu 20.04 LTS) and a NRF52833 DK running smp_svr sample. I'm using NCS V1.5.0

In the host machine, I'm using a NRF52840 Dongle running hci_usb sample as an adapter (hci0). I see the .config file opted for using the Softdevice as the Controller side of the stack (CONFIG_BT_LL_SOFTDEVICE=y).

When I run mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name=Zephyr echo hello, the command fails displaying the following message:

The curious thing comes now: if I build the hci_usb sample using Zephyr's BLE Controller Stack (CONFIG_BT_LL_SW_SPLIT=y) and load it in the dongle, then the command executes successfully:

I'm attaching the hci trace for both cases (with hci_usb running on CONFIG_BT_LL_SOFTDEVICE and when running on CONFIG_BT_LL_SW_SPLIT), captured with btmon.

As a reference, my setup has go1.16.2 and mcumgr 0.0.0-dev.

Could you provide some guidance on why this occurs and if there are any settings I could configure to have compatibility between the hci_usb sample w/ softdevice ctlr stack and the mcumgr tool?

Best regards,

Luis.

Parents
  • Hi again, Luis!

    The issue is that mcumgr doesn't set an address for the host before scanning. The Softdevice Controller checks the address and throws an error as it's invalid, while the Zephyr LL does not. Hence, the host starts scanning with an invalid address.

    We're awaiting more comments on how this could be handled, but a temporary workaround is to set the address in hci_usb directly. You can see how this is done in this pull request for hci_uart. Note that this code sets a public address, which is something you have to pay for. If you want to avoid this you could try to change the code to set a random address instead.

    Best regards,
    Carl Richard

Reply
  • Hi again, Luis!

    The issue is that mcumgr doesn't set an address for the host before scanning. The Softdevice Controller checks the address and throws an error as it's invalid, while the Zephyr LL does not. Hence, the host starts scanning with an invalid address.

    We're awaiting more comments on how this could be handled, but a temporary workaround is to set the address in hci_usb directly. You can see how this is done in this pull request for hci_uart. Note that this code sets a public address, which is something you have to pay for. If you want to avoid this you could try to change the code to set a random address instead.

    Best regards,
    Carl Richard

Children
Related