Enabling UART2 on nRF9151 DK using P0.02 and P0.03 – Verification Needed

Hi,

I am working on the nRF9151 DK (nrf9151dk_nrf9151ns) and need to use an additional UART for communication with an external ESP32.

Currently:

  • UART0 is used for console/debug.

  • UART1 is used by the LTE modem.

Therefore, I am attempting to enable UART2 for external communication.

After reviewing the board schematic, I found that P0.02 and P0.03 are not used by any active peripherals in my setup. These pins are routed to the Arduino header, and since no shield is connected, I assume they can be reassigned.

I have added the following overlay:

nrf9151dk_nrf9151ns.overlay

&uart2 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart2_default>;
pinctrl-names = "default";
};

&pinctrl {
uart2_default: uart2_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 2)>,
<NRF_PSEL(UART_RX, 0, 3)>;
};
};
};

In prj.conf I have enabled:

CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_NRFX=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_2_ASYNC=y
CONFIG_UART_2_NRF_HW_ASYNC=y

My understanding is:

  • UART2 is available on the nRF9151 SoC.

  • P0.02 is configured as TX.

  • P0.03 is configured as RX.

  • These pins should be usable since they are not actively assigned elsewhere.

Could you please confirm:

  1. Is UART2 supported and available on nRF9151 DK?

  2. Are P0.02 and P0.03 safe to use for UART2?

  3. Is there anything missing in the overlay or Kconfig for enabling UART2 properly?

Thank you.

Parents Reply Children
  • Hi,   

    I tested your attached project.

    The build and flash are successful, but no data is observed on UART2 (P0.02 / P0.03).

    Could you please confirm if anything additional is required to enable UART2 output on the nRF9151 DK?

    Thanks.

    Best regards,
    Suhas



  • How do you determine that no data is output on the UART? Did you try to switch the TX and RX pin in the .overlay file? Both for uart2_default and uart2_sleep:

    &pinctrl {
    	uart2_default: uart2_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 2)>;
    		};
    
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 3)>;
    			bias-pull-up;
    		};
    	};
    
        uart2_sleep: uart2_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 2)>,
    				<NRF_PSEL(UART_RX, 0, 3)>;
    			low-power-enable;
    		};
    	};
    };

    Have you tried analysing the pins using a logic analyzer to see if there is any data?

    Best regards,

    Edvin

Related