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";
};