Problems using the nRF5340's P0.21 pin as a GPIO output

Hello,

I am developing an nRF5340 custom board by setting the pins as shown below.

- P0.19: UART_RX
- P0.20 : UART_TX
- P0.21: GPIO Output

I have a problem when trying to use the P0.21 pin as a GPIO output that used to be used as UART_CTS on the nRF5340DK.

When I add below code in app.overlay file and set GPIO values to 0 and 1, it always outputs 0.

&pinctrl {
    uart0_default: uart0_default {
        group1 {
            psels = <NRF_PSEL(UART_TX020)>;
        };
        group2 {
            psels = <NRF_PSEL(UART_RX019)>;
            bias-pull-up;
        };
    };
    uart0_sleep: uart0_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX020)>,
                <NRF_PSEL(UART_RX019)>;
            low-power-enable;
        };
    };
}

However, if the above code is removed from the app.overlay file and the nrf5340_cpuapp_common-pinctrl.dtsi file of the nRF Connect SDK is modified as above, it works fine.

I think it is not correct to modify the nrf5340_cpuapp_common-pinctrl.dtsi file.

Could you please let me know if there is a way to use P0.21 by modifying the app.overlay file?

Regards,
Seongbin

Related