Skip to content

Commit fd088d2

Browse files
author
Marcus Chang
committed
Allow STDIO pins to be NC in NRF52 series
Prevent ASSERT from triggering when one of the STDIO pins is not connected.
1 parent f4382d9 commit fd088d2

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)