UART_RX_STOPPED error

Hi,

I am migrating a project from NRF SDK 17.1 to NRF Connect SDK 2.3.0 and have encountered a problem with UART_RX_STOPPED events in my uart_callback routine.

static void uart_callback(const struct device *dev,
			  struct uart_event *evt,
			  void *user_data)

{
	int err;
	struct uart_data_t *buf;
	bool foundSSLRECV = false;
	

	switch (evt->type) {
		case UART_TX_DONE:
			LOG_INF("Tx sent %d bytes", evt->data.tx.len);
			modemUART_RX_complete = false;
			break;

		case UART_TX_ABORTED:
			break;

		case UART_RX_RDY:
		{
			LOG_INF("UART_RX_RDY Received %d bytes offset %d\n", evt->data.rx.len,evt->data.rx.offset );
			
			memcpy(&modemRXBuf[evt->data.rx.offset],&evt->data.rx_buf.buf[evt->data.rx.offset],evt->data.rx.len);
			modemRXBufLen = modemRXBufLen + evt->data.rx.len;

			break;
		}
		
		case UART_RX_BUF_REQUEST:
			break;
	
		case UART_RX_BUF_RELEASED:
			break;

		case UART_RX_DISABLED:
			break;

		case UART_RX_STOPPED:
			LOG_ERR("UART_RX_STOPPED error %d",evt->data.rx_stop.reason);
			break;
	}
}

I am sending AT commands and all works well until I issue a command to retrieve the response from a socket when I get the following (repeatable) sequence of UART_RX_STOPPED errors:

[00:00:13.163,513] <err> iemUART: UART_RX_STOPPED error 4
[00:00:13.163,543] <err> iemUART: UART_RX_STOPPED error 8
[00:00:13.163,604] <err> iemUART: UART_RX_STOPPED error 4
[00:00:13.163,635] <err> iemUART: UART_RX_STOPPED error 8
[00:00:13.163,696] <err> iemUART: UART_RX_STOPPED error 4
[00:00:13.163,757] <err> iemUART: UART_RX_STOPPED error 8
[00:00:13.163,787] <err> iemUART: UART_RX_STOPPED error 4
[00:00:13.163,848] <err> iemUART: UART_RX_STOPPED error 8
[00:00:13.163,879] <err> iemUART: UART_RX_STOPPED error 4
[00:00:13.163,909] <err> iemUART: UART_RX_STOPPED error 8
[00:00:13.163,970] <err> iemUART: UART_RX_STOPPED error 4
[00:00:13.164,001] <err> iemUART: UART_RX_STOPPED error 8


I have tried adding in a wait statement and looking at the related posts (https://devzone.nordicsemi.com/f/nordic-q-a/61310/uart-error-codes) but so far this issue persists.
I'm pretty sure the hardware is not the issue (eg floating pins causing the framing errors) as there are no such problems when running the new SDK 17.1 based code on the same hardware.

Any pointers gratefully received...
Nick

Parents
  • Hi,

    1. Can you share a trace of the TX, and RX line from a logic analyzer when it asserts?
    2. You're getting a BREAK and FRAMING error.

    From documentation: 

    Break interrupt.

    A break interrupt was received. This happens when the serial input is held at a logic ‘0’ state for longer than the sum of start time + data bits + parity + stop bits.

    regards

    Jared

Reply
  • Hi,

    1. Can you share a trace of the TX, and RX line from a logic analyzer when it asserts?
    2. You're getting a BREAK and FRAMING error.

    From documentation: 

    Break interrupt.

    A break interrupt was received. This happens when the serial input is held at a logic ‘0’ state for longer than the sum of start time + data bits + parity + stop bits.

    regards

    Jared

Children
No Data
Related