Adding BLE multiprotocol to my OT coProcessor NCP app

I'm using nRF Connect SDK v2.1.2 with Visual Studio Code and a nrf52840DK.

I have implemented this app (OpenThread CoProcessor NCP from Zephyr) and it is working correctly. Now I need to add BLE protocol so I checked that the multiprotocol was activated:

I activated the BLE protocol broadcaster:

My problem is when I flash into de board and I cant see the device advertising.

I checked the main.c and this file didnt changed, is the same file as it was before adding BLE.

Should I add the initialization manually? How? 

On the other hand, is this BLE multiprotocol acting like NCP or RCP? Should I communicate with the coProcessor from my host via HCI (If it is RCP) or UART (If it is NCP)? How can I configure it as NCP/RCP?

Parents
  • Hello,

    The Thread: CoAP Client sample demonstrates how you can enable multiprotocol support with Thread and BLE so it should be a good starting point. 

    Building sample with BLE in VS code: 

    Should I add the initialization manually? How? 

    Yes, the BLE stack needs to be enabled from the application. It also needs to configure and start the advertiser like how it's done in the sample here: https://github.com/nrfconnect/sdk-nrf/blob/main/samples/openthread/coap_client/src/ble_utils.c#L136 

    Note: while building the sample here I noticed that the project is referencing a file in the nRF repo using an absolute path, which will cause the build to fail if you change the project path. To fix this, you can replace this line in /coap_client/CMakelist.txt:

    target_include_directories(app PUBLIC ../coap_server/interface)
    with this:
    target_include_directories(app PUBLIC $ENV{ZEPHYR_BASE}/../nrf/samples/openthread/coap_server/interface)
    On the other hand, is this BLE multiprotocol acting like NCP or RCP? Should I communicate with the coProcessor from my host via HCI (If it is RCP) or UART (If it is NCP)? How can I configure it as NCP/RCP?

    Can you say something about your setup and what you want to achieve? E.g. is the NCP part going to be connected to a boarder router, etc? Depending on your requirements, it might be easiest to run Thread/BLE on the nRF as a standalone application and expose a more simplified control interface to the host. 

    Best regards,

    Vidar

  • Hello Vidar,

    I have added the next kconfig fragment in my project:

    And checked every options in "nRF KConfig (build)" that are checked in the coap example about BLE.

    But when I try to compile It shows that the define "CONFIG_BT_NUS" is not defined:

    I see it is defined in the kconfig fragment added:

    ¿Why is it not being defined?

  • Exactly. My main question is why I cant find this settings "CONFIG_BLE_UTILS_LOG_LEVEL" or "CONFIG_BLE_UTILS_LOG_LEVEL_DBG" in my kconfig build but it is in the kconfig build from the original project. It is due to the zephyr version? Both projects are using the same zephyr versions because I selected the ncs directory when I configured VS code at the beginning.

  • First you need to make sure you have added the same Kconfig configurations in your prj.conf file as in the reference sample.

  • Exactly, I added the next kconfig fragment to my personal project as the original project does:

    This file include the define i want:

    But when I try to compile, the next error appear:

  • I see. The error is that it can't find the logging symbol. Likely because you are missing the /samples/openthread/coap_client/Kconfig file in your project.

  • How could I add it to my project? I know hot to add kconfig fragments (.conf files) to my project, but not a Kconfig file.

Reply Children