This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART hits communication error

[nRF52840 + SDK13]

On the hardware that I have, the UART driver is hitting a communication error because the RX line is low. This only happens when the UART lines are disconnected from my computer. When there is a connection, everything works fine. This is when using UART for logging and CLI.

Is there a way to have the RX line be pulled up by default?

I see that the function apply_config() in nrf_drv_uart.c is configuring it to NOPULL: nrf_gpio_cfg_input(p_config->pselrxd, NRF_GPIO_PIN_NOPULL);

I tried changing this to NRF_GPIO_PIN_PULLUP but that didn't help. Should I be able to configure a UART RX pin to be pulled up?

The error that is hit leads to this code executing with APP_UART_COMMUNICATION_ERROR evt_type:

static void uart_error_handle(app_uart_evt_t * p_event)
{
    if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR)
    {
        APP_ERROR_HANDLER(p_event->data.error_communication);
    }
    else if (p_event->evt_type == APP_UART_FIFO_ERROR)
    {
        APP_ERROR_HANDLER(p_event->data.error_code);
    }
}
Parents Reply Children
No Data
Related