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

Problems adding Bluetooth LE support to Azure IoT hub sample.

I'm using the Azure Iot hub example a base for a new project I'm working on.

I've copied the example into its own folder, and can run it and connect my Azure IoT hub.

So far so good.

Next I want to add bluetooth support to this project, so that I can send Bluetooth LE sensor data to the hub.

I've had a look into the LTE gateway example, and copied the CONFIG_BT stuff into my own prj.conf file.

Initially I had problems with the HCI driver, but that seems to be resolved.

When I run my program I get an error at runtime:

ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:307
k_sem_take failed with err -11
[00:00:12.785,217] [1;31m<err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000001[0m
[00:00:12.785,247] [1;31m<err> os: r3/a4: 0x00012e8d r12/ip: 0x00001000 r14/lr: 0x00015e7d[0m
[00:00:12.785,247] [1;31m<err> os: xpsr: 0x41000000[0m
[00:00:12.785,247] [1;31m<err> os: Faulting instruction address (r15/pc): 0x00015e88[0m
[00:00:12.785,247] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0[0m
[00:00:12.785,247] [1;31m<err> os: Current thread: 0x20015600 (unknown)[0m

(This also happens if I comment out all the Azure / LTE init code from the example)

Here's the configuration I've added or modified

CONFIG_LOG_DEFAULT_LEVEL=4

CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=8192

CONFIG_BT=y
CONFIG_BT_HCI=y
CONFIG_BT_H4=y
CONFIG_BT_WAIT_NOP=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_BT_DEBUG_HCI_CORE=y
CONFIG_BT_DEBUG_HCI_DRIVER=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_UART_INTERRUPT_DRIVEN=y

Parents
  • Hi,

    Have you programmed the HCI low power UART sample to the nRF52840 SoC on the nRF9160 DK? In order to be able to use BLE in the LTE gateway sample you must program this sample to the board controller. You can do this by performing the following steps:

    1. Set the SW10 switch, marked as debug/prog, in the NRF52 position. In nRF9160 DK v0.9.0 and earlier, the switch is called SW5.
    2. Build the Bluetooth: HCI low power UART sample for the nrf9160dk_nrf52840 build target and program the board controller with it.

    After this you must set the switch back to the nRF91 position and program your application. 

    Best regards,

    Marte

Reply
  • Hi,

    Have you programmed the HCI low power UART sample to the nRF52840 SoC on the nRF9160 DK? In order to be able to use BLE in the LTE gateway sample you must program this sample to the board controller. You can do this by performing the following steps:

    1. Set the SW10 switch, marked as debug/prog, in the NRF52 position. In nRF9160 DK v0.9.0 and earlier, the switch is called SW5.
    2. Build the Bluetooth: HCI low power UART sample for the nrf9160dk_nrf52840 build target and program the board controller with it.

    After this you must set the switch back to the nRF91 position and program your application. 

    Best regards,

    Marte

Children
Related