Error building bluetooth examples for NRF52840-QFAA

Hi community,

I'm making a custom board using the NRF52840-CKAA. I'm trying to make a Bluetooth application for this board but struggle to achieve it.

setup:

- Visual studio code V1.87.2

- NRF connect SDK V2.6.1

- Bluetooth PERIPHERAL_RSCS example from nordic

- Standard build configuration with nrf52840dk_nrf52840 selected as board

Situation:

I can build and flash a blinky sketch to my custom board, which works perfectly fine. My custom board is an NRF52840-CKAA (based on QFAA if I'm correct). To build and flash the blinky example correctly, I add the following to the prj.conf file:

CONFIG_SOC_NRF52840_QFAA=y

This works fine for blinky example, but when I add this line and try to build the Bluetooth example, I get the following build error traceback:

FAILED: zephyr/drivers/bluetooth/CMakeFiles/drivers__bluetooth.dir/hci/h4.c.obj 
C:\ncs\toolchains\cf2149caf2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52840_XXAA -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.6.1/zephyr/subsys/bluetooth -IC:/ncs/v2.6.1/zephyr/include -IC:/Users/ruben.otter/Desktop/nRF52480_firmware/test/peripheral_rscs/build/zephyr/include/generated -IC:/ncs/v2.6.1/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.6.1/zephyr/soc/common/nordic_nrf/. -IC:/ncs/v2.6.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.6.1/zephyr/subsys/settings/include -IC:/ncs/v2.6.1/nrf/include -IC:/ncs/v2.6.1/nrf/tests/include -IC:/ncs/v2.6.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.6.1/zephyr/modules/cmsis/. -IC:/ncs/v2.6.1/modules/hal/nordic/nrfx -IC:/ncs/v2.6.1/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.6.1/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.6.1/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.6.1/modules/debug/segger/SEGGER -IC:/ncs/v2.6.1/modules/debug/segger/Config -IC:/ncs/v2.6.1/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.6.1/nrfxlib/softdevice_controller/include -isystem C:/ncs/v2.6.1/zephyr/lib/libc/common/include -isystem C:/ncs/v2.6.1/nrfxlib/crypto/nrf_cc310_platform/include -Wshadow -fno-strict-aliasing -Os -imacros C:/Users/ruben.otter/Desktop/nRF52480_firmware/test/peripheral_rscs/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.6.1/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 -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Users/ruben.otter/Desktop/nRF52480_firmware/test/peripheral_rscs=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.6.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.6.1=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT zephyr/drivers/bluetooth/CMakeFiles/drivers__bluetooth.dir/hci/h4.c.obj -MF zephyr\drivers\bluetooth\CMakeFiles\drivers__bluetooth.dir\hci\h4.c.obj.d -o zephyr/drivers/bluetooth/CMakeFiles/drivers__bluetooth.dir/hci/h4.c.obj -c C:/ncs/v2.6.1/zephyr/drivers/bluetooth/hci/h4.c
In file included from C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:98,
                 from C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain.h:50,
                 from C:/ncs/v2.6.1/zephyr/include/zephyr/kernel_includes.h:23,
                 from C:/ncs/v2.6.1/zephyr/include/zephyr/kernel.h:17,
                 from C:/ncs/v2.6.1/zephyr/drivers/bluetooth/hci/h4.c:12:
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:89:41: error: '__device_dts_ord_DT_CHOSEN_zephyr_bt_uart_ORD' undeclared here (not in a function)
   89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:89:33: note: in expansion of macro '_CONCAT'
   89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:216:37: note: in expansion of macro 'DEVICE_NAME_GET'
  216 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:233:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  233 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
C:/ncs/v2.6.1/zephyr/drivers/bluetooth/hci/h4.c:74:44: note: in expansion of macro 'DEVICE_DT_GET'
   74 | static const struct device *const h4_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart));
      |                                            ^~~~~~~~~~~~~
[177/205] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/gatt.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' --build 'c:\Users\ruben.otter\Desktop\nRF52480_firmware\test\peripheral_rscs\build'

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Adding 'CONFIG_SOC_NRF52840_QFAA=y' to the prj.conf file causes errors in each Bluetooth example I tried to build. I was able to successfully build the project without this line in prj.conf, but flashing it to my custom board stops the NRF from working correctly. (flashing it to the DK works perfectly fine).

I hope this description is clear enough and you guys can help me further with this problem.

Thanks in advance!

Related