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";
};
Parents
  • 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.

  • zsn said:
    sorry for late reply.

    Hehe likewise, sorry about the delay.

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

    TF-M is using uart1 by default, so my guess is that that is the problem. Changing the configurations in the overlay file wont make a difference in the TF-M image there. You can check this theory by either disabling the TF-M image (by building the project for the board file without ns), or by turning off logging by enabling TFM_LOG_LEVEL_SILENCE in your config file.

    If you want to change the UART instance the TF-M image uses you can use CONFIG_TFM_SECURE_UART_INSTANCE. To change the RTS and CTS pins of uart0 though, I believe the only option is to modify modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/nrf9160dk_nrf9160/RTE_Device.h directly.

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

    I am a bit surprised by this. Does this still work for you?

    Regards,

    Elfving

  • Hehe likewise, sorry about the delay.

    Slight smile

    TF-M is using uart1 by default, so my guess is that that is the problem. Changing the configurations in the overlay file wont make a difference in the TF-M image there. You can check this theory by either disabling the TF-M image (by building the project for the board file without ns), or by turning off logging by enabling TFM_LOG_LEVEL_SILENCE in your config file.

    this uart instance was only a sample to show something is wrong with dts files configuration. instead of a uart, when I use any other interface the result is the same. I can see the deleted property or even overlay file does not effect on dts file configuration(the resulting 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?

    here is your note in your previous message. overlay files do not have an effect or are not over the board dts files. This is the issue that I'm trying to figure out why and how I can fix.

    I am a bit surprised by this. Does this still work for you?

    I fixed that issue it was specific for uart1. Now it works.  Forget about Uart, this issue is the same for I2C or any other instance definition in the dts files sometimes but I do not in what case.

Reply
  • Hehe likewise, sorry about the delay.

    Slight smile

    TF-M is using uart1 by default, so my guess is that that is the problem. Changing the configurations in the overlay file wont make a difference in the TF-M image there. You can check this theory by either disabling the TF-M image (by building the project for the board file without ns), or by turning off logging by enabling TFM_LOG_LEVEL_SILENCE in your config file.

    this uart instance was only a sample to show something is wrong with dts files configuration. instead of a uart, when I use any other interface the result is the same. I can see the deleted property or even overlay file does not effect on dts file configuration(the resulting 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?

    here is your note in your previous message. overlay files do not have an effect or are not over the board dts files. This is the issue that I'm trying to figure out why and how I can fix.

    I am a bit surprised by this. Does this still work for you?

    I fixed that issue it was specific for uart1. Now it works.  Forget about Uart, this issue is the same for I2C or any other instance definition in the dts files sometimes but I do not in what case.

Children
  • zsn said:
    overlay files do not have an effect or are not over the board dts files. This is the issue that I'm trying to figure out why and how I can fix.

    I see. I figured there might be several other things that might be confusing and add to this problem, but if the overlays aren't even working for you it might be easiest start off by focusing on that Slight smile

    Are you seeing this using the build/zephyr/zephyr.dts file, or with the compiled device tree output shortcut in VSC? And are the two showing you the same information?

      

    Are you even seeing this overlay that you posted earlier make a difference on your zephyr.dts?

    / {
        chosen {
            zephyr,console = &uart0;
            zephyr,shell-uart = &uart0;
            zephyr,uart-mcumgr = &uart0;
        };
    };

    If none of that worked, try opening a new default peripheral_uart sample. It should come with a overlay file allready included. Could you see if that change has made any effect on the dts?

    Regards,

    Elfving

Related