The official demo of AoA/AoD shows an error about cte_report_cb

I got an error while building the direction finding demo In nRF Connect:

../src/main.c:254:10: error: 'const struct bt_conn_cb' has no member named 'cte_report_cb'
254 | .cte_report_cb = cte_recv_cb,
| ^~~~~~~~~~~~~
../src/main.c:254:26: warning: initialization of '_Bool (*)(struct bt_conn *, struct bt_le_conn_param *)' from incompatible pointer type 'void (*)(struct bt_conn *, const struct bt_df_conn_iq_samples_report *)' [-Wincompatible-pointer-types]
254 | .cte_report_cb = cte_recv_cb,
| ^~~~~~~~~~~
../src/main.c:254:26: note: (near initialization for 'bt_conn_cb_conn_callbacks.le_param_req')
[27/118] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_core.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'd:\AoAAoD\direction_finding_central\build'

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

In VSCode:

I found two similar problems in Nordic DevZone, but it doesn't seem to be solved:

Direction_finding_central test

Problems building Direction_finding_central sample

Other than that, I didn't find any helpful posts using Google.


I am a beginner in BLE and just finished the basic Bluetooth course in Nordic a few days ago. So, I don't think I had any problems with my environment, In that I was able to run all the demos In Bluetooth Low Energy Fundamentals.


I directly built the demo named direction finding central without any modification, because I did not see any information in the document that necessary to be changed to build successfully. Note that I just built it, it doesn't involve flash, so I don't think it's hardware related.


In contrast, the associated demo called direction finding peripheral was build successfully without any modification.


My operating system is Windows 10.
My nRF Connect SDK is v2.5.1.in VSCode.
My Zephyr version: 3.4.99

I don't know if this is an official Sample Bug, because I'm just getting started with embedded development. Is there any information that can help me?

  • Hi,

    Today I ran this sample successfully! Here's the thing: the nrf52833dk_nrf52833.conf in the board seems to be correct, but I don't know why it didn't work as expected. So, I copied all the code from nrf52833dk_nrf52833.conf into prj.conf. Subsequently, both the build and flash processes went smoothly, and CTE seemed fine too. Finally, I can start my project development.

    At the same time, I'd like to ask, will this solution have any other adverse effects?

  • Hi

    I got some details on why this didn't work for you and the other similar cases today from our developer:

    In the build command, -DCONF_FILE=<file> was used, which prevents auto-discovery of a board specific Kconfig file in /boards. If that option is used, all the Kconfig files also must be provided in this option. Just running west build -b nrf52833dk_nrf52833 is a simpler way of doing it. That way the prj.conf is used by default, and the board specific Kconfig discovery will happen. 

    Your method shouldn't have any unwanted effects either for that matter.

    Best regards,

    Simon

  • Great! Thank you for disturbing you for more than half a month. I'm about to start the development of my project!

  • Hello Simonr,
    Today, I encountered another problem related to prj.conf. Can I place the prj.conf configuration in the main.c? For example, if I want to set:

    CONFIG_BT_CTLR_DF_ANT_SWITCH_TX=n
    CONFIG_BT_CTLR_DF_ADV_CTE_TX=n

    I will set in main.c like:

    #define CONFIG_BT_CTLR_DF_ANT_SWITCH_TX=n
    #define CONFIG_BT_CTLR_DF_ADV_CTE_TX=n

    Is this different from using prj.conf?
    Just to confirm, we developed the project this way but did not get the expected results. I don't know if this is the problem.
    The reason for this is that we need to change the prj.conf settings for different code segments within the same project , so we thought it would be convenient if these could be changed directly in the main.c.
    Or, may I ask if there is a more official way to change the settings in prj.conf more flexibly?

    Thanks!

  • For example, the Rx side is set to CONFIG_BT_DF_CONNECTION_CTE_RX=y by default.

    However, if I add CONFIG_BT_DF_CONNECTION_CTE_TX=y to the Rx side without changing other code, will it affect the functionality of this sample?

    I mean the prj.conf of the Rx side will be like:

    CONFIG_BT_DF_CONNECTION_CTE_RX=y 

    CONFIG_BT_DF_CONNECTION_CTE_TX=y 

    Both RX and TX are set to 'y'. (Yes, I admit, my requirement is somewhat niche, haha. We need a device that can both transmit CTE and receive CTE.)

    In other words, by adding this setting, does it merely make the program bulkier by enabling certain functionalities, while actually using these functionalities is something that needs to be done in the main.c file? 

Related