Linker error on a dts instance in the direction_finding_connectionless_rx example with nrf52833dk

The direction_finding_connectionless_rx **works fine with NCS v2.3.0**, but with v2.9.0 get's a link error on dts instance for nrf52833dk:

$ west build -b nrf52833dk/nrf52833 -p    
-- west build: making build dir /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build pristine    
-- west build: generating a build system    
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /usr/local/bin/python3.11 (found suitable version "3.11.3", minimum required is "3.8") found components: Interpreter    
-- Cache files will be written to: /home/john/.cache/zephyr
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: nrf52833dk, qualifiers: nrf52833    
Parsing /home/john/ncs/v2.9.0/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/_sysbuild/empty.conf'
Merged configuration '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/_sysbuild/empty.conf'
Configuration saved to '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/zephyr/.config'
Kconfig header saved to '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/_sysbuild/autoconf.h'
--    
   *********************************************************    
   * Running CMake for direction_finding_connectionless_rx *    
   *********************************************************                                                                                                                                                                                                                                                                                                                                                                                                                                Loading Zephyr default modules (Zephyr base).                                                                                                                                                                                                 -- Application: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx                                                                                                                                       -- CMake version: 4.0.1                                                                                                                                                                                                                       -- Found Python3: /usr/local/bin/python3 (found suitable version "3.11.3", minimum required is "3.8") found components: Interpreter                                                                                                           -- Cache files will be written to: /home/john/.cache/zephyr                                                                                                                                                                              -- Zephyr version: 3.7.99 (/home/john/ncs/v2.9.0/zephyr)                                                                                                                                                                                 -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")                                                                                                                                                                  -- Board: nrf52833dk, qualifiers: nrf52833                                                                                                                                                                                                    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK                                                                                                               
-- Found host-tools: zephyr 0.16.1 (/opt/zephyr-sdk-0.16.1)                                                                                                                                                                                   -- Found toolchain: zephyr 0.16.1 (/opt/zephyr-sdk-0.16.1)
-- Found Dtc: /opt/zephyr-sdk-0.16.1/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/john/ncs/v2.9.0/zephyr/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts
-- Found devicetree overlay: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.overlay                                                                                       -- Generated zephyr.dts: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/zephyr.dts      
-- Generated devicetree_generated.h: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/dts.cmake
    
warning: Experimental symbol BT_DF is enabled.
    

warning: Experimental symbol BT_LL_SW_SPLIT is enabled.

Parsing /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/Kconfig
Loaded configuration '/home/john/ncs/v2.9.0/zephyr/boards/nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig'
Merged configuration '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/prj.conf' 
Merged configuration '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.conf'
Merged configuration '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/.config.sysbuild'
Configuration saved to '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/.config'
Kconfig header saved to '/home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /opt/zephyr-sdk-0.16.1/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (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: /opt/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Setting build type to 'MinSizeRel' as none was specified.
-- Using ccache: /usr/bin/ccache
-- Configuring done (3.9s)
-- Generating done (0.1s)
-- Build files have been written to: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx
-- Configuring done (5.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/john/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build
-- west build: building application
[5/10] Performing build step for 'direction_finding_connectionless_rx'
[1/201] Preparing syscall dependency handling    

[5/201] Generating include/generated/zephyr/version.h    
-- Zephyr version: 3.7.99 (/home/john/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2

[196/201] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/zephyr_pre0.map 
: && ccache /opt/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -Os -DNDEBUG -gdwarf-4 -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/net_buf/liblib__net_buf.a  zephyr/soc/soc/nrf52833/libsoc__nordic.a  zephyr/subsys/random/libsubsys__random.a  zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a  zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a  zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a  zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/entropy/libdrivers__entropy.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  modules/segger/libmodules__segger.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L/home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF -L"/opt/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -lc -lgcc && cd /home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx/zephyr && /usr/bin/cmake -E true
/opt/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj):(.data.bt_dev+0xe4): undefined reference to `__device_dts_ord_121'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FAILED: _sysbuild/sysbuild/images/direction_finding_connectionless_rx-prefix/src/direction_finding_connectionless_rx-stamp/direction_finding_connectionless_rx-build /home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/_sysbuild/sysbuild/images/direction_finding_connectionless_rx-prefix/src/direction_finding_connectionless_rx-stamp/direction_finding_connectionless_rx-build 
cd /home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build/direction_finding_connectionless_rx && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/sarmanowa/ncs/v2.9.0/zephyr/samples/bluetooth/direction_finding_connectionless_rx/build

I have top view knowledge of the dts, but that undefined reference errors on them are quite cryptic for me. How can I debug this?

Parents
  • Hi

    Please try building the Direction Finding Connectionless RX sample on the nrf side instead of Zephyr. At one point only the nrf one builds out of the box. The dts reference error you're seeing seems to reference that the application supports BLE Coded PHY (long range) by default which the Direction Finding feature does not support. You can see this by opening ...\zephyr\samples\bluetooth\direction_finding_connectionless_rx\build\direction_finding_connectionless_rx\zephyr\zephyr.dts and go to the line specified in your build log error code (__device_dts_ord_121). 

    I think disabling Coded PHY support in the application should fix this. Or, use the nrf\samples\bluetooth\direction_finding_connectionless_rx sample that builds correctly out of the box (at least on my end).

    Best regards,

    Simon

Reply
  • Hi

    Please try building the Direction Finding Connectionless RX sample on the nrf side instead of Zephyr. At one point only the nrf one builds out of the box. The dts reference error you're seeing seems to reference that the application supports BLE Coded PHY (long range) by default which the Direction Finding feature does not support. You can see this by opening ...\zephyr\samples\bluetooth\direction_finding_connectionless_rx\build\direction_finding_connectionless_rx\zephyr\zephyr.dts and go to the line specified in your build log error code (__device_dts_ord_121). 

    I think disabling Coded PHY support in the application should fix this. Or, use the nrf\samples\bluetooth\direction_finding_connectionless_rx sample that builds correctly out of the box (at least on my end).

    Best regards,

    Simon

Children
No Data
Related