How to let hci uart work on nRF5340

I want to use hci uart function on nRF5340 board, but it doesn't work after I flash image to it. 

BTW, my nRF Connect SDK is v2.0.0, and Windows 11 system.

and I followed the suggestion from this website:

(+) nRF5340-DK : trouble with hci_uart sample - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

use uart1 to work as hci uart, but I can't set uart TX/RX to certain pins, i changed nrf5340dk_nrf5340_cpuapp.overlay file like this:

/* SPDX-License-Identifier: Apache-2.0 */

&uart1 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
status = "okay";
hw-flow-control;
rx-pin = <44>;
tx-pin = <45>;
cts-pin = <46>;
rts-pin = <47>;
};
/ {
chosen {
zephyr,bt-c2h-uart=&uart1;
};
};

then it failed to build like this:

[18/173] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
FAILED: zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
C:\ncs\toolchains\v2.0.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I../../../../include/zephyr -I../../../../include -Izephyr/include/generated -I../../../../soc/arm/nordic_nrf/nrf53 -I../../../../soc/arm/nordic_nrf/common/. -I../../../../subsys/bluetooth -IC:/ncs/v2.0.0/nrf/include -IC:/ncs/v2.0.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.0.0/modules/hal/nordic/nrfx -IC:/ncs/v2.0.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.0.0/modules/hal/nordic/nrfx/mdk -I../../../../modules/hal_nordic/nrfx/. -Imodules/libmetal/libmetal/lib/include -IC:/ncs/v2.0.0/modules/lib/open-amp/open-amp/lib/include -IC:/ncs/v2.0.0/nrfxlib/softdevice_controller/include -isystem ../../../../lib/libc/minimal/include -isystem c:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem c:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -isystem C:/ncs/v2.0.0/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/ncs/v2.0.0/zephyr/samples/bluetooth/hci_uart/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/ncs/v2.0.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/ncs/v2.0.0/zephyr/samples/bluetooth/hci_uart=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.0.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.0.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj -MF zephyr\drivers\serial\CMakeFiles\drivers__serial.dir\uart_nrfx_uarte.c.obj.d -o zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj -c C:/ncs/v2.0.0/zephyr/drivers/serial/uart_nrfx_uarte.c
In file included from c:\ncs\v2.0.0\zephyr\include\zephyr\toolchain.h:50,
from c:\ncs\v2.0.0\zephyr\include\zephyr\sys\errno_private.h:10,
from c:\ncs\v2.0.0\zephyr\lib\libc\minimal\include\errno.h:32,
from c:\ncs\v2.0.0\zephyr\include\zephyr\drivers\uart.h:23,
from C:\ncs\v2.0.0\zephyr\drivers\serial\uart_nrfx_uarte.c:11:
c:\ncs\v2.0.0\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:229:2: error: static assertion failed: "/soc/peripheral@50000000/uart@9000 has legacy *-pin properties defined although PINCTRL is enabled"
229 | BUILD_ASSERT(!IS_ENABLED(CONFIG_PINCTRL) || \
| ^~~~~~~~~~~~
C:\ncs\v2.0.0\zephyr\drivers\serial\uart_nrfx_uarte.c:2053:2: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
2053 | NRF_DT_CHECK_PIN_ASSIGNMENTS(UARTE(idx), 1, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\ncs\v2.0.0\zephyr\drivers\serial\uart_nrfx_uarte.c:2147:1: note: in expansion of macro 'UART_NRF_UARTE_DEVICE'
2147 | UART_NRF_UARTE_DEVICE(1);
| ^~~~~~~~~~~~~~~~~~~~~
[30/173] Building C object zephyr/drivers/mbox/CMakeFiles/drivers__mbox.dir/mbox_nrfx_ipc.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.0.0\opt\bin\cmake.EXE' --build 'c:\ncs\v2.0.0\zephyr\samples\bluetooth\hci_uart\build'

So guys, any good ideas? thanks.

Parents Reply
  • Just to verify, does this mean you are building the HCI UART project for the network core (nrf5340_audio_dk_nrf5340_cpunet)?

    Hi Marte, 

    Sorry for answering your question so late.

    My description was a little obscure before.

    So I try my best to describe my requirements clearly here.

    I have two NRF5340 Audio DK boards, and I want to let one work as Controller, and another works as Host, these two boards are connected by HCI UART.

    So my questions are like these:

    1. How to build an image works as Controller?

    2. Do there any default pins work as HCI UART for Controller? if yes, please show me their positions on the board; if not, how can I set them?

    3. How to build an image works as Host?

    4. Do there any default pins work as HCI UART for Host? if yes, please show me their positions on the board; if not, how can I set them?

    Thanks for your great patience!

    Best regards,

    Handom

Children
Related