how to change nrf54l15dk console from uart20 to uart21?

hi,

I use nrf54l15dk with ncs-v3.1.0, the project is based sample "central_hids";

The purpose is I want to change console uart from "pin1.04/pin1.05<uart20>" to "pin2.07/pin2.08<uart21>";

If I change the overlay as below,and init <uart21> in main function;

It seems that the chip doesn't work;

If I change it back as default,It can work well with <uart20>

wish  for your reply,thank you;

&uart20 {
    status = "disabled";
};

&led2 {
    status = "disabled";
};

//&trace {
//    status = "okay";
//};

&pinctrl {
    uart21_default: uart21_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 2, 8)>;
        };
        group2 {
            psels = <NRF_PSEL(UART_RX, 2, 7)>;
            bias-pull-up;
        };
    };
    uart21_sleep: uart21_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 2, 8)>, <NRF_PSEL(UART_RX, 2, 7)>;
            low-power-enable;
        };
    };
};

&uart21 {
    status = "okay";
    current-speed = <115200>;
    pinctrl-0 = <&uart21_default>;
    pinctrl-1 = <&uart21_sleep>;
    pinctrl-names = "default", "sleep";
};



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

//it's my init for uart21;
const struct device *uart = DEVICE_DT_GET(DT_NODELABEL(uart21));

int main(void){

    //it is I add in main function
	NRF_POWER->TASKS_CONSTLAT = 1;

	if (!device_is_ready(uart)){
    	return;
	}

Parents Reply Children
No Data
Related