RF Test on custom board (nrf5340 + nrf21540)

Hello,

I create a custom board based on nRF5340 with a FEM nRF21540 and I would like to test radio part with some fixed frequency test.

It seems that SDK (nrf connect 2.4) provides a sample for RF test (Direct Test Mode).

After adding my board in the "Direct Test Mode" project, I meet some build error:

Executing task: nRF Connect: Generate config erl_nrf5340_cpunet for /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode 

Building direct_test_mode
/bin/sh -c west build --build-dir /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode --pristine --board erl_nrf5340_cpunet --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode" -DCONFIG_DTM_USB="y"

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode
-- CMake version: 3.20.5
-- Found Python3: /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/usr/local/bin/python3.8 (found suitable exact version "3.8.2") found components: Interpreter 
-- Cache files will be written to: /home/bgorostidi/.cache/zephyr
-- Zephyr version: 3.3.99 (/home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/v2.4.0/zephyr)
-- Found west (found suitable version "1.0.0", minimum required is "0.7.1")
-- Board: erl_nrf5340_cpunet
-- Found host-tools: zephyr 0.16.0 (/home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.0 (/home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/opt/zephyr-sdk)
-- Found Dtc: /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/usr/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/boards/arm/erl_nrf5340/erl_nrf5340_cpunet.dts
-- Found devicetree overlay: /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/boards/erl_nrf5340_cpunet.overlay
-- Generated zephyr.dts: /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/zephyr/dts.cmake
Parsing /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/Kconfig
Loaded configuration '/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/boards/arm/erl_nrf5340/erl_nrf5340_cpunet_defconfig'
Merged configuration '/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/prj.conf'
Merged configuration '/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/boards/erl_nrf5340_cpunet.conf'
Merged configuration '/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/zephyr/.config'
Kconfig header saved to '/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/zephyr/include/generated/autoconf.h'

warning: Experimental symbol DTM_USB is enabled.

-- Found GnuLd: /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (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: /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
CMake Error at /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/v2.4.0/nrf/cmake/multi_image.cmake:199 (message):
  No board specified for domain 'CPUAPP'.  This configuration is typically
  defined in
  /home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/boards/arm/erl_nrf5340/Kconfig
Call Stack (most recent call first):
  /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/v2.4.0/nrf/cmake/multi_image.cmake:169 (add_child_image_from_source)
  /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/v2.4.0/nrf/samples/CMakeLists.txt:56 (add_child_image)


-- Configuring incomplete, errors occurred!
See also "/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/CMakeFiles/CMakeOutput.log".
See also "/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl/CMakeFiles/CMakeError.log".
FATAL ERROR: command exited with status 1: /home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/usr/local/bin/cmake -DWEST_PYTHON=/home/bgorostidi/Workspace/Toolchains/nrfConnect_SDK/toolchains/1f9b40e71a/usr/local/bin/python3.8 -B/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode/build_erl -GNinja -DBOARD=erl_nrf5340_cpunet -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode -DCONFIG_DTM_USB=y -S/home/bgorostidi/Workspace/Projects/Iot/nrf53_test/direct_test_mode

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

My custom board has an UART0  (only TX) for debug and USB capability.

Best regards.

8132.direct_test_mode.zip

  • You can found it in the zip file uploaded in my first message. Let me know if you cannot access to the file.

  • Sorry, I did not notice your attachment earlier. Please try the modified version of your project included below and see if that works for you. 

    8524.direct_test_mode.zip

    diff --git a/boards/arm/erl_nrf5340/Kconfig.board b/boards/arm/erl_nrf5340/Kconfig.board
    index acca550..0566ae9 100644
    --- a/boards/arm/erl_nrf5340/Kconfig.board
    +++ b/boards/arm/erl_nrf5340/Kconfig.board
    @@ -13,6 +13,6 @@ config BOARD_ERL_NRF5340_CPUAPP_NS
     
     endif # SOC_NRF5340_CPUAPP_QKAA
     
    -config BOARD_ERL_NRF5340_CPUAPP_CPUNET
    +config BOARD_ERL_NRF5340_CPUNET
     	bool "ERL NRF5340 Network MCU"
     	depends on SOC_NRF5340_CPUNET_QKAA
    diff --git a/boards/arm/erl_nrf5340/Kconfig.defconfig b/boards/arm/erl_nrf5340/Kconfig.defconfig
    index 974e5e0..f87f923 100644
    --- a/boards/arm/erl_nrf5340/Kconfig.defconfig
    +++ b/boards/arm/erl_nrf5340/Kconfig.defconfig
    @@ -74,7 +74,7 @@ endif # BOARD_ERL_NRF5340_CPUAPP_NS
     endif # BOARD_ERL_NRF5340_CPUAPP || BOARD_ERL_NRF5340_CPUAPP_NS
     
     config BOARD
    -	default "erl_nrf5340_cpunet" if BOARD_ERL_NRF5340_CPUAPP_CPUNET
    +	default "erl_nrf5340_cpunet" if BOARD_ERL_NRF5340_CPUNET
     
     config MBOX_NRFX_IPC
     	default MBOX
    @@ -90,9 +90,9 @@ config HEAP_MEM_POOL_SIZE
     
     endif #  BOARD_ERL_NRF5340_CPUAPP || BOARD_ERL_NRF5340_CPUAPP_NS
     
    -if BOARD_ERL_NRF5340_CPUAPP_CPUNET
    +if BOARD_ERL_NRF5340_CPUNET
     
     config BT_CTLR
     	default y if BT
     
    -endif # BOARD_ERL_NRF5340_CPUAPP_CPUNET
    +endif # BOARD_ERL_NRF5340_CPUNET
    diff --git a/boards/arm/erl_nrf5340/erl_nrf5340_cpunet_defconfig b/boards/arm/erl_nrf5340/erl_nrf5340_cpunet_defconfig
    index 6228a45..a2dae95 100644
    --- a/boards/arm/erl_nrf5340/erl_nrf5340_cpunet_defconfig
    +++ b/boards/arm/erl_nrf5340/erl_nrf5340_cpunet_defconfig
    @@ -2,7 +2,7 @@
     
     CONFIG_SOC_SERIES_NRF53X=y
     CONFIG_SOC_NRF5340_CPUNET_QKAA=y
    -CONFIG_BOARD_ERL_NRF5340_CPUAPP_CPUNET=y
    +CONFIG_BOARD_ERL_NRF5340_CPUNET=y
     
     # Enable MPU
     CONFIG_ARM_MPU=y
    diff --git a/boards/erl_nrf5340_cpunet.overlay b/boards/erl_nrf5340_cpunet.overlay
    index e218494..c289448 100644
    --- a/boards/erl_nrf5340_cpunet.overlay
    +++ b/boards/erl_nrf5340_cpunet.overlay
    @@ -10,4 +10,8 @@
     	ipc = <&ipc0>;
     	ept-name = "remote shell";
     	current-speed = <19200>;
    -};
    \ No newline at end of file
    +};
    +
    +&radio {
    +	/delete-property/ dfe-supported;
    +};

  • Thanks for the modified version of the project. I'm now able to build and flash the project.

    In our app, custom board provides 3 virtual serial ports through USB ACM, but with "Direct test mode" app, 4 serial ports are available. Direct Test Mode desktop app  detect "Nordic Remote Shell sample" device but cannot communicate with none of the 4 ports.

  • Please try with a serial terminal such as Putty or similar, and see if you can send the DTM commands manually as explained in the sample documentation.

  • DTM commands sended manualy doesn't have any effects on each of 4 ports.

Related