This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART communication errors on initialization

Hello,

I'm having a lot of trouble debugging some errors on UART. I'm initializing the UART as follows:

void uart_init()
{
	ret_code_t err_code;
	const app_uart_comm_params_t comm_params =
	{
		UART_RX_PIN,
		UART_TX_PIN,
		0,
		0,
		APP_UART_FLOW_CONTROL_DISABLED,
		false,
		UART_BAUDRATE_BAUDRATE_Baud115200
	};

	APP_UART_FIFO_INIT(&comm_params,
						UART_RX_BUF_SIZE,
						UART_TX_BUF_SIZE,
						uart_error_handler,
						APP_IRQ_PRIORITY_LOWEST,
						err_code);

	NRF_LOG_INFO("UART initialized with error code: %d\r\n", err_code);
	APP_ERROR_CHECK(err_code);
}

So far the initialization succeeds, but immediately afterward I'm receiving two UART error events on the UART interrupt handler. I checked the error bitfields in the product specification and I'm getting a framing error (0x00000004 in ERRORSRC) followed by a break condition (0x00000008 in ERRORSRC).

I don't understand why I'm getting communication errors if I'm not even trying to transmit anything yet. I'm starting to wonder whether it has anything to do with the connections on my board or something. Is there anything I'm missing here?

I'm trying to test the UART using a loopback connection between TX and RX on the same board. I'm using a NRF52832 with SDK13.1.

Related