Replace Zephyr BLE stack with NCS BLE

I have very advanced project based on nrf52840dk for dev and custom boards for prod.

The development environment is based on zephyr build dockers. Zephyr is 3.5.0.

I would need to change the Zephyr BLE stack into NCS one (NCS is not currently used or installed in project).

Most tutorials describe how to create vanilla projects or assume NCS is installed.

What would be the easiest way to incorporate NCS BLE into existing project? 

Parents Reply Children
  • Hi. Thanks for reaching out. Of course I cannot afford this way. We have an ongoing product development setup which is quite significantly customized to our needs. I need to find a way to integrate NCS or at least its BLE stack on top of existing zephyr 3.5.0. So far I combined manifests to pull nrf and nrfxlib repos as I think both will be needed.

    We are using only below includes.

    #include <zephyr/bluetooth/bluetooth.h>
    #include <zephyr/bluetooth/hci.h>
    #include <zephyr/bluetooth/conn.h>
    #include <zephyr/bluetooth/uuid.h>
    #include <zephyr/bluetooth/gatt.h>

    I think I would need to replace LL with Softdevice and then do some magic in cmake files to set proper constants (which one) and pull NCS sources when needed. The difficulty also lies that I do not understand fully to what extend NCS BLE and Zephyr BLE are interconnected. In different words what parts of BLE stack I need to replace with NCS counterpart?

    Any help with above would be welcome.

  • One thing to note is that the QDID will not be valid if you morph the "BLE stack" in to Zephyr and want to use SDC. The host QDID is ONLY valid for the nRF Connect SDK tag used.

    If you wants to use the softdevice controller with upstream zephyr you will have to copy the hci driver in sdk-nrf/subsys/bluetooth/controller and link with the correct library from nrfxlib. 

  • Thanks again. I managed to run it with changed hci.

    What does CONFIG_BT_LL_SOFTDEVICE does? I do not see much difference whether it is set to 'n' or 'y'. In both cases there are quite many references to /nrfxlib/softdevice_controller in zephyr.map

    The host QDID is ONLY valid for the nRF Connect SDK tag used.

    QDID is one of the reasons I wanted to change stacks in the first place. I can also try to include full NCS on top of current Zephyr. Would that solve QDID problem?

  • Michal Piekos said:
    QDID is one of the reasons I wanted to change stacks in the first place.

    Currently the only way to use the QDID is to work from NCS tag, so if that is what you want then that is currently what you will have to do. 


    Michal Piekos said:
    . I can also try to include full NCS on top of current Zephyr.

    NCS is based on Zephyr so that would leave you with two Zephyr instances. 



    Michal Piekos said:
    What does CONFIG_BT_LL_SOFTDEVICE does?

    Kconfig search — Kconfig reference (nordicsemi.com) , info on it can be found here https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/protocols/ble/index.html 

    Regards,
    Jonathan

Related