case about nRF54L15 dtm UART RX TX

Hi,

1. I am testing nRF54L15 PDK PCA10156 0.8.1 Example is: ncs\v2.8.0\nrf\samples\bluetooth\direct_test_mode
2. Which pins can be used as UART TX and which pins can be used as UART RX?
3. How do I switch between TX and RX in the example direct_test_mode code instead of the device tree
4. That is to switch the TX and RX IO ports while the code is running?

Thank you for all your assistance.
Kind regards,
Peter.Min

Parents
  • Hi Peter, 
    By default DTM uses uart20 as the UART port see nrf54l15dk_nrf54l15_cpuapp.overlay file. 

    The pins uart20 uses are:

    	/omit-if-no-ref/ uart20_default: uart20_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 1, 4)>,
    				<NRF_PSEL(UART_RTS, 1, 6)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 1, 5)>,
    				<NRF_PSEL(UART_CTS, 1, 7)>;
    			bias-pull-up;
    		};
    	};

    You can see this on the back side of the nRF54L DK. TXD= P1.04;RXD = P1.05

    3. If you want to change the UART pins, you can add that in the overlay file. For example, the following will reverse the TXD and RXD pins: 

    &pinctrl {
    	/omit-if-no-ref/ uart20_default: uart20_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 1, 5)>,
    				<NRF_PSEL(UART_RTS, 1, 6)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 1, 4)>,
    				<NRF_PSEL(UART_CTS, 1, 7)>;
    			bias-pull-up;
    		};
    	};
    };

    4. Please clarify what exactly you want to do. By default Zephyr doesn't allow changing pins dynamically in run time. 

  • Hi Hung Bui,

    1. This problem is caused by frequent modification and compilation of the dtm firmware serial port for testing.
    2. Therefore, it is hoped that the firmware can automatically test in the code to find the serial port IO port to do dtm and set its IO port as a serial port.

    Thank you for all your assistance.
    Kind regards,
    Peter.Min

  • Hi Peter, 

    I assume you want the firmware to be able to auto detect the UART pin and re-configure to use the pins as UART. Unfortunately it's not possible. 
    The only think I can think of is that you can have a switch on the board that control some GPIO pin state, and by checking the GPIO pins the firmware can find which configuration it should use (requires a boot up). 
    Please take a look here:https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/zephyr/samples/boards/nordic/dynamic_pinctrl/README.html
    Note: the board need to do a reset to change the pins. 

Reply Children
No Data
Related