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

Bluetooth Beacon Setup on Thingy 91

Hello,

I am working on an IoT project using the Thingy 91 to send sensor data via Bluetooth to a remote device. Currently, I am trying to set up a simple beacon as shown in the Zephyr samples. I would like to set up the NRF9160 as the host and the NRF52 as the controller.
Therefore, I used the LTE/BLE example in the NRF samples and flashed the NRF52 with the patched HCI/UART sample provided in this post.
However, the system keeps crashing during HCI setup (in bt_enable). The error is due to a failing k_sem_take call (return value -11) in Zephyr's hci_core.c.

Is there some issue with the driver setup?


Best regards

Nils Ruf

Parents Reply Children
  • Hi Øyvind,

    Unfortunately, since I have flashed the HCI-UART bridge example onto the NRF52, I have not been able to connect to the serial interface any more so I do not get any application output. Is there another way to obtain this information?

    I did one change to simplify debugging as shown below:

    void ble_init(void)
    {
    	int err;
    
    	printk("Initializing Bluetooth..\n");
    	err = bt_enable(NULL);
    	if (err) {
    		printk("Bluetooth init failed (err %d)\n", err);
    		return;
    	}
    	ble_ready(err);
    }

    Previously, the ble_ready function was passed as a callback to bt_enable. The ble_ready function should be called asynchronously after BLE initialization. This is however, not the case, so I tried it this way which leads to the error.

    If I pass the ble_ready function as a callback to bt_enable no error is thrown in the main thread but the device cannot be seen by a BLE scanner (I am trying to use the Thingy as a beacon).

    -Nils

Related