How to configure DTM or radio_test to use different uart pins?

I've got a custom board that puts UART_TX on P0.14 and UART_RX on P0.15, with no RTS or CTS signals. I've got a USB to UART cable that I've plugged in, and I know at the very least the TX line is working because I've seen data go from my custom board to the PC when using my application code.

However, I need to evaluate the performance of the radio circuitry and I cannot find any documentation about how to do this with a custom board. Everything uses the development kits, which is no good.

All I care about for now is generating carriers and modulated signals. I don't need to test inter-device connections yet.

I'm using the nrf connect SDK v2.6.0.

I've tried building the radio_test example, which I can get working on the nRF52 DK I've got. I can get it to build using my custom board overlay/Kconfig/defconfig files, but it doesn't seem to send or receive anything over the UART connection once it's been flashed to my custom board.

I've tried creating a new application based on the direct_test_mode application, but doesn't seem to be compatible with the nRF52832 dev kit, never mind a custom board.

I think the radio_test example is probably my best bet, but is there a simple guide as to how to change the UART pins? Does it need the RTS and CTS signals?

Parents
  • Ah, I've solved it, after a whole morning of bashing my head against a table. I'll document it here in case anyone else is having these issues.

    Turns out my modifications to the example radio_test project were on the right lines. I'd tried two things, firstly using my board files from another project and building it for that board, and secondly adding an overlay to the base project and using the nRF52 DK board with my special overlay to remap the UART to the correct pins.

    The reason neither of these worked is that my custom board doesn't have a low-frequency clock. When originally setting up my other project (that's building fine for this board) I'd put the configuration that defines how to use the LF clock into the project configuration instead of the board configuration, so it didn't get copied to the radio_test project. This was preventing the board from ever starting up and reaching main, never mind doing anything else.

    So the answer to the question I asked is to simply build the application targeting a different board with the uart pins defined correctly. Or to add an overlay. My dts now looks like this:

    \{
    ...
    
        chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    		zephyr,bt-mon-uart = &uart0;
    		zephyr,bt-c2h-uart = &uart0;
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    	};
    };
    
    &flash0 {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x0 0xc000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0xc000 0x32000>;
    		};
    		slot1_partition: partition@3e000 {
    			label = "image-1";
    			reg = <0x3e000 0x32000>;
    		};
    		scratch_partition: partition@70000 {
    			label = "image-scratch";
    			reg = <0x70000 0xa000>;
    		};
    		storage_partition: partition@7a000 {
    			label = "storage";
    			reg = <0x7a000 0x6000>;
    		};
    	};
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &uart0 {
    	status = "okay";
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default","sleep";
    	current-speed = <115200>;
    };
    
    &gpiote {
    	status = "okay";
    };

    And my defconfig:

    # SPDX-License-Identifier: Apache-2.0
    
    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52832_QFAA=y
    CONFIG_BOARD_YE001_NRF52832=y
    
    # Enable MPU
    CONFIG_ARM_MPU=y
    
    # Enable hardware stack protection
    CONFIG_HW_STACK_PROTECTION=y
    
    # Enable RTT
    CONFIG_USE_SEGGER_RTT=y
    
    # enable GPIO
    CONFIG_GPIO=y
    
    # enable uart driver
    CONFIG_SERIAL=y
    
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_CLOCK_CONTROL=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    

Reply
  • Ah, I've solved it, after a whole morning of bashing my head against a table. I'll document it here in case anyone else is having these issues.

    Turns out my modifications to the example radio_test project were on the right lines. I'd tried two things, firstly using my board files from another project and building it for that board, and secondly adding an overlay to the base project and using the nRF52 DK board with my special overlay to remap the UART to the correct pins.

    The reason neither of these worked is that my custom board doesn't have a low-frequency clock. When originally setting up my other project (that's building fine for this board) I'd put the configuration that defines how to use the LF clock into the project configuration instead of the board configuration, so it didn't get copied to the radio_test project. This was preventing the board from ever starting up and reaching main, never mind doing anything else.

    So the answer to the question I asked is to simply build the application targeting a different board with the uart pins defined correctly. Or to add an overlay. My dts now looks like this:

    \{
    ...
    
        chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    		zephyr,bt-mon-uart = &uart0;
    		zephyr,bt-c2h-uart = &uart0;
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    	};
    };
    
    &flash0 {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x0 0xc000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0xc000 0x32000>;
    		};
    		slot1_partition: partition@3e000 {
    			label = "image-1";
    			reg = <0x3e000 0x32000>;
    		};
    		scratch_partition: partition@70000 {
    			label = "image-scratch";
    			reg = <0x70000 0xa000>;
    		};
    		storage_partition: partition@7a000 {
    			label = "storage";
    			reg = <0x7a000 0x6000>;
    		};
    	};
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &uart0 {
    	status = "okay";
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default","sleep";
    	current-speed = <115200>;
    };
    
    &gpiote {
    	status = "okay";
    };

    And my defconfig:

    # SPDX-License-Identifier: Apache-2.0
    
    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52832_QFAA=y
    CONFIG_BOARD_YE001_NRF52832=y
    
    # Enable MPU
    CONFIG_ARM_MPU=y
    
    # Enable hardware stack protection
    CONFIG_HW_STACK_PROTECTION=y
    
    # Enable RTT
    CONFIG_USE_SEGGER_RTT=y
    
    # enable GPIO
    CONFIG_GPIO=y
    
    # enable uart driver
    CONFIG_SERIAL=y
    
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_CLOCK_CONTROL=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    

Children
No Data
Related