Configure P0.05/P0.07 as GPIO when using uart0

I've got a custom board using an nRF52832.  I'm using the P0.06/P0.08 as the TX/RX pins for UART comms, but don't need the P0.05/P0.07 pins for CTS/RTS.  Is there anyway I can reconfigure those to be used as GPIO, rather than have them sitting unused?

If it is possible, how do I go about doing it?  I'm running NCSv2.6.1 and have Visual Studio Code as my IDE.

Cheers,

Mike

Parents
  • Hi Mike,

    To use the CTS/RTS pins as normal gpio, you can write an overlay file reconfiguring the pins for uart and removing the CTS/RTS assignments.. Just assign the Tx/RX pins:

    &pinctrl {
        uart0_default: uart0_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 6)>;
            };
            group2 {
                psels = <NRF_PSEL(UART_RX, 0, 8)>;
                bias-pull-up;
            };
        };
    
        uart0_sleep: uart0_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 6)>,
                        <NRF_PSEL(UART_RX, 0, 8)>;
                low-power-enable;
            };
        };
    };
    
    &uart0 {
        pinctrl-0 = <&uart0_default>;
        pinctrl-1 = <&uart0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    Best Regards,
    Swathy
Reply
  • Hi Mike,

    To use the CTS/RTS pins as normal gpio, you can write an overlay file reconfiguring the pins for uart and removing the CTS/RTS assignments.. Just assign the Tx/RX pins:

    &pinctrl {
        uart0_default: uart0_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 6)>;
            };
            group2 {
                psels = <NRF_PSEL(UART_RX, 0, 8)>;
                bias-pull-up;
            };
        };
    
        uart0_sleep: uart0_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 6)>,
                        <NRF_PSEL(UART_RX, 0, 8)>;
                low-power-enable;
            };
        };
    };
    
    &uart0 {
        pinctrl-0 = <&uart0_default>;
        pinctrl-1 = <&uart0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    Best Regards,
    Swathy
Children
No Data
Related