In order to correspond to the newly created board using nrf5340_audio as a reference, I executed create a new board on the sample source nrf_audio and assigned pins.
If you build using VSCode instead of using a script, a build error will occur.
The following error appears.
in device.h
'__device_dts_ord_DT_N_NODELABEL_board_id_P_io_channels_IDX_0_PH_ORD' undeclared here (not in a function)
in devicetree.h
'DT_N_NODELABEL_board_id_P_io_channels_IDX_0_VAL_input' undeclared here (not in a function)
pasting ")" and "_REG_IDX_" does not give a valid preprocessing token
What is causing the error?
The terminal display until an error occurs and the build stops is
-- Found Git: C:/ncs/toolchains/c57af46cb7/mingw64/bin/git.exe (found version "2.37.3.windows.1")
-- 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/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
-- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found version "3.8.2") found components: Interpreter
CMake Deprecation Warning at C:/ncs/v2.5.0/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
'PYTHON_PREFER' variable is deprecated. Please use Python3_EXECUTABLE
instead.
Call Stack (most recent call first):
C:/ncs/v2.5.0/zephyr/cmake/modules/python.cmake:16 (find_package)
C:/ncs/v2.5.0/zephyr/cmake/modules/user_cache.cmake:30 (include)
C:/ncs/v2.5.0/zephyr/cmake/modules/extensions.cmake:5 (include)
C:/ncs/v2.5.0/nrf/subsys/nrf_security/tfm/CMakeLists.txt:36 (include)
-- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/TSP_M1/nrf5340_audio_demo/build/tfm
[152/156] Linking C executable bin\tfm_s.axf
Memory region Used Size Region Size %age Used
FLASH: 48456 B 64 KB 73.94%
RAM: 18884 B 32 KB 57.63%
[14/496] Performing install step for 'tfm'
-- Install configuration: "Debug"
[99/496] Building C object CMakeFiles/app.dir/src/utils/board_version.c.obj
FAILED: CMakeFiles/app.dir/src/utils/board_version.c.obj
C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DARM_ALL_FAST_TABLES -DARM_DSP_CONFIG_TABLES -DARM_FAST_ALLOW_TABLES -DARM_FFT_ALLOW_TABLES -DARM_TABLE_RECIP_Q15 -DARM_TABLE_RECIP_Q31 -DARM_TABLE_SIN_F32 -DARM_TABLE_SIN_Q15 -DARM_TABLE_SIN_Q31 -DGATEWAY=2 -DHEADSET=1 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DTFM_PSA_API -DUSE_PARTITION_MANAGER=1 -DZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../include -I../src/audio -I../src/bluetooth -I../src/drivers -I../src/modules -I../src/utils -I../src/utils/macros -I../app -IC:/ncs/v2.5.0/nrf/boards/arm/nrf5340_audio_dk_nrf5340 -I../src/bluetooth/bt_management/advertising -I../src/bluetooth/bt_management/controller_config -I../src/bluetooth/bt_management/dfu -I../src/bluetooth/bt_management/scanning -I../src/bluetooth/bt_renderer/volume -I../src/bluetooth/bt_content_control/media -I../src/bluetooth/bt_stream/broadcast -I../src/bluetooth/bt_stream/unicast -I../src/bluetooth/bt_management -I../src/bluetooth/bt_renderer -I../src/bluetooth/bt_content_control -I../src/bluetooth/bt_stream -IC:/ncs/v2.5.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.5.0/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.5.0/zephyr/lib/libc/newlib/include -IC:/ncs/v2.5.0/zephyr/lib/posix/getopt/. -IC:/ncs/v2.5.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.5.0/zephyr/subsys/rtio -IC:/ncs/v2.5.0/zephyr/subsys/bluetooth -IC:/ncs/v2.5.0/zephyr/subsys/settings/include -IC:/ncs/v2.5.0/nrf/include -IC:/ncs/v2.5.0/nrf/lib/bin/bt_ll_acs_nrf53/include -IC:/ncs/v2.5.0/nrf/lib/contin_array/. -IC:/ncs/v2.5.0/nrf/lib/pcm_mix/. -Itfm/install/interface/include -IC:/ncs/v2.5.0/nrf/include/tfm -IC:/ncs/v2.5.0/nrf/tests/include -Itfm/generated/interface/include -IC:/ncs/v2.5.0/modules/hal/cirrus-logic -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/common -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/common/bridge -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/common/platform_bsp -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/cs47l63 -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/cs47l63/bsp -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/cs47l63/config -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/cs47l63/fw_pt -IC:/ncs/v2.5.0/modules/hal/cirrus-logic/cs47l63/generated -IC:/ncs/v2.5.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.5.0/modules/hal/cmsis/CMSIS/DSP/Include -IC:/ncs/v2.5.0/zephyr/modules/cmsis/. -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.5.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.5.0/modules/debug/segger/SEGGER -IC:/ncs/v2.5.0/modules/debug/segger/Config -IC:/ncs/v2.5.0/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.5.0/nrfxlib/lc3/codec/inc -IC:/ncs/v2.5.0/nrfxlib/lc3/platform/os/inc -IC:/ncs/v2.5.0/nrfxlib/lc3/platform/os/baremetal/inc -IC:/ncs/v2.5.0/nrfxlib/lc3/include -Imodules/nrf/subsys/nrf_security/src/include/generated -IC:/ncs/v2.5.0/nrf/subsys/nrf_security/include -IC:/ncs/v2.5.0/nrf/ext/oberon/psa/core/include -IC:/ncs/v2.5.0/nrf/ext/oberon/psa/core/library -IC:/ncs/v2.5.0/modules/crypto/mbedtls/include -IC:/ncs/v2.5.0/modules/crypto/mbedtls/library -IC:/ncs/v2.5.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.5.0/nrfxlib/crypto/nrf_oberon/include -IC:/ncs/v2.5.0/nrfxlib/softdevice_controller/include -IC:/ncs/v2.5.0/zephyr/modules/fatfs -IC:/ncs/v2.5.0/modules/fs/fatfs/include -fno-strict-aliasing -Og -imacros C:/Users/TSP_M1/nrf5340_audio_demo/build/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mfp16-format=ieee --sysroot=C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.5.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fstack-usage -fmacro-prefix-map=C:/Users/TSP_M1/nrf5340_audio_demo=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.5.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.5.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -D_POSIX_THREADS -std=c99 -MD -MT CMakeFiles/app.dir/src/utils/board_version.c.obj -MF CMakeFiles\app.dir\src\utils\board_version.c.obj.d -o CMakeFiles/app.dir/src/utils/board_version.c.obj -c ../src/utils/board_version.c
In file included from C:/ncs/v2.5.0/zephyr/include/zephyr/toolchain/gcc.h:92,
from C:/ncs/v2.5.0/zephyr/include/zephyr/toolchain.h:50,
from C:/ncs/v2.5.0/zephyr/include/zephyr/kernel_includes.h:19,
from C:/ncs/v2.5.0/zephyr/include/zephyr/kernel.h:17,
from ../src/modules/board.h:10,
from ../src/utils/board_version.h:10,
from ../src/utils/board_version.c:7:
C:/ncs/v2.5.0/zephyr/include/zephyr/device.h:85:41: error: '__device_dts_ord_DT_N_NODELABEL_board_id_P_io_channels_IDX_0_PH_ORD' undeclared here (not in a function)
85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
In file included from ../src/utils/board_version.c:10:
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:197:36: error: 'DT_N_NODELABEL_board_id_P_io_channels_IDX_0_VAL_input' undeclared here (not in a function)
In file included from C:/ncs/v2.5.0/zephyr/include/zephyr/arch/arm/aarch32/arch.h:20,
from C:/ncs/v2.5.0/zephyr/include/zephyr/arch/cpu.h:19,
from C:/ncs/v2.5.0/zephyr/include/zephyr/kernel_includes.h:33:
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_EXISTS" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_REG_IDX_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:2621:62: error: pasting ")" and "_P_" does not give a valid preprocessing token
2621 | DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
C:/ncs/v2.5.0/zephyr/include/zephyr/device.h:85:41: error: '__device_dts_ord_DT_N_NODELABEL_board_id_P_power_gpios_IDX_0_PH_ORD' undeclared here (not in a function)
C:/ncs/v2.5.0/zephyr/include/zephyr/devicetree.h:197:36: error: 'DT_N_NODELABEL_board_id_P_power_gpios_IDX_0_VAL_pin' undeclared here (not in a function)
197 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
[108/496] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/soc.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\Users\TSP_M1\nrf5340_audio_demo\build'