how to wait for BLE controller initialization?

Vakul Garg <vakul.garg@...>



I am using zephyr with nxp board frdm_k64f. It is connected with frdm_kw41z running the BLE firmware.

The kw41z acts as BLE controller.


The two boards get powered up together.

In this setup, bt_enable() executes even before frdm_kw41z firmware could complete initialization.


This leads to bt_hci_cmd_send_sync failing for command BT_HCI_OP_RESET.

The failure happens due to timeout on semaphore ‘sync_sem’.


As a workaround, I have to insert a delay of 1 second in bt_enable().


Can someone guide me how to fix such a race condition properly?







Join to automatically receive all group messages.