Deleting properties for nodes in overlay dts file doesn't work.

Hi All,

I have nrf9160dk Board and wanted to use p0.14 & 15 pins but they are occupied by uart1 as rts and cts pins. So I created an overlay file to not edit directly board dts files and defined a uart1 node with /delete-property/ property.  But it didn't work. However, if I delete these pins from the main node in pin-control.dtsi, it works. is there anyone who can shed some light on how to delete-property through the overlay file?

Here are my overlay file definitions.

&pinctrl {
 uart1_default: uart1_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 31)>;
        };
        group2 {
            psels = <NRF_PSEL(UART_RX, 0, 30)>;

        };
       
    };

    uart1_sleep: uart1_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 31)>,
                <NRF_PSEL(UART_RX, 0, 30)>;
            low-power-enable;
        };
    };  
};
/* USB - UART */
&uart1 {
    status = "okay";
    current-speed = <115200>;
    pinctrl-0 = <&uart1_default>;
    pinctrl-1 = <&uart1_sleep>;
    /delete-property/ hw-flow-control;
    /delete-property/ rts-pin;
    /delete-property/ cts-pin;
    pinctrl-names = "default", "sleep";
};
  • Hello,

    I will have to get back to you on this next week.

    Regards,

    Elfving

  • Hello again, sorry about the wait.

    This is odd, because it looks correct to me. What sort of error are you getting?

    However, if I delete these pins from the main node in pin-control.dtsi, it works.

    So it is only the property deleting part you're replacing here, and getting it to work? The rest of the overlay can remain without making any issues?

    You can find some more info on deleting a property (but mainly overlays in general) here.

    Regards,

    Elfving

  • Hi Elfving, Yes, it is. I am not getting any errors during compiling. As I explained in the question, I wanted to use p0.14 & 15 pins for general purposes, but it didn't work. then I saw these pins behaving weirdly by checking these pins with a logic analyzer. after further research, I realised these pins were occupied by the uart as rts and cts pins in the nrf9160-pincontrol.dts file. so it tried something more in the overlay file I pasted above in the question but none of them worked till I deleted rts and cts properties of uart in the nrf9160-pincontrol.dts file.

  • The resulting dts file can be seen in build/zephyr/zephyr.dts. Are you seeing the properties you are trying to delete there after building?

    And just to check, do you have a literal dts file named "pincontrol.dts"?

    What NCS version are you using?

    Regards,

    Elfving

  •    sorry for late reply.

    Are you seeing the properties you are trying to delete there after building?

    yes I can see the properties Im trying to delete there. here is a sample.

    nrf9160dk_nrf9160_ns.overlay file:

    // To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
    
    // You can also use the buttons in the sidebar to perform actions on nodes.
    // Actions currently available include:
    
    // * Enabling / disabling the node
    // * Adding the bus to a bus
    // * Removing the node
    // * Connecting ADC channels
    
    // For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
    // You can also visit the nRF DeviceTree extension documentation at https://nrfconnect.github.io/vscode-nrf-connect/devicetree/nrfdevicetree.html
    / {
        chosen {
            zephyr,console = &uart0;
            zephyr,shell-uart = &uart0;
            zephyr,uart-mcumgr = &uart0;
        };
    };
    

    nrf9160dk_nrf9160_common.dts file:

     #include "nrf9160dk_nrf9160_common-pinctrl.dtsi"
    
     / {
    	model = "Nordic nRF9160 DK NRF9160";
    	compatible = "nordic,nrf9160-dk-nrf9160";
    
    	 chosen {
    		 zephyr,console = &uart1;
    		 zephyr,shell-uart = &uart1;
    		 zephyr,uart-mcumgr = &uart1;
    	 };
    	 
    	 leds {
    		 compatible = "gpio-leds";
    		 led0: led_0 {
    			 gpios = <&pcal9539a 15 0>;
    			 label = "Green LED 1";
    		 };
    	 };
     };

    zephyr.dts file:

    / {
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x1 >;
    	model = "Nordic nRF9160 DK NRF9160";
    	compatible = "nordic,nrf9160-dk-nrf9160";
    	chosen {
    		zephyr,flash-controller = &flash_controller;
    		zephyr,entropy = &cryptocell_sw;
    		zephyr,console = &uart1;
    		zephyr,shell-uart = &uart1;
    		zephyr,uart-mcumgr = &uart1;
    		zephyr,flash = &flash0;
    		zephyr,sram = &sram0_ns;
    		zephyr,code-partition = &slot0_ns_partition;
    	};
    	.
    	.
    	.
    	.

    And just to check, do you have a literal dts file named "pincontrol.dts"?

    yes i have, it is "nrf9160dk_nrf9160_common-pinctrl.dtsi"

    What NCS version are you using?

    I used to use NRF SDK 2.0.0 then, moved SDK 2.2.0 . I'm still getting the same error. I mean I have the same error in both versions.

    Regards.

Related