nRF5340 DTM Serial Pin Modification Unsuccessful

Dear Nordic,

I have custom nRF5340 board in my hands and I am going to evaluate its RF performance.

I have ncs2.3.0 in use.

In order to do so, I have nRF5340dk (PCA10095) and I have successfully built the default ncs -> samples -> direct_test_mode example and verified that using RealTerm, the transmitter gets active.

However, my custom board has a few GPIOs interfaced outside, no USB, and I would first like to verify with the dk board that I can control the transmitter using the very same GPIOS. Let us assume that the GPIOs are P0.08 (RX) and P0.09 (TX). I tried to add the GPIOs to the nrf5340dk_nrf5340_cpunet.overlay file as attached but building it failed. 

Could you advise me little bit that how I am supposed to change the uart pins for the DTM mode?

/ {
	chosen {
		ncs,dtm-uart = &uart0;
	};
};

&uart0 {
	status = "okay";
	compatible = "nordic,nrf-ipc-uart";
	ipc = <&ipc0>;
	ept-name = "remote shell";
	current-speed = <19200>;
	tx-pin = < 8 >;
	rx-pin = < 9 >;
};

&radio {
	status = "okay";
	/* This is a number of antennas that are available on antenna matrix
	 * designed by Nordic. For more information see README.rst.
	 */
	dfe-antenna-num = <12>;
	/* This is a setting that enables antenna 12 (in antenna matrix designed
	 * by Nordic) for PDU. For more information see README.rst.
	 */
	dfe-pdu-antenna = <0x0>;

	/* These are GPIO pin numbers that are provided to
	 * Radio peripheral. The pins will be acquired by Radio to
	 * drive antenna switching.
	 * Pin numbers are selected to drive switches on antenna matrix
	 * desinged by Nordic. For more information see README.rst.
	 */
	dfegpio0-gpios = <&gpio0 4 0>;
	dfegpio1-gpios = <&gpio0 5 0>;
	dfegpio2-gpios = <&gpio0 6 0>;
	dfegpio3-gpios = <&gpio0 7 0>;
};
FAILED: build.ninja
C:\ncs\toolchains\v2.3.0\opt\bin\cmake.exe --regenerate-during-build -SC:\ncs\v2.3.0\nrf\samples\bluetooth\direct_test_mode -BC:\ncs\v2.3.0\nrf\samples\bluetooth\direct_test_mode\build
ninja: error: rebuilding 'build.ninja': subcommand failed
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.3.0\opt\bin\cmake.EXE' --build 'c:\ncs\v2.3.0\nrf\samples\bluetooth\direct_test_mode\build'
Parents
  • Hi,

     

    There was a change introduced in ncs v2.2.0, where the default behavior of the dtm example was changed to use the application core uart instead of the network core.

    Here's a howto on using the pre-v2.2 setup running on network core, if that is what you want:

     RE: DTM (direct test mode) connect fail in ncs v2.2.0 

     

    If you choose to use the current default setup in ncs v2.2.0 and newer, which is RPC-based communication from app-core to net-core, then you need to overlay the child_image, more specifically this file:

    https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.overlay

    Here's an example:

    /*
     * Copyright (c) 2022 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
     */
    
    / {
    	chosen {
    		zephyr,shell-ipc = &ipc0;
    		ncs,remote-shell-uart = &uart0;
    	};
    };
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 9)>,
    				<NRF_PSEL(UART_RTS, 1, 7)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_CTS, 1, 6)>;
    			bias-pull-up;
    		};
    	};
    };
    
    &uart0 {
    	status = "okay";
    	current-speed = <19200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";	
    };
    
    &gpio_fwd {
    	dfe-radio {
    	    gpios = <&gpio0 4 0>,
    		<&gpio0 5 0>,
    		<&gpio0 6 0>,
    		<&gpio0 7 0>;
    	};
    };

     

    Kind regards,

    Håkon

  • I'm glad to hear!

    Hope you have a wonderful day!

     

    Kind regards,

    Håkon

  • One more thing: How can I set the output power to lower levels, 0 dBm, -20dBm, -30 dBm etc? I am echoing the hexes to serial device. I can only know the echo -ne "\x80\x96" > /dev/myserial_device.  I tried to find information about this without success.

  • Hi,

     

    I do not have the direct sequence, but here's from the log itself in the DTM application when setting -20 dBm.

    2023-03-23T15:09:56.364Z INFO Running device setup
    2023-03-23T15:09:56.364Z DEBUG DTM Transport: Create setup CMD with control: 0
    2023-03-23T15:09:56.365Z DEBUG DTM Transport: Create setup CMD with parameter: 0
    2023-03-23T15:09:56.365Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.365Z DEBUG DTM Transport: Sending data: 0x00 0x00
    2023-03-23T15:09:56.371Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.371Z DEBUG DTM Transport: Create tx power CMD: 44
    2023-03-23T15:09:56.371Z DEBUG DTM Transport: Sending data: 0xAC 0x0B
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Create setup CMD with control: 1
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Create setup CMD with parameter: 0
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Sending data: 0x01 0x00
    2023-03-23T15:09:56.385Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Create setup CMD with control: 3
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Create setup CMD with parameter: 0
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Sending data: 0x03 0x00
    2023-03-23T15:09:56.392Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.392Z DEBUG DTM Transport: Create setup CMD with control: 2
    2023-03-23T15:09:56.392Z DEBUG DTM Transport: Create setup CMD with parameter: 1
    2023-03-23T15:09:56.393Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.393Z DEBUG DTM Transport: Sending data: 0x02 0x04
    2023-03-23T15:09:56.398Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.398Z INFO Starting test
    2023-03-23T15:09:56.406Z DEBUG DTM Transport: Create transmitter CMD with frequency: 2402
    2023-03-23T15:09:56.406Z DEBUG DTM Transport: Create transmitter CMD with length: 0
    2023-03-23T15:09:56.406Z DEBUG DTM Transport: Create transmitter CMD with packet type: 3
    2023-03-23T15:09:56.426Z DEBUG DTM Transport: Sending data: 0x80 0x03
    2023-03-23T15:09:56.435Z DEBUG DTM Transport: Receiving data: 0x00 0x00

     

    You can also have a look at this DTM PC application:

    https://github.com/olleheugene/nRF-DTM

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    I do not have the direct sequence, but here's from the log itself in the DTM application when setting -20 dBm.

    2023-03-23T15:09:56.364Z INFO Running device setup
    2023-03-23T15:09:56.364Z DEBUG DTM Transport: Create setup CMD with control: 0
    2023-03-23T15:09:56.365Z DEBUG DTM Transport: Create setup CMD with parameter: 0
    2023-03-23T15:09:56.365Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.365Z DEBUG DTM Transport: Sending data: 0x00 0x00
    2023-03-23T15:09:56.371Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.371Z DEBUG DTM Transport: Create tx power CMD: 44
    2023-03-23T15:09:56.371Z DEBUG DTM Transport: Sending data: 0xAC 0x0B
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Create setup CMD with control: 1
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Create setup CMD with parameter: 0
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.379Z DEBUG DTM Transport: Sending data: 0x01 0x00
    2023-03-23T15:09:56.385Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Create setup CMD with control: 3
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Create setup CMD with parameter: 0
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.386Z DEBUG DTM Transport: Sending data: 0x03 0x00
    2023-03-23T15:09:56.392Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.392Z DEBUG DTM Transport: Create setup CMD with control: 2
    2023-03-23T15:09:56.392Z DEBUG DTM Transport: Create setup CMD with parameter: 1
    2023-03-23T15:09:56.393Z DEBUG DTM Transport: Create setup CMD with dc type: 00
    2023-03-23T15:09:56.393Z DEBUG DTM Transport: Sending data: 0x02 0x04
    2023-03-23T15:09:56.398Z DEBUG DTM Transport: Receiving data: 0x00 0x00
    2023-03-23T15:09:56.398Z INFO Starting test
    2023-03-23T15:09:56.406Z DEBUG DTM Transport: Create transmitter CMD with frequency: 2402
    2023-03-23T15:09:56.406Z DEBUG DTM Transport: Create transmitter CMD with length: 0
    2023-03-23T15:09:56.406Z DEBUG DTM Transport: Create transmitter CMD with packet type: 3
    2023-03-23T15:09:56.426Z DEBUG DTM Transport: Sending data: 0x80 0x03
    2023-03-23T15:09:56.435Z DEBUG DTM Transport: Receiving data: 0x00 0x00

     

    You can also have a look at this DTM PC application:

    https://github.com/olleheugene/nRF-DTM

     

    Kind regards,

    Håkon

Children
Related