uart0 overlay for hello_world app

I've got a custom board based on the nRF52810 SoC. I want to use GPIO P0.06 for UART_TX and P0.08 for UART_RX. I used the new board wizard in nRF Connect to create a new board based on the nrf52810 and added the following overlay code:

&uart0 {
    status = "okay";
    compatible = "nordic,nrf-uart";
    tx-pin = < 6 >;
    rx-pin = < 8 >;
    current-speed = < 115200 >;
    parity = "none";
    rts-pin = < 0xffffffff >;
    cts-pin = < 0xffffffff >;
};

The app builds and appears to run (I can step in the debuger), but I'm not seeing the "Hello World" text output on GPIO pin P0.06.

I'm guessing I need to add some more stuff to my overlay file. What am I missing?

Project folder attached here.

7360.hello_world.zip

Parents
  • I'm continuing to research this issue. In the file C:\ncs\v2.2.0\zephyr\dts\bindings\serial\nordic,nrf-uart-common.yaml\nordic,nrf-uart-common.yaml I find that the terms tx-pin and rx-pin are deprecated if the "pin control driver" is not used. But I'm pretty sure I want to use pin control, since it's the way things are supported in the future. So I started researching the driver here:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/ug_pinctrl.html#ug-pinctrl

    So I think the example I need is how to do an overlay file that uses pin control to re-map the UART pins with the nRF52 DK board.

    Using the above guide, this is what my revised overlay file looks like, but it still doesn't work:

    &pinctrl {
        uart0_default: uart0_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 6)>;
            };
            group2 {
                psels = <NRF_PSEL(UART_RX, 1, 8)>;
                bias-pull-up;
            };
        };
    };
    &uart0 {
        pinctrl-0 = <&uart0_default>;
        pinctrl-names = "default";
    };
    

    Is there an example somewhere of how to do this for a UART?

  • So I did something similar to you using pinctrl with an nRF52833 board and an app.overlay, for uart1

    &pinctrl {
    	uart1_default: uart1_default {
    	   group1 {
    		  psels = <NRF_PSEL(UART_TX, 1, 2)>,
    				  <NRF_PSEL(UART_RX, 1, 1)>;
    	   };
    	};
    	/* required if CONFIG_PM_DEVICE=y */
    	uart1_sleep: uart1_sleep {
    	   group1 {
    		  psels = <NRF_PSEL(UART_TX, 1, 2)>,
    				  <NRF_PSEL(UART_RX, 1, 1)>;
    		  low-power-enable;
    	   };
    	};
     };
    
     &uart1 {
       compatible = "nordic,nrf-uarte";
       current-speed = <19200>;
       status = "okay";
       pinctrl-0 = <&uart1_default>;
       pinctrl-1 = <&uart1_sleep>;
       pinctrl-names = "default", "sleep";
     };
    

    This did work for me. i'd double check to make sure your project is using the overlay.

  • I got it to work as well. I changed the code for my nRF52832, which has just one UART:

    &pinctrl {
    	uart0_default: uart0_default {
    	   group1 {
    		  psels = <NRF_PSEL(UART_TX, 0, 11)>,
    				  <NRF_PSEL(UART_RX, 0, 13)>;
    	   };
    	};
    	/* required if CONFIG_PM_DEVICE=y */
    	uart0_sleep: uart0_sleep {
    	   group1 {
    		  psels = <NRF_PSEL(UART_TX, 0, 11)>,
    				  <NRF_PSEL(UART_RX, 0, 13)>;
    		  low-power-enable;
    	   };
    	};
     };
    
     &uart0{
    
       compatible = "nordic,nrf-uarte";
       current-speed = <115200>;
       status = "okay";
       pinctrl-0 = <&uart0_default>;
       pinctrl-1 = <&uart0_sleep>;
       pinctrl-names = "default", "sleep";
     };

Reply
  • I got it to work as well. I changed the code for my nRF52832, which has just one UART:

    &pinctrl {
    	uart0_default: uart0_default {
    	   group1 {
    		  psels = <NRF_PSEL(UART_TX, 0, 11)>,
    				  <NRF_PSEL(UART_RX, 0, 13)>;
    	   };
    	};
    	/* required if CONFIG_PM_DEVICE=y */
    	uart0_sleep: uart0_sleep {
    	   group1 {
    		  psels = <NRF_PSEL(UART_TX, 0, 11)>,
    				  <NRF_PSEL(UART_RX, 0, 13)>;
    		  low-power-enable;
    	   };
    	};
     };
    
     &uart0{
    
       compatible = "nordic,nrf-uarte";
       current-speed = <115200>;
       status = "okay";
       pinctrl-0 = <&uart0_default>;
       pinctrl-1 = <&uart0_sleep>;
       pinctrl-names = "default", "sleep";
     };

Children
No Data
Related