This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Beacon using seperate host and controller

Hi, I am using nRF Connect SDK 14.0 with nRF9160 DK.

I want to use nRF52840  as a controller and nRF9160 as host. To achieve this, I flashed hci_uart sample on  nRF52840 and it started running fine. Then flashed beacon example to nRF9160 but it fails with the following messages in debug console 

Starting Beacon Demo

[00:00:00.014,343] [1B][1;31m<err> bt_hci_core: No HCI driver registered[1B][0m
Bluetooth init failed (err -19)

How can I configure it to achieve my goal of using seperate host and controller?

Thanks in advance.

  • Hi!

    You will need to modify the Beacon example to use a separate device as the Bluetooth Controller.

    You at least need the configuration CONFIG_BT_H4, which specifies the Bluetooth HCI Driver you're using. This will require the UART hardware flow control lines to be available, so check that as well. CONFIG_SERIAL will need to be enabled as well. 

    Optionally CONFIG_BT_WAIT_NOP if you want to be notified when the Controller is initialized.

    Let me know how it goes.

    Best regards,

    Heidi

  • CONFIG_BT_H4 and CONFIG_SERIAL were already in the active state.

    I could not find any configuration about UART hardware flow, but RTS and CTS were defined in either of the boards .dts files. And since I can see reading outputs nRF52840 using LTE Sensor Gateway example which includes hci_lpuart and lte_ble_gateway samples, I assumed RTS and CTS are connected on hardware level. 

    I added CONFIG_BT_WAIT_NOP but it still gives the same error.

  • Hi! That's interesting. I am seeing the same error as you, that the driver isn't registered. I am currently looking into it and asking some of the developers, and I'll update you when I have more information. 

    Best regards,

    Heidi

  • Hi again!

    So, I was able to get past the driver error by doing these modifications.

    In beacon/boards I added an overlay file "nrf9160dk_nrf9160ns.overlay" that I took from the LTE BLE Gateway sample (nrf/samples/nrf9160/lte_ble_gateway/boards/nrf9160dk_nrf9160ns.overlay)

    and I added these configurations to the prj.conf file:

    CONFIG_BT_H4=y
    CONFIG_BT_HCI=y
    
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_GATT_DM=y
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    
      
    CONFIG_NRF_SW_LPUART=y
    CONFIG_NRF_SW_LPUART_INT_DRIVEN=y
    
    CONFIG_UART_2_ASYNC=y
    CONFIG_UART_2_INTERRUPT_DRIVEN=n
    CONFIG_UART_2_NRF_HW_ASYNC=y
    CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2

    They are taken from the prj.conf file and boards/nrf9160dk_nrf9160ns.conf file in the LTE Sensor gateway sample. It's possible that not all of them are necessary. 

    To set up UART2 as non-secure, add the following configuration to a file called "child_secure_partition_manager.conf". 

    CONFIG_SPM_NRF_UARTE2_NS=y

    Then add this to the CMakeLists.txt file, right under cmake_minimum_required.

    set(spm_CONF_FILE
      prj.conf
      ${CMAKE_CURRENT_LIST_DIR}/child_secure_partition_manager.conf
      )
    

    Best regards,

    Heidi

Related