Change UART port

Hi,

I started using the Nrf5340-DK with the openthread cli sample. It works fine, and now I'd like to move the main UART to pins P0.24 and P0.26.

To do so, I created an overlay and re-compiled my project with west.

&pinctrl {
    uart0_default: uart0_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 26)>;
        };
        group2 {
            psels = <NRF_PSEL(UART_RX, 0, 24)>;
        };
    };

    uart0_sleep: uart0_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 26)>,
                    <NRF_PSEL(UART_RX, 0, 24)>;
            low-power-enable;
        };
    };
};

When I check the zephyr.dts file, my changes are taken in account, but the UART doesn't work on the new pins.

What am I missing?

Best regards,

Parents Reply
  • I see, that should have been OK; then. Regarding the other pins, P0.9 is also a button on the DK, so you cannot use that either (without adjustments). Can you say a bit more about how you test and in what way it fails? What have you connected to the UART pins? Is there any output signal on the Tx pin if you output something and for instance check with a logic analyzer (in case there is a problem with the other end)?

    (Note that there is an alternative way of changing UART pins, as explained under nRF5340 DK v1.0.0 COM ports. This should be functionally the same as what you have done, though).

Children
Related