Zephyr Build Failure on nRF52840: Undefined Reference to __device_dts_ord_77 (bt_hci_sdc)

I’m encountering a build issue with Zephyr (version 3.7.99) on my custom board based on the nRF52840 SoC. The build process fails during the linking stage with an undefined reference error. Here are the relevant details:

Build Environment:

Zephyr version: 3.7.99

Toolchain version: 0.16.5

Board: Custom board based on nRF52840

CMake version: 3.21.0

West version: 1.2.0

OS: macOS

Build Command:

west build --build-dir /Users/zhangheng/dev/motorPump/pump.git/app/build /Users/zhangheng/dev/motorPump/pump.git/app --pristine --board pump --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCACHED_CONF_FILE=/Users/zhangheng/dev/motorPump/pump.git/app/prj.conf

Error Log:

/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/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+0x16c): undefined reference to `__device_dts_ord_77'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

My devicetree_generated.h

 *   72  /soc/power@40000000/gpregret2@40000520
 *   73  /soc/power@40000000/regulator@40000578
 *   74  /soc/power@40000000/regulator@40000580
 *   75  /soc/radio@40001000
 *   76  /soc/radio@40001000/bt_hci_controller
 *   77  /soc/radio@40001000/bt_hci_sdc
 *   78  /soc/radio@40001000/ieee802154

my devicetree (dts)

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "pump-pinctrl.dtsi"

/ {
	model = "Custom Plank Board";
	compatible = "vendor,custom-plank";

	chosen {
		zephyr,console = &uart0;
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zephyr,shell_uart=&uart0;
		zephyr,bt_hci=&bt_hci_sdc;
	};

	example_sensor: example-sensor {
		compatible = "zephyr,example-sensor";
		input-gpios = <&gpio0 29 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
	};

	blink_led: blink-led {
		compatible = "blink-gpio-led";
		led-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
		blink-period-ms = <1000>;
	};
};

&uicr {
	gpio-as-nreset;
};

&gpiote {
	status = "okay";
};

&gpio0 {
	status = "okay";
};

&uart0 {
	compatible = "nordic,nrf-uarte";
	status = "okay";

	current-speed = <115200>;
	pinctrl-0 = <&uart0_default>;
	pinctrl-1 = <&uart0_sleep>;
	pinctrl-names = "default", "sleep";
};

&bt_hci_sdc {
	status = "okay";
};

Parents
  • Hi Heng zhang, 
    Please let me know which nRF Connect version you are building with ? 
    bt_hci_sdc is the choice to select Nordic's Softdevice BLE controller instead of the Zephyr BLE controller. 
    My assumption is that you would need to install nRF Connect SDK in addition to Zephyr to be able to use bt_hci_sdc. 

  • Have you been able to resolved this?   I have the same issue trying to migrate from 2.7.0 to 2.8.0.   The ord number is different because we use a different collection of peripherals in the devicetree, but the error message is the same.

    I did notice when looking at zephyr/zephyr.dts that &bt_hci_sdc now shows up in the "chosen" list (automatically, I didn't add it).   I'm wondering if this means there is some additional Kconfig setting that is needed in my prj.conf.

    Thanks for any info you may be able to provide!

Reply
  • Have you been able to resolved this?   I have the same issue trying to migrate from 2.7.0 to 2.8.0.   The ord number is different because we use a different collection of peripherals in the devicetree, but the error message is the same.

    I did notice when looking at zephyr/zephyr.dts that &bt_hci_sdc now shows up in the "chosen" list (automatically, I didn't add it).   I'm wondering if this means there is some additional Kconfig setting that is needed in my prj.conf.

    Thanks for any info you may be able to provide!

Children
No Data
Related