nrf5340 empty_app_core compilation failed

I am using nrf5340 audio DK,

The project I use is v3.0.2 .\samples\nrf5340\empty_app_core\. If the board target is nrf5340 audio DK

a compilation error will occur.
build error:zephyr/drivers/regulator/libdrivers__regulator.a(regulator_npm1100.c.obj):(.rodata.config_0+0x0): undefined reference to `__device_dts_ord_8


If I selected the target board as nrf5340dk/nrf5340/cpuapp and it compiled successfully.

  •  *  Executing task: nRF Connect: Generate config nrf5340_audio_dk/nrf5340/cpuapp for c:\ncs\empty_app_core 
    
    Building empty_app_core
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/ncs/empty_app_core/build_1 c:/ncs/empty_app_core --pristine --board nrf5340_audio_dk/nrf5340/cpuapp -- -DBOARD_ROOT=c:/ncs/peripheral_hr;c:/ncs/hci_uart_workspace;c:/ncs/iso_time_sync;c:/ncs/hci_uart_302;c:/ncs/hci_pstrueb_302;c:/ncs/iso_time_sync_1"
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.2/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340_audio_dk, qualifiers: nrf5340/cpuapp
    Parsing C:/ncs/v3.0.2/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'C:/ncs/empty_app_core/build_1/_sysbuild/empty.conf'
    Merged configuration 'C:/ncs/empty_app_core/build_1/_sysbuild/empty.conf'
    Configuration saved to 'C:/ncs/empty_app_core/build_1/zephyr/.config'
    Kconfig header saved to 'C:/ncs/empty_app_core/build_1/_sysbuild/autoconf.h'
    -- 
       ************************************
       * Running CMake for empty_app_core *
       ************************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/empty_app_core
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.2/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.2/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340_audio_dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v3.0.2/zephyr/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/zephyr.dts
    -- Generated pickled edt: C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/dts.cmake
    
    warning: THREAD_STACK_INFO (defined at kernel/Kconfig:189) was assigned the value 'n' but got the
    value 'y'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_THREAD_STACK_INFO and/or
    look up THREAD_STACK_INFO 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: BOOT_DELAY (defined at kernel/Kconfig:472) was assigned the value '0' but got the value ''.
    Check these unsatisfied dependencies: MULTITHREADING (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BOOT_DELAY and/or look up BOOT_DELAY 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: PRINTK (defined at subsys/debug/Kconfig:220) was assigned the value 'n' but got the value
    'y'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_PRINTK and/or look up PRINTK 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: EARLY_CONSOLE (defined at subsys/debug/Kconfig:239) was assigned the value 'n' but got the
    value 'y'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_EARLY_CONSOLE and/or look up
    EARLY_CONSOLE 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 DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM is enabled.
    
    Parsing C:/ncs/v3.0.2/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.0.2/zephyr/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/ncs/empty_app_core/prj.conf'
    Merged configuration 'C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/.config.sysbuild'
    Configuration saved to 'C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/.config'
    Kconfig header saved to 'C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/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/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    CMake Warning at C:/ncs/v3.0.2/zephyr/soc/nordic/nrf53/CMakeLists.txt:11 (message):
      
    
          Your application may be affected by the anomaly 160 that concerns the
          nRF5340 SoC. The related workaround cannot be applied, because your
          application has the system clock disabled (CONFIG_SYS_CLOCK_EXISTS=n).
          Consider enabling the system clock to apply the workaround.
          
          At your own risk, you can suppress this warning by setting
          CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED=n.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/empty_app_core/build_1/empty_app_core
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/empty_app_core/build_1
    -- west build: building application
    [4/120] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.2/zephyr), build: v4.0.99-ncs1-2
    [115/120] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/ncs/empty_app_core/build_1/empty_app_core/zephyr/zephyr_pre0.map 
    cmd.exe /C "cd . && C:\ncs\toolchains\0b393f9e1b\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -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=C:/ncs/empty_app_core/build_1/empty_app_core/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/cortex_m/cmse/libarch__arm__core__cortex_m__cmse.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf5340/libsoc__nordic.a  zephyr/boards/nordic/nrf5340_audio_dk/libboards__nordic__nrf5340_audio_dk.a  zephyr/drivers/regulator/libdrivers__regulator.a  modules/nrf/drivers/hw_cc3xx/lib..__nrf__drivers__hw_cc3xx.a  modules/hal_nordic/modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -LC:/ncs/empty_app_core/build_1/empty_app_core/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m33  -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  C:/ncs/v3.0.2/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc312_platform_0.9.19.a -L"c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp" -lc -lgcc && cmd.exe /C "cd /D C:\ncs\empty_app_core\build_1\empty_app_core\zephyr && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true""
    c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/regulator/libdrivers__regulator.a(regulator_npm1100.c.obj):(.rodata.config_0+0x0): undefined reference to `__device_dts_ord_8'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/empty_app_core-prefix/src/empty_app_core-stamp/empty_app_core-build C:/ncs/empty_app_core/build_1/_sysbuild/sysbuild/images/empty_app_core-prefix/src/empty_app_core-stamp/empty_app_core-build 
    cmd.exe /C "cd /D C:\ncs\empty_app_core\build_1\empty_app_core && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' --build C:/ncs/empty_app_core/build_1
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    

Related