Skip to content

Commit 6300d8b

Browse files
author
Cruz Monrreal
authored
Merge pull request #7487 from marcuschangarm/fix-nrf52-serial
Allow STDIO pins to be NC in NRF52 series
2 parents e1df16e + fd088d2 commit 6300d8b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,16 @@ static void nordic_nrf5_uart_configure_object(serial_t *obj)
789789
#endif
790790

791791
/* Configure Tx and Rx pins. */
792-
nrf_gpio_pin_set(uart_object->tx);
793-
nrf_gpio_cfg_output(uart_object->tx);
794-
nrf_gpio_cfg_input(uart_object->rx, NRF_GPIO_PIN_NOPULL);
792+
if (uart_object->tx != NRF_UART_PSEL_DISCONNECTED) {
793+
794+
nrf_gpio_pin_set(uart_object->tx);
795+
nrf_gpio_cfg_output(uart_object->tx);
796+
}
797+
798+
if (uart_object->rx != NRF_UART_PSEL_DISCONNECTED) {
799+
800+
nrf_gpio_cfg_input(uart_object->rx, NRF_GPIO_PIN_NOPULL);
801+
}
795802

796803
nrf_uarte_txrx_pins_set(nordic_nrf5_uart_register[uart_object->instance],
797804
uart_object->tx,

0 commit comments

Comments
 (0)