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

    What target board are you building for here exactly? Note that only the nRF52833DK and nRF5340DK is supported/tested for the Direction Finding central. Also, please make sure to read the documentation thoroughly when trying to build, as I have been able to build this project without errors on my end: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/direction_finding_central/README.html 

    Best regards,

    Simon

  • Hello.
    My target board is nRF52833DK with an antenna array designed by Nordic.
    However, as I said before, I don't think this error is hardware related. Two posts I found in Nordic DevZone had similar problems to mine.

     Problems building Direction_finding_central sample 

     Direction_finding_central test 

    One of the authors replied to me a few hours ago, saying that he did not solve the problem, but switch to the connectionless sample in bluetooth direction finding. But the connectionless sample does not meet my requirement.

    Today I tried to change the version of Zephyr, but it didn't seem to work.

  • Please post the full build log you're seeing so we can do a proper review of it as I'm not ale to see this issue on my end...

    Best regards,

    Simon

  • OK. There are five warning and one error:

    * Executing task: nRF Connect: Generate config nrf52833dk_nrf52833 for d:\AoAAoD\direction_finding_central

    Building direction_finding_central
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir d:/AoAAoD/direction_finding_central/build d:/AoAAoD/direction_finding_central --pristine --board nrf52833dk_nrf52833 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=d:/AoAAoD/direction_finding_central/prj.conf -DBOARD_ROOT=d:/aoaaod/direction_finding_central;d:/aoaaod/direction_finding_peripheral"

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: D:/AoAAoD/direction_finding_central
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.5.1/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.1/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf52833dk_nrf52833
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c57af46cb7/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.5.1/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833.dts
    -- Found devicetree overlay: D:/AoAAoD/direction_finding_central/boards/nrf52833dk_nrf52833.overlay
    -- Generated zephyr.dts: D:/AoAAoD/direction_finding_central/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: D:/AoAAoD/direction_finding_central/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: D:/AoAAoD/direction_finding_central/build/zephyr/dts.cmake

    warning: BT_DF_CONNECTION_CTE_RX (defined at C:/ncs/v2.5.1/zephyr/subsys/bluetooth/host/Kconfig:847,
    subsys/bluetooth\host/Kconfig:847) was assigned the value 'y' but got the value 'n'. Check these
    unsatisfied dependencies: (((!BT_CTLR || BT_CTLR_DF_CTE_RX_SUPPORT) && BT_DF && BT_HCI_HOST &&
    BT_RPC_STACK) || ((!BT_CTLR || BT_CTLR_DF_CTE_RX_SUPPORT) && BT_DF && BT_HCI_HOST && BT_HCI && BT))
    (=n). See docs.zephyrproject.org/.../kconfig.html and/or
    look up BT_DF_CONNECTION_CTE_RX in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.


    warning: BT_DF_CONNECTION_CTE_REQ (defined at
    C:/ncs/v2.5.1/zephyr/subsys/bluetooth/host/Kconfig:861, subsys/bluetooth\host/Kconfig:861) was
    assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
    ((BT_DF_CONNECTION_CTE_RX && BT_DF && BT_HCI_HOST && BT_RPC_STACK) || (BT_DF_CONNECTION_CTE_RX &&
    BT_DF && BT_HCI_HOST && BT_HCI && BT)) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    BT_DF_CONNECTION_CTE_REQ in the menuconfig/guiconfig interface. The Application Development Primer,
    Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
    helpful too.


    warning: Deprecated symbol BT_DEBUG_LOG is enabled.


    warning: Deprecated symbol BT_DEBUG_LOG is enabled.


    warning: Experimental symbol BT_DF is enabled.

    Parsing C:/ncs/v2.5.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.5.1/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833_defconfig'
    Merged configuration 'd:/AoAAoD/direction_finding_central/prj.conf'
    Configuration saved to 'D:/AoAAoD/direction_finding_central/build/zephyr/.config'
    Kconfig header saved to 'D:/AoAAoD/direction_finding_central/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/AoAAoD/direction_finding_central/build
    -- west build: building application
    [2/196] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.1/zephyr), build: v3.4.99-ncs1-1
    [34/196] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52833_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.5.1/nrf/drivers/mpsl/clock_control -IC:/ncs/v2.5.1/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.5.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.5.1/zephyr/subsys/bluetooth -IC:/ncs/v2.5.1/nrf/include -IC:/ncs/v2.5.1/nrf/lib/multithreading_lock/. -IC:/ncs/v2.5.1/nrf/subsys/bluetooth/controller/. -IC:/ncs/v2.5.1/nrf/tests/include -IC:/ncs/v2.5.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.5.1/zephyr/modules/cmsis/. -IC:/ncs/v2.5.1/modules/hal/nordic/nrfx -IC:/ncs/v2.5.1/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.5.1/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.5.1/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.5.1/modules/debug/segger/SEGGER -IC:/ncs/v2.5.1/modules/debug/segger/Config -IC:/ncs/v2.5.1/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/fem/common/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/fem/nrf21540_gpio/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/fem/simple_gpio/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/fem/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/fem/include/protocol -IC:/ncs/v2.5.1/nrfxlib/mpsl/include -IC:/ncs/v2.5.1/nrfxlib/mpsl/include/protocol -IC:/ncs/v2.5.1/nrfxlib/softdevice_controller/include -fno-strict-aliasing -Os -imacros D:/AoAAoD/direction_finding_central/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.5.1/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=D:/AoAAoD/direction_finding_central=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.5.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.5.1=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
    ../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')
    [47/196] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.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.

  • Hi

    Can you try moving the project to the C: disk (the same as where NCS is located on your computer, as I think the fact that you're trying to build the sample on a different disk than where you have NCS stored might be what is causing this. The west build is not great at jumping between disks to find functions/references if I recall correctly.

    Best regards,

    Simon

Related