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 again,

    2. I noticed the missing dependencies earlier, so I added the following code to prj.conf:

    CONFIG_BT_HCI=y
    CONFIG_BT_CTLR=y
    CONFIG_BT_CTLR_DF_CTE_RX_SUPPORT=y
    CONFIG_BT_HCI_HOST=y
    CONFIG_BT_RPC_STACK=y

    However, it showed me the following error:

    CONFIG_BT_CTLR_DF_CTE_RX_SUPPORT was assigned the value y, but got the value n. Missing dependencies:
    BT_HCI
    
    Symbol CONFIG_BT_HCI_HOST cannot be set (has no prompt)

    Today I tried creating a new overlay, but the result was the same as adding these codes directly into the prj.conf, and it didn't work.

    Yes, I agree that shouldn't be it for just a sample project. All I want to do is successfully run this sample and obtain the IQ. I built this sample today on another PC with Mac OS, but the errors encountered during the build process are the same as in this case on Windows10.

    3. Yes, haha, our requirement is a little bit uncommon because we only need AoA and AoD and we don't do direction finding. We only need the central device to have an antenna array because we only need AoA from the central device and AoD from the tag. 

    Thanks for your relpy!

    Yours,

    Zihao

  • 2. Hi, what Bluetooth stack have you set the application to use here? Seems like you're trying to use some Zephyr specific configs on the Nordic SoftDevice link layer. Can you upload the full build log again and try setting https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_BT_LL_SW_SPLIT to ensure you enable the Zephyr stack? Please upload the full build log so we can get a better look.

    3. For AoD to work, the beacon will also need to have an antenna array, if not only AoA will be possible to use since the AoD (Angle of Departure) would all come from the same exact antenna...

    Best regards,

    Simon

  • Hi Simon,

    Firstly, thank you for your patient response, and I apologize for the continued disturbance.

    I added CONFIG_BT_LL_SW_SPLIT=y to prj.conf, and then prj.conf stopped showing errors or warnings, whether it was in connection samples or connectionless samples. This allowed me to successfully build the official samples without modifying any SDK files.

    However, after flashing to my nRF52833DK, I still encountered issues with the official samples, both in connection and connectionless samples. During runtime, all these issues seem to be related to CTE configuration, resulting in err - 134.

    connection center log:

    [DEVICE]: 78:11:DC:C2:89:2F (public), AD evt type 0, AD data len 24, RSSI -90
    [AD]: 1 data_len 1
    [AD]: 22 data_len 19
    [DEVICE]: E5:2F:FC:5A:F2:67 (random), AD evt type 0, AD data len 8, RSSI -90
    [AD]: 1 data_len 1
    [AD]: 39 data_len 3
    Connected: E5:2F:FC:5A:F2:67 (random)
    Enable receiving of CTE...
    [00:00:27.216,369] <wrn> bt_df: bt_df_set_conn_cte_rx_enable: Receiving Constant Tone Extensions is not supported
    failed (err -134)
    Disconnected: E5:2F:FC:5A:F2:67 (random) (reason 0x3e)
    Scanning successfully started
    [DEVICE]: 32:68:CB:2F:B7:CC (random), AD evt type 3, AD data len 31, RSSI -68
    [DEVICE]: 2B:ED:54:17:9C:5B (random), AD evt type 3, AD data len 31, RSSI -74
    [DEVICE]: 7C:27:BC:D1:9D:2E (public), AD evt type 3, AD data len 19, RSSI -76
    [DEVICE]: 78:11:DC:C2:89:2F (public), AD evt type 0, AD data len 24, RSSI -90
    [AD]: 1 data_len 1
    [AD]: 22 data_len 19
    [DEVICE]: 78:11:DC:C2:89:2F (public), AD evt type 4, AD data len 28, RSSI -89
    [DEVICE]: 59:D4:15:36:74:8F (random), AD evt type 0, AD data len 31, RSSI -86

    For the direction finding connectionless tx,  it also reported failed (err -134) After copying a fresh one of the official sample and trying in different NCS environments, I still encountered the same error, while the connection tx seems to be working fine.

    Of course, currently our team leans more towards using the connectionless sample. The logs for connectionless tx and rx are as follows: (Note that both logs are from the official sample without any modifications, except for adding CONFIG_BT_LL_SW_SPLIT=y in the prj.conf of the connectionless rx sample.)

    --------------------------------------------------------------------

    connectionless tx building log:
    Building direction_finding_connectionless_tx_2
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir d:/AoAoD3/direction_finding_connectionless_tx_2/build d:/AoAoD3/direction_finding_connectionless_tx_2 --pristine --board nrf52833dk_nrf52833 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=d:/AoAoD3/direction_finding_connectionless_tx_2/prj.conf -DEXTRA_CONF_FILE=overlay-aoa.conf -DBOARD_ROOT=d:/aoaod3/direction_finding_connectionless_tx_2"

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: D:/AoAoD3/direction_finding_connectionless_tx_2
    -- CMake version: 3.21.0
    -- Found Python3: D:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", 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.2.0", minimum required is "0.14.0")
    -- Board: nrf52833dk_nrf52833
    -- Found host-tools: zephyr 0.16.5 (D:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (D:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: D:/ncs/toolchains/cf2149caf2/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:/AoAoD3/direction_finding_connectionless_tx_2/boards/nrf52833dk_nrf52833.overlay
    -- Generated zephyr.dts: D:/AoAoD3/direction_finding_connectionless_tx_2/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: D:/AoAoD3/direction_finding_connectionless_tx_2/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: D:/AoAoD3/direction_finding_connectionless_tx_2/build/zephyr/dts.cmake

    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:/AoAoD3/direction_finding_connectionless_tx_2/prj.conf'
    Merged configuration 'D:/AoAoD3/direction_finding_connectionless_tx_2/overlay-aoa.conf'
    Configuration saved to 'D:/AoAoD3/direction_finding_connectionless_tx_2/build/zephyr/.config'
    Kconfig header saved to 'D:/AoAoD3/direction_finding_connectionless_tx_2/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: d:/ncs/toolchains/cf2149caf2/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: D:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/AoAoD3/direction_finding_connectionless_tx_2/build
    -- west build: building application
    [2/172] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.1/zephyr), build: v3.4.99-ncs1-1
    [172/172] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 102944 B 512 KB 19.64%
    RAM: 19872 B 128 KB 15.16%
    IDT_LIST: 0 GB 2 KB 0.00%
    * Terminal will be reused by tasks, press any key to close it.


    connectionless rx building log:
    Building direction_finding_connectionless_rx
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir d:/AoAoD3/direction_finding_connectionless_rx/build d:/AoAoD3/direction_finding_connectionless_rx --pristine --board nrf52833dk_nrf52833 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=d:/aoaod3/direction_finding_connectionless_tx_2;d:/aoaod3/direction_finding_connectionless_rx;d:/aoaod3/direction_finding_connectionless_tx_1;d:/aoaod3/direction_finding_central;d:/aoaod3/direction_finding_peripheral;d:/aoaod3/direction_finding_connectionless_tx -DCACHED_CONF_FILE=d:/AoAoD3/direction_finding_connectionless_rx/prj.conf -DDTC_OVERLAY_FILE=d:/AoAoD3/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.overlay"

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: D:/AoAoD3/direction_finding_connectionless_rx
    -- CMake version: 3.21.0
    -- Found Python3: D:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", 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.2.0", minimum required is "0.14.0")
    -- Board: nrf52833dk_nrf52833
    -- Found host-tools: zephyr 0.16.5 (D:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (D:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: D:/ncs/toolchains/cf2149caf2/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:/AoAoD3/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.overlay
    -- Generated zephyr.dts: D:/AoAoD3/direction_finding_connectionless_rx/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: D:/AoAoD3/direction_finding_connectionless_rx/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: D:/AoAoD3/direction_finding_connectionless_rx/build/zephyr/dts.cmake

    warning: Experimental symbol BT_DF is enabled.


    warning: Experimental symbol BT_LL_SW_SPLIT 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:/AoAoD3/direction_finding_connectionless_rx/prj.conf'
    Configuration saved to 'D:/AoAoD3/direction_finding_connectionless_rx/build/zephyr/.config'
    Kconfig header saved to 'D:/AoAoD3/direction_finding_connectionless_rx/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: d:/ncs/toolchains/cf2149caf2/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: D:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/AoAoD3/direction_finding_connectionless_rx/build
    -- west build: building application
    [2/193] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.1/zephyr), build: v3.4.99-ncs1-1
    [193/193] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 78352 B 512 KB 14.94%
    RAM: 21448 B 128 KB 16.36%
    IDT_LIST: 0 GB 2 KB 0.00%
    * Terminal will be reused by tasks, press any key to close it.

    --------------------------------------------------------------------------

    (I'm sorry, I'm not sure why, but I couldn't successfully use "insert code" to insert my log, so I just pasted it here directly...)

    There are several cases on DevZone regarding err-134, but the latest one is from two years ago which is too old, and I haven't found any helpful solutions. I've checked the build logs for both, but at my level of knowledge, I haven't identified any significant issues.

    Is there anything unusual in the logs that you can see?

    About AoD:

    Yes indeed, AoD requires the beacon to have an antenna array. However, when we run AoD, the center becomes the beacon, and vice versa. This is indeed a bit niche since we do not do localization. Thank you for your concern!

    Yours,

    Zihao

  • Hi again

    Today I got some feedback from the experts internally on Direction Finding that should be helpful.

    Please note that for the Direction Finding receive function (RX sample and Central sample) the only certified solution is on NCS 2.2.0, and newer versions of this sample are not certified nor guaranteed to work. Please only use the samples in the nRF folder of NCS, and not the ones in the Zephyr folder. The nRF folder samples have been build tested and should work as expected if no changes have been made to the SDK files.

    Regarding your latest issue. The error you're seeing here points to CTE RX not being supported. Hav you by chance added the overlay-aod.conf to your sample when building it? This will disable the AoA feature and thus also the chance to do antenna switching in RX mode.

    Best regards,

    Simon

  • Hi,

    1) Sadly, even with the ncs 2.2.0, I still haven't been able to successfully build the official connectionless tx sample and connectionless rx sample without any modification...
    Without any modification, the tx sample can't find bt_df_set_adv_cte_tx_param, while at the same time, the rx sample can't find bt_df_per_adv_sync_cte_rx_enable.
    2) No, I didn't add overlay-aod.conf to my sample. I believe the problem still related to 1), which causes these two projects to report err-134 during runtime. Despite editing the SDK or adding CONFIG_BT_DF_CONNECTIONLESS_CTE_RX = y to the prj.conf to allow these projects to be built and flashed to the board successfully, there are still some configurations related to bt_df_set_adv_cte_tx_param and bt_df_per_adv_sync_cte_rx_enable that I haven't set properly, I think. The errors seem to correspond to these two functions:
    Update CTE params...failed (err -134) ----> bt_df_set_adv_cte_tx_param
    Enable receiving of CTE...failed (err -134) ----> bt_df_per_adv_sync_cte_rx_enable

    I trust that ncs 2.2.0 is reliable. Therefore, I wonder if there's an issue with where or how I downloaded the SDK?
    First, I downloaded nRF Connect SDK for Desktop v4.3.0 on my Windows 10. Then, I installed Toolchain Manager v1.3.0.

    Next, I opened Toolchain Manager, found nRF Connect SDK v2.2.0, and installed it.

    Afterwards, I opened VSCode with nRF Connect for VS Code Extension Pack v2023.11.3 installed. (Would the version of this Extension Pack have any adverse effects?) On the Welcome box, I set the toolchain and SDK to v2.2.0.

    Then, I clicked "Create a new application" and searched for "direction finding" to find the two connectionless samples in nrf:

    With that, the creation of the official projects was complete. Then I attempted to build them. I chose nRF52833dk_nrf52833 Nordic boards as the board and prj.conf as the configuration. Additionally, before building the tx sample, I added overlay-aoa.conf to the Kconfig fragments.

    However, neither of them were successfully built...

    Meanwhile, in the rx sample, CONFIG_BT_DF_CTE_RX_AOA doesn't seem to have been set successfully, as ant_patterns is grayed out in the main.c.

    Did I do anything wrong? (Sorry, even though I've been stuck on this issue for half a month, I still feel I'm new to BLE COTS devices...)
    Looking forward to your reply! Thanks!

    Yours,
    Zihao

Related