UART Pin Change with DTS Overlay

Hi,

I am trying to change the pins used from UART from the default pins TX:6, RX:8 to TX:9, RX:10

I am struggling to figure out how to do this as whenever I update my .overlay file for my device tree I go from a working UART implementation to seeing no data pass between the devices.

Here is the DTS code I am using to make this pin change:

// &pinctrl {
//     uart0_default: uart0_default {
//         group1 {
//             psels = <NRF_PSEL(UART_TX, 0, 9)>,
//                     <NRF_PSEL(UART_RX, 0, 10)>;
//         };
//     };
//     /* required if CONFIG_PM_DEVICE=y */
//     uart0_sleep: uart0_sleep {
//         group1 {
//             psels = <NRF_PSEL(UART_TX, 0, 9)>,
//                     <NRF_PSEL(UART_RX, 0, 10)>;
//             low-power-enable;
//         };
//     };
// };

Is there something I am missing here?

Here is what the device GUI looks like before and after the change-

Before (UART works correctly):

After (UART not working):

Thanks!

Parents Reply Children
  • Hi,

    the pins for UART zero were assigned by default in the app-pinctrl.dtsi file as shown below

    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_RTS, 0, 5)>,
    				<NRF_PSEL(UART_CTS, 0, 7)>;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_RTS, 0, 5)>,
    				<NRF_PSEL(UART_CTS, 0, 7)>;
    			low-power-enable;
    		};
    	};

    This being said, these lines are faded becuase they are being overriden by the lines in my overlay file described above. I have also tried changing these lines directly without using an overlay and I encounter the same issue.

    The only other place uart0 is defined is in the app.dts file but these line referece the pin control file to declare the pins as seen below:

    arduino_serial: &uart0 {
    	status = "okay";
    	compatible = "nordic,nrf-uarte";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    Let me know if I can provide any more info that my be relevant to this.

    Thanks!

Related