undefined reference to `bt_hci_cmd_alloc'

I want to read the RSSI. The code is shown as follows:   ,However, after compilation, the error message displayed is: "undefined reference to `bt_hci_cmd_alloc'".I need to know how to solve this problem。

  • Hi

    What sample project is your application based on, what SDK are you working on? I assume the necessary HCI files hasn't been included in your project. Can you confirm this is set in the main file:

    #include <zephyr/bluetooth/bluetooth.h>
    #include <zephyr/bluetooth/hci.h>
    #include <zephyr/bluetooth/hci_vs.h>
    And that the CONFIG_BT_HAS_HCI_VS=y is set in your output .config file.
    Can you share your build folder's .config file and zephyr.dts file here so we can see what you have enabled in your project's build.

    Best regards,

    Simon

Related