Hello Nordic Support Team,
I am currently working with Distance Measurement (DM) and now need to implement the Nordic UART Service (NUS) on the nRF5340, using the application core (APP_CORE). My app is based on nRF5340DK board.
While integrating NUS, I attempted to use UART2, which is the only available UART instance in my setup, since I am already using SPI0, TWI1, SPI3, and SPI4. I also tried reconfiguring other peripherals to free up different UART instances, but the build still fails.
When I enable UART2, I encounter the following build error:
FAILED: zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_uart.c.obj
ccache /home/santos/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=4096 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=\"nrf-psa-crypto-user-config.h\" -DNCS_APPLICATION_BOOT_BANNER_GIT_REPO -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -DZCBOR_ASSERTS -DZCBOR_STOP_ON_ERROR -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/santos/ncs/v3.0.2/zephyr/kernel/include -I/home/santos/ncs/v3.0.2/zephyr/arch/arm/include -I/home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/life_finder_nrfconn_3x/zephyr/include/generated/zephyr -I/home/santos/ncs/v3.0.2/zephyr/include -I/home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/life_finder_nrfconn_3x/zephyr/include/generated -I/home/santos/ncs/v3.0.2/zephyr/soc/nordic -I/home/santos/ncs/v3.0.2/zephyr/soc/nordic/nrf53/. -I/home/santos/ncs/v3.0.2/zephyr/soc/nordic/common/. -I/home/santos/ncs/v3.0.2/zephyr/subsys/mgmt/mcumgr/util/include -I/home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/bootutil/include -I/home/santos/ncs/v3.0.2/zephyr/subsys/mgmt/mcumgr/transport/include -I/home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/include -I/home/santos/ncs/v3.0.2/zephyr/subsys/bluetooth -I/home/santos/ncs/v3.0.2/zephyr/subsys/settings/include -I/home/santos/ncs/v3.0.2/nrf/include -I/home/santos/ncs/v3.0.2/nrf/subsys/nrf_rpc/include -I/home/santos/ncs/v3.0.2/nrf/subsys/settings/include -I/home/santos/ncs/v3.0.2/nrf/tests/include -I/home/santos/ncs/v3.0.2/modules/hal/cmsis/CMSIS/Core/Include -I/home/santos/ncs/v3.0.2/zephyr/modules/cmsis/. -I/home/santos/ncs/v3.0.2/modules/lib/cmsis-dsp/Include -I/home/santos/ncs/v3.0.2/nrf/modules/hal_nordic/. -I/home/santos/ncs/v3.0.2/modules/hal/nordic/nrfx -I/home/santos/ncs/v3.0.2/modules/hal/nordic/nrfx/drivers/include -I/home/santos/ncs/v3.0.2/modules/hal/nordic/nrfx/mdk -I/home/santos/ncs/v3.0.2/zephyr/modules/hal_nordic/nrfx/. -I/home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/life_finder_nrfconn_3x/modules/libmetal/libmetal/lib/include -I/home/santos/ncs/v3.0.2/modules/lib/open-amp/open-amp/lib/include -I/home/santos/ncs/v3.0.2/modules/debug/segger/SEGGER -I/home/santos/ncs/v3.0.2/modules/debug/segger/Config -I/home/santos/ncs/v3.0.2/modules/lib/zcbor/include -I/home/santos/ncs/v3.0.2/nrfxlib/softdevice_controller/include -I/home/santos/ncs/v3.0.2/nrfxlib/nrf_rpc/include -I/home/santos/ncs/v3.0.2/nrfxlib/nrf_dm/include -I/home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/life_finder_nrfconn_3x/generated/library_nrf_security_psa -I/home/santos/ncs/v3.0.2/nrf/subsys/nrf_security/include -I/home/santos/ncs/v3.0.2/modules/crypto/oberon-psa-crypto/oberon/drivers -I/home/santos/ncs/v3.0.2/nrf/subsys/nrf_security/src/utils -I/home/santos/ncs/v3.0.2/modules/crypto/oberon-psa-crypto/include -I/home/santos/ncs/v3.0.2/modules/crypto/oberon-psa-crypto/library -I/home/santos/ncs/v3.0.2/modules/crypto/mbedtls/library -I/home/santos/ncs/v3.0.2/modules/crypto/mbedtls/include -I/home/santos/ncs/v3.0.2/modules/crypto/mbedtls/include/library -I/home/santos/ncs/v3.0.2/nrfxlib/crypto/nrf_oberon/include -I/home/santos/ncs/v3.0.2/nrfxlib/crypto/nrf_oberon/include/mbedtls -I/home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -isystem /home/santos/ncs/v3.0.2/zephyr/lib/libc/common/include -isystem /home/santos/ncs/v3.0.2/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Og -imacros /home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/life_finder_nrfconn_3x/zephyr/include/generated/zephyr/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 -mtp=soft --sysroot=/home/santos/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/santos/ncs/v3.0.2/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -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=/home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/santos/ncs/v3.0.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/santos/ncs/v3.0.2=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_uart.c.obj -MF zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_uart.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/subsys/logging/backends/log_backend_uart.c.obj -c /home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c
In file included from /home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_macro.h:34,
from /home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util.h:17,
from /home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/cbprintf_internal.h:15,
from /home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/cbprintf.h:124,
from /home/santos/ncs/v3.0.2/zephyr/include/zephyr/logging/log_msg.h:11,
from /home/santos/ncs/v3.0.2/zephyr/include/zephyr/logging/log_backend.h:9,
from /home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:8:
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c: In function 'char_out':
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:41: error: '__device_dts_ord_148' undeclared (first use in this function); did you mean '__device_dts_ord_108'?
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) __VA_ARGS__
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_macro.h:196:9: note: in expansion of macro 'Z_COND_CODE_1'
196 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:38:9: note: in expansion of macro 'COND_CODE_1'
38 | COND_CODE_1(DT_HAS_CHOSEN(zephyr_log_uart), (ctx->uart_dev), \
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/toolchain/common.h:138:23: note: in expansion of macro '_DO_CONCAT'
138 | #define _CONCAT(x, y) _DO_CONCAT(x, y)
| ^~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:33: note: in expansion of macro '_CONCAT'
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:237:37: note: in expansion of macro 'DEVICE_NAME_GET'
237 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:254:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
254 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:39:22: note: in expansion of macro 'DEVICE_DT_GET'
39 | (DEVICE_DT_GET(DT_CHOSEN(zephyr_console))))
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:87:41: note: in expansion of macro 'LBU_UART_DEV'
87 | const struct device *uart_dev = LBU_UART_DEV(cb_ctx);
| ^~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:41: note: each undeclared identifier is reported only once for each function it appears in
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) __VA_ARGS__
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_macro.h:196:9: note: in expansion of macro 'Z_COND_CODE_1'
196 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:38:9: note: in expansion of macro 'COND_CODE_1'
38 | COND_CODE_1(DT_HAS_CHOSEN(zephyr_log_uart), (ctx->uart_dev), \
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/toolchain/common.h:138:23: note: in expansion of macro '_DO_CONCAT'
138 | #define _CONCAT(x, y) _DO_CONCAT(x, y)
| ^~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:33: note: in expansion of macro '_CONCAT'
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:237:37: note: in expansion of macro 'DEVICE_NAME_GET'
237 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:254:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
254 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:39:22: note: in expansion of macro 'DEVICE_DT_GET'
39 | (DEVICE_DT_GET(DT_CHOSEN(zephyr_console))))
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:87:41: note: in expansion of macro 'LBU_UART_DEV'
87 | const struct device *uart_dev = LBU_UART_DEV(cb_ctx);
| ^~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c: In function 'log_backend_uart_init':
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:41: error: '__device_dts_ord_148' undeclared (first use in this function); did you mean '__device_dts_ord_108'?
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) __VA_ARGS__
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_macro.h:196:9: note: in expansion of macro 'Z_COND_CODE_1'
196 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:38:9: note: in expansion of macro 'COND_CODE_1'
38 | COND_CODE_1(DT_HAS_CHOSEN(zephyr_log_uart), (ctx->uart_dev), \
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/toolchain/common.h:138:23: note: in expansion of macro '_DO_CONCAT'
138 | #define _CONCAT(x, y) _DO_CONCAT(x, y)
| ^~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:33: note: in expansion of macro '_CONCAT'
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:237:37: note: in expansion of macro 'DEVICE_NAME_GET'
237 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:254:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
254 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:39:22: note: in expansion of macro 'DEVICE_DT_GET'
39 | (DEVICE_DT_GET(DT_CHOSEN(zephyr_console))))
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:150:41: note: in expansion of macro 'LBU_UART_DEV'
150 | const struct device *uart_dev = LBU_UART_DEV(ctx);
| ^~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c: In function 'panic':
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:41: error: '__device_dts_ord_148' undeclared (first use in this function); did you mean '__device_dts_ord_108'?
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
72 | #define __DEBRACKET(...) __VA_ARGS__
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
64 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
| ^~~~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
59 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/sys/util_macro.h:196:9: note: in expansion of macro 'Z_COND_CODE_1'
196 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:38:9: note: in expansion of macro 'COND_CODE_1'
38 | COND_CODE_1(DT_HAS_CHOSEN(zephyr_log_uart), (ctx->uart_dev), \
| ^~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/toolchain/common.h:138:23: note: in expansion of macro '_DO_CONCAT'
138 | #define _CONCAT(x, y) _DO_CONCAT(x, y)
| ^~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:96:33: note: in expansion of macro '_CONCAT'
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:237:37: note: in expansion of macro 'DEVICE_NAME_GET'
237 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/include/zephyr/device.h:254:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
254 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:39:22: note: in expansion of macro 'DEVICE_DT_GET'
39 | (DEVICE_DT_GET(DT_CHOSEN(zephyr_console))))
| ^~~~~~~~~~~~~
/home/santos/ncs/v3.0.2/zephyr/subsys/logging/backends/log_backend_uart.c:188:41: note: in expansion of macro 'LBU_UART_DEV'
188 | const struct device *uart_dev = LBU_UART_DEV(ctx);
| ^~~~~~~~~~~~
[201/749] Building C object zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/chk_fail.c.obj
ninja: build stopped: subcommand failed.
[15/30] No configure step for 'ipc_radio'
FAILED: _sysbuild/sysbuild/images/life_finder_nrfconn_3x-prefix/src/life_finder_nrfconn_3x-stamp/life_finder_nrfconn_3x-build /home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/_sysbuild/sysbuild/images/life_finder_nrfconn_3x-prefix/src/life_finder_nrfconn_3x-stamp/life_finder_nrfconn_3x-build
cd /home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/build/life_finder_nrfconn_3x && /home/santos/ncs/toolchains/7cbc0036f4/usr/local/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/santos/ncs/toolchains/7cbc0036f4/usr/local/bin/cmake --build /home/santos/Documents/FirmwareLifeFinder/life_finder_nrfconn_3x/buildThat my prj.conf:
# BT CONFIG_BT=y CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SCAN=y CONFIG_BT_SCAN_FILTER_ENABLE=y CONFIG_BT_SCAN_NAME_CNT=1 CONFIG_BT_SCAN_MANUFACTURER_DATA_CNT=1 CONFIG_BT_SCAN_WITH_IDENTITY=y CONFIG_BT_ID_MAX=1 CONFIG_BT_EXT_ADV=y # Revolog Patio LR Anchor nRF5340 CONFIG_BT_DEVICE_NAME="LF_NRF" CONFIG_BT_DDFS=y CONFIG_BT_RX_STACK_SIZE=8192 CONFIG_MPSL=y CONFIG_MPSL_TIMESLOT_SESSION_COUNT=1 # Distance Measurement CONFIG_DM_MODULE=y CONFIG_DM_TIMESLOT_RESCHEDULE=y # Test CONFIG_DM_TIMESLOT_QUEUE_LENGTH=80 CONFIG_DM_RANGING_OFFSET_US=2400000 # CONFIG_DM_TIMESLOT_QUEUE_COUNT_SAME_PEER=8 # CONFIG_DM_HIGH_PRECISION_CALC=y CONFIG_DM_GPIO_DEBUG=n CONFIG_DM_MODULE_LOG_LEVEL_DBG=n # LOG and RTT CONFIG_LOG=y CONFIG_CONSOLE=y CONFIG_RTT_CONSOLE=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=1024 # Debug options CONFIG_ASSERT=y CONFIG_ASSERT_VERBOSE=y CONFIG_DEBUG=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_OPTIMIZATIONS=y CONFIG_DEBUG_THREAD_INFO=y CONFIG_DEBUG_COREDUMP=y CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y # Init Stacks CONFIG_INIT_STACKS=y # Interrupts CONFIG_DYNAMIC_INTERRUPTS=y # Enable FOTA over Bluetooth LE CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y # Enable storage subsystem CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_FILE_SYSTEM=y #NUS # Enable the UART driver CONFIG_UART_ASYNC_API=y CONFIG_NRFX_UARTE2=y # Enable the NUS service CONFIG_BT_NUS=y # Don't get entropy from HCI on nRF5340 devices CONFIG_BT_HOST_CRYPTO_PRNG=y CONFIG_ENTROPY_BT_HCI=n CONFIG_HEAP_MEM_POOL_SIZE=2048 #END NUS
and my nrf5340dk_nrf5340_cpuapp.overlay:
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
/ {
chosen {
/delete-property/ zephyr,ipc_shm;
/delete-property/ nordic,pm-ext-flash;
zephyr,sram = &sram0_image;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,sram-secure-partition = &sram0_s;
zephyr,sram-non-secure-partition = &sram0_ns;
zephyr,ieee802154 = &ieee802154;
zephyr,display = &st7789v;
zephyr,rtc = &rv_8263_c8;
nordic,pm-ext-flash = &mx25r80;
nordic,nus-uart = &uart2;
};
reserved-memory {
/delete-node/ memory@20070000;
sram_ipc0: memory@20070000 {
reg = <0x20070000 0x8000>;
};
sram_ipc1: memory@20078000 {
reg = <0x20078000 0x8000>;
};
};
ipc {
/delete-node/ ipc0;
ipc0: ipc0 {
compatible = "zephyr,ipc-openamp-static-vrings";
memory-region = <&sram_ipc0>;
mboxes = <&mbox 0>, <&mbox 1>;
mbox-names = "tx", "rx";
role = "host";
status = "okay";
bt_hci_ipc0: bt_hci_ipc0 {
compatible = "zephyr,bt-hci-ipc";
status = "okay";
};
};
ipc1: ipc1 {
compatible = "zephyr,ipc-openamp-static-vrings";
memory-region = <&sram_ipc1>;
mboxes = <&mbox 2>, <&mbox 3>;
mbox-names = "tx", "rx";
role = "host";
zephyr,buffer-size = <2048>;
status = "okay";
};
};
buttons {
/delete-node/ button0;
/delete-node/ button1;
/delete-node/ button2;
/delete-node/ button3;
};
leds {
/delete-node/ led0;
/delete-node/ led1;
/delete-node/ led2;
/delete-node/ led3;
};
arduino_header: connector {
status = "disabled";
};
gpio_fwd {
status = "disabled";
};
aliases {
imu = &bmi270;
ipc0 = &ipc0;
sx1280 = &sx1280;
watchdog0 = &wdt0;
/delete-property/ led0;
/delete-property/ led1;
/delete-property/ led2;
/delete-property/ led3;
/delete-property/ sw1;
/delete-property/ sw2;
/delete-property/ sw3;
/delete-property/ bootloader-led0;
/delete-property/ mcuboot-button0;
/delete-property/ mcuboot-led0;
/delete-property/ pwm-led0;
};
mipi_dbi_st7789v {
compatible = "zephyr,mipi-dbi-spi";
spi-dev = <&spi3>;
dc-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
write-only;
#address-cells = <1>;
#size-cells = <0>;
st7789v: st7789v@0 {
compatible = "sitronix,st7789v";
mipi-max-frequency = <8000000>;
reg = <0>;
width = <240>;
height = <240>;
x-offset = <80>;
y-offset = <0>;
vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0xA0>;
gamma = <0x01>;
colmod = <0x05>;
lcm = <0x2c>;
porch-param = [ 0c 0c 00 33 33 ];
cmd2en-param = [ 5a 69 02 01 ];
pwctrl1-param = [ a4 a1 ];
pvgam-param = [ D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23 ];
nvgam-param = [ D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23 ];
ram-param = [ 00 F0 ];
rgb-param = [ CD 08 14 ];
mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
};
};
pwmleds {
compatible = "pwm-leds";
/delete-node/ pwm_led0;
backlight: backlight {
pwms = <&pwm0 0 PWM_MSEC(50) PWM_POLARITY_NORMAL>;
};
motor: motor {
pwms = <&pwm2 0 PWM_MSEC(50) PWM_POLARITY_NORMAL>;
label = "motor";
};
buzzer: buzzer {
pwms = <&pwm3 0 PWM_MSEC(50) PWM_POLARITY_NORMAL>;
label = "buzzer";
};
};
pins_io {
compatible = "gpio-keys";
key1: key1 {
gpios = <&gpio0 31 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "key1";
zephyr,code = <INPUT_KEY_0>;
};
en_motor: en_motor {
gpios = <&gpio0 8 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
label = "en_motor";
zephyr,code = <INPUT_KEY_0>;
};
};
zephyr,user {
io-channels = <&adc 5>;
bq24040-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
bmi270-int1-gpios = <&gpio1 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
bmi270-int2-gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
arduino_adc: analog-connector {
status = "disabled";
};
gpio_fwd: nrf-gpio-forwarder {
status = "disabled";
/delete-node/ uart;
};
};
&adc {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@5 {
reg = <5>;
zephyr,gain = "ADC_GAIN_1_2";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
zephyr,input-positive = <NRF_SAADC_AIN5>;
zephyr,resolution = <12>;
};
};
&mx25r64 {
status = "disabled";
};
&uicr {
nfct-pins-as-gpios;
};
&lfxo {
status = "disabled";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&rtc0 {
status = "okay";
};
&qspi {
status = "disabled";
};
&nfct {
status = "disabled";
};
&uart0 {
status = "disabled";
};
arduino_serial: &uart1 {
status = "disabled";
};
arduino_i2c: &i2c1 {
status = "disabled";
};
arduino_spi: &spi4 {
status = "disabled";
};
&uart1 {
status = "disabled";
};
&uart2 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart2_default>;
pinctrl-1 = <&uart2_sleep>;
pinctrl-names = "default", "sleep";
};
&spi4 {
status = "disabled";
};
zephyr_udc0: &usbd {
status = "disabled";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_backlight_default>;
pinctrl-1 = <&pwm0_backlight_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm2 {
status = "okay";
pinctrl-0 = <&pwm2_motor_default>;
pinctrl-1 = <&pwm2_motor_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm3 {
status = "okay";
pinctrl-0 = <&pwm3_buzzer_default>;
pinctrl-1 = <&pwm3_buzzer_sleep>;
pinctrl-names = "default", "sleep";
};
&spi0 {
compatible = "nordic,nrf-spim";
status = "okay";
cs-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
overrun-character = <0x00>;
pinctrl-0 = <&spi0_sx128x_default>;
pinctrl-1 = <&spi0_sx128x_sleep>;
pinctrl-names = "default", "sleep";
sx1280: sx1280@0 {
compatible = "semtech,sx1262";
status = "okay";
reg = <0x0>;
spi-max-frequency = <8000000>;
reset-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
busy-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
dio1-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
};
};
&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";
cs-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi3_st7789v_default>;
pinctrl-1 = <&spi3_st7789v_sleep>;
pinctrl-names = "default", "sleep";
};
&qspi {
status = "okay";
pinctrl-0 = <&qspi_default>;
pinctrl-1 = <&qspi_sleep>;
pinctrl-names = "default", "sleep";
mx25r80: mx25r8035f@0 {
compatible = "nordic,qspi-nor";
reg = <0>;
/* MX25R80 supports only pp and pp4io */
writeoc = "pp4io";
/* MX25R80 supports all readoc options */
readoc = "read4io";
sck-frequency = <8000000>;
size = <0x800000>;
jedec-id = [c2 28 14];
sfdp-bfp = [
e5 20 f1 ff ff ff 7f 00 44 eb 08 6b 08 3b 04 bb
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
10 d8 00 ff 23 72 f5 00 82 ed 04 b7 44 83 38 44
30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
];
has-dpd;
t-enter-dpd = <10000>;
t-exit-dpd = <35000>;
};
};
&i2c1 {
status = "okay";
compatible = "nordic,nrf-twim";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
/* One-shot, contiguous transfers up to 257 bytes */
zephyr,concat-buf-size = <257>;
rv_8263_c8: rv-8263-c8@51 {
status = "okay";
compatible = "microcrystal,rv-8263-c8";
reg = <0x51>;
label = "rv-8263-c8";
};
bmi270: bmi270@68 {
status = "okay";
compatible = "i2c-device";
reg = <0x68>;
label = "bmi270";
};
};
&pinctrl {
/delete-node/ pwm0_default;
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
bias-pull-up;
nordic,drive-mode = <NRF_DRIVE_E0E1>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
low-power-enable;
};
};
pwm0_backlight_default: pwm0_backlight_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 28)>;
nordic,invert;
bias-pull-down;
};
};
pwm0_backlight_sleep: pwm0_backlight_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 28)>;
low-power-enable;
};
};
pwm2_motor_default: pwm2_motor_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 12)>;
nordic,invert;
bias-pull-down;
};
};
pwm2_motor_sleep: pwm2_motor_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 12)>;
low-power-enable;
};
};
pwm3_buzzer_default: pwm3_buzzer_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 20)>;
nordic,drive-mode = <NRF_DRIVE_H0H1>;
nordic,invert;
bias-pull-down;
};
};
pwm3_buzzer_sleep: pwm3_buzzer_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 20)>;
low-power-enable;
};
};
spi0_sx128x_default: spi0_sx128x_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
<NRF_PSEL(SPIM_MOSI, 0, 0)>,
<NRF_PSEL(SPIM_MISO, 0, 4)>;
bias-pull-down;
};
};
spi0_sx128x_sleep: spi0_sx128x_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
<NRF_PSEL(SPIM_MOSI, 0, 0)>,
<NRF_PSEL(SPIM_MISO, 0, 4)>;
low-power-enable;
};
};
uart2_default: uart2_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 12)>,
<NRF_PSEL(UART_RTS, 1, 14)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 1, 10)>,
<NRF_PSEL(UART_CTS, 1, 7)>;
bias-pull-up;
};
};
uart2_sleep: uart2_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 12)>,
<NRF_PSEL(UART_RX, 1, 10)>,
<NRF_PSEL(UART_RTS, 1, 14)>,
<NRF_PSEL(UART_CTS, 1, 7)>;
low-power-enable;
};
};
spi3_st7789v_default: spi3_st7789v_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
<NRF_PSEL(SPIM_MOSI, 0, 30)>,
<NRF_PSEL(SPIM_MISO, 1, 15)>; // no connected
bias-pull-down;
};
};
spi3_st7789v_sleep: spi3_st7789v_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
<NRF_PSEL(SPIM_MOSI, 0, 30)>,
<NRF_PSEL(SPIM_MISO, 1, 15)>; // no connected
low-power-enable;
};
};
qspi_default: qspi_default {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 17)>,
<NRF_PSEL(QSPI_IO0, 0, 13)>,
<NRF_PSEL(QSPI_IO1, 0, 14)>,
<NRF_PSEL(QSPI_IO2, 0, 15)>,
<NRF_PSEL(QSPI_IO3, 0, 16)>,
<NRF_PSEL(QSPI_CSN, 0, 18)>;
nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
};
qspi_sleep: qspi_sleep {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 17)>,
<NRF_PSEL(QSPI_IO0, 0, 13)>,
<NRF_PSEL(QSPI_IO1, 0, 14)>,
<NRF_PSEL(QSPI_IO2, 0, 15)>,
<NRF_PSEL(QSPI_IO3, 0, 16)>;
low-power-enable;
};
group2 {
psels = <NRF_PSEL(QSPI_CSN, 0, 18)>;
low-power-enable;
bias-pull-up;
};
};
};
Could you please help me understand what might be causing this issue or if there are any limitations or configuration requirements when using NUS alongside DM on the nRF5340 APP_CORE?
Thank you in advance for your support.