Re: Execute vendor-specific commands to initialize BT Controller

Chettimada, Vinayak Kariappa

Hi Nazar,


Correct me, the requirement is

  1. to be able to use Vendor HCI command/Response on `bt_enable()` after a HCI device is open but before the `bt_init()`.
  2. to be able to handle asynchronous Vendor HCI Events, if need be.
  3. to be able to perform Device Firmware Update (DFU) or settings update, this would involve synchronization thereafter (similar to CONFIG_BT_WAIT_NOP).
  4. to be able to use the feature conditionally, build-time and/or runtime.
  5. to consider enhancements to Zephyr HCI Extensions


Agree that a discussion in an enhancement request will keep information collected. Do post the issue link and I can add my thoughts there.





From: devel@... <devel@...> On Behalf Of Nazar.Palamar via
Sent: 13 December 2021 20:52
To: johan.hedberg@...; devel@...
Cc: Ian.Fyall@...
Subject: Re: [Zephyr-devel] Execute vendor-specific commands to initialize BT Controller


Hi Johan,
Thank you for your quick response. I will open a new enhancement request for this.



From: Hedberg, Johan <johan.hedberg@...>
Sent: 13 грудня 2021 р. 19:41
To: Palamar Nazar (CSUKR CSS ICW SW CC ML 2) <Nazar.Palamar@...>; devel@...
Cc: Fyall Ian (CYSC CSS ICW SW T 1) <Ian.Fyall@...>
Subject: Re: Execute vendor-specific commands to initialize BT Controller


Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.


Hi Nazar,


Adding such a feature to the Bluetooth stack sounds like a good idea, but I suspect we need to discuss a bit whether it should be a host extension using a __weak function, an extension to the HCI driver API or something else. Could you open a new enhancement request on github, providing initially the same information as in your email, and we’ll then continue the discussion there:






From: devel@... <devel@...> on behalf of Nazar.Palamar@... <Nazar.Palamar@...>
Date: Monday, 13. December 2021 at 17.42
To: devel@... <devel@...>
Cc: Ian.Fyall@... <Ian.Fyall@...>
Subject: [Zephyr-devel] Execute vendor-specific commands to initialize BT Controller

Hello Devel team,

My name is Nazar. I am working for Infineon in the SW integration team. Currently, I am working on the integration of our CYW43xxx connectivity device into Zephyr (PSoC 6 family).

At the moment, I am working on the integration of the BT part. Wi-Fi will be the next step and I am going to use the HCI H4 driver. HCI H4 driver provides to the user _weak bt_hci_transport_setup to reset the Bluetooth IC. I will use it to power the CYW43xxx device.

The CYW43xxx device requires downloading the controller firmware (via vendor HCI commands) after a power-on. Unfortunately, I cannot do this from bt_hci_transport_setup because the bt hci interface does not start on time when bt_hci_transport_setup is called.

I see the solution as update of the Zephyr common_init() function in hci_core.c, where the add hook to execute the vendor-specific init sequence is:

int __weak  bt_hci_vendor_init_sequence(void)


    return 0;


int common_init(void)


    struct net_buf *rsp;

    int err;


    /* Execute vendor-specific commands to initialize the controller */

    err = bt_hci_vendor_init_sequence();

    if (err) {

        return err;




My integration part will implement bt_hci_transport_setup and  bt_hci_vendor_init_sequence functions.

Could you possibly share your considerations on the solution? There may exist another approach to the execution of vendor-specific commands for initializing the controller, before hci_core starts its own initialization.

Thanks and Regards,

Join { to automatically receive all group messages.