<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90449/problem-with-async-uart-example-from-peripheral_uart</link><description>Trying to integrate the serial part of the example code for use with a custom nRF52840 board. The problem is that I&amp;#39;m getting an error in uart_callback_set(uart, uart_cb, NULL) that is causing &amp;quot;Cannot initialize UART callback&amp;quot; to be displayed. I&amp;#39;m using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Jun 2024 10:05:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90449/problem-with-async-uart-example-from-peripheral_uart" /><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/487262?ContentTypeID=1</link><pubDate>Tue, 04 Jun 2024 10:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54069eec-5f50-45a4-8eb8-977339264691</guid><dc:creator>lanwer</dc:creator><description>&lt;p&gt;I would say, you should try this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;disabling interrupt driven api if you don&amp;#39;t need it -&amp;gt; remove &amp;#39;&lt;em&gt;CONFIG_UART_INTERRUPT_DRIVEN=y&amp;#39;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;AND/OR&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;disabling interrupt driven api for UART1 -&amp;gt;&amp;nbsp;&lt;/em&gt;&lt;span style="background-color:#2f2f2f;padding:0px 0px 0px 2px;"&gt;&lt;span style="background-color:#2f2f2f;color:#aaaaaa;font-family:&amp;#39;Monospace&amp;#39;;font-size:10pt;white-space:pre;"&gt;&lt;span style="color:#d9e8f7;"&gt;CONFIG_UART_1_INTERRUPT_DRIVEN=n &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#2f2f2f;padding:0px 0px 0px 2px;"&gt;&lt;span style="background-color:#2f2f2f;color:#aaaaaa;font-family:&amp;#39;Monospace&amp;#39;;font-size:10pt;white-space:pre;"&gt;&lt;span style="color:#d9e8f7;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;ul&gt;
&lt;li&gt;I noticed that not disabling the interrupt driven api on a specific interface leads to using it per default., which does not correspond to the function that you are calling (uart_callback_set)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/382157?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 07:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ab1d94b-a96f-4f44-987d-8d3cd28f2fd1</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Paul,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="NautDesigner"]Here is the UART part of the device tree. Are there any issues here?[/quote]
&lt;p&gt;&lt;span&gt;The first thing that catches my attention is that no register space is defined.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;reg = &amp;lt; 0x40028000 0x1000 &amp;gt;;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Otherwise, from NCS v2.0.0 it is recommended to use the pin control API, as described &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/migration/migration_guide_1.x_to_2.x.html#pin-control-transition"&gt;here&lt;/a&gt;. &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/382089?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 14:41:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2276393-75d3-41d7-8873-84b9b4160bf7</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Here is the UART part of the device tree. Are there any issues here?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart1 {
	compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;115200&amp;gt;;
	tx-pin = &amp;lt;20&amp;gt;;
	rx-pin = &amp;lt;21&amp;gt;;
	//pinctrl-0 = &amp;lt;&amp;amp;uart1_default&amp;gt;;
	//pinctrl-1 = &amp;lt;&amp;amp;uart1_sleep&amp;gt;;
	//pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	lpuart: nrf-sw-lpuart {
		compatible = &amp;quot;nordic,nrf-sw-lpuart&amp;quot;;
		status = &amp;quot;okay&amp;quot;;
		label = &amp;quot;LPUART&amp;quot;;
		req-pin = &amp;lt;8&amp;gt;;
		rdy-pin = &amp;lt;4&amp;gt;;
	};
	/delete-property/ rts-pin;
   	/delete-property/ cts-pin;
   	/delete-property/ hw-flow-control;
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/379626?ContentTypeID=1</link><pubDate>Tue, 02 Aug 2022 07:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:265fc31e-b7df-4d3d-8f27-fd4c97ccd48c</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Paul,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="NautDesigner"]The problem is that api-&amp;gt;callback_set is NULL. Where am I not setting this?[/quote]
&lt;p&gt;&lt;span&gt;I’m not quite sure why that happens. I took the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/samples/hello_world/README.html"&gt;Hello World&lt;/a&gt; sample as a starting point and added parts of the code you provided to it.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;drivers/uart.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;

LOG_MODULE_REGISTER(application_module, CONFIG_APPLICATION_MODULE_LOG_LEVEL);


static void uart_cb(const struct device *dev, struct uart_event *evt, void *user_data)
{
	// ARG_UNUSED(dev);

	// static uint8_t *current_buf;
	// static size_t aborted_len;
	// static bool buf_release;
	// struct uart_data_t *buf;
	// static uint8_t *aborted_buf;

	switch (evt-&amp;gt;type) {
	case UART_TX_DONE:
		LOG_DBG(&amp;quot;tx_done&amp;quot;);
		// if ((evt-&amp;gt;data.tx.len == 0) ||
		//     (!evt-&amp;gt;data.tx.buf)) {
		// 	return;
		// }

	// 	if (aborted_buf) {
	// 		buf = CONTAINER_OF(aborted_buf, struct uart_data_t,
	// 				   data);
	// 		aborted_buf = NULL;
	// 		aborted_len = 0;
	// 	} else {
	// 		buf = CONTAINER_OF(evt-&amp;gt;data.tx.buf, struct uart_data_t,
	// 				   data);
	// 	}

	// 	k_free(buf);

	// 	buf = k_fifo_get(&amp;amp;fifo_uart_tx_data, K_NO_WAIT);
	// 	if (!buf) {
	// 		return;
	// 	}

	// 	if (uart_tx(uart, buf-&amp;gt;data, buf-&amp;gt;len, SYS_FOREVER_MS)) {
	// 		LOG_WRN(&amp;quot;Failed to send data over UART&amp;quot;);
	// 	}

	// 	break;

	case UART_RX_RDY:
		LOG_DBG(&amp;quot;rx_rdy&amp;quot;);
		// buf = CONTAINER_OF(evt-&amp;gt;data.rx.buf, struct uart_data_t, data);
		// buf-&amp;gt;len += evt-&amp;gt;data.rx.len;
		// buf_release = false;

		// if (buf-&amp;gt;len == UART_BUF_SIZE) {
		// 	k_fifo_put(&amp;amp;fifo_uart_rx_data, buf);
		// } else if ((evt-&amp;gt;data.rx.buf[buf-&amp;gt;len - 1] == &amp;#39;\n&amp;#39;) ||
		// 	  (evt-&amp;gt;data.rx.buf[buf-&amp;gt;len - 1] == &amp;#39;\r&amp;#39;)) {
		// 	k_fifo_put(&amp;amp;fifo_uart_rx_data, buf);
		// 	current_buf = evt-&amp;gt;data.rx.buf;
		// 	buf_release = true;
		// 	uart_rx_disable(uart);
		// }

		break;

	// case UART_RX_DISABLED:
	// 	LOG_DBG(&amp;quot;rx_disabled&amp;quot;);
	// 	buf = k_malloc(sizeof(*buf));
	// 	if (buf) {
	// 		buf-&amp;gt;len = 0;
	// 	} else {
	// 		LOG_WRN(&amp;quot;Not able to allocate UART receive buffer&amp;quot;);
	// 		k_work_reschedule(&amp;amp;uart_work, UART_WAIT_FOR_BUF_DELAY);
	// 		return;
	// 	}

	// 	uart_rx_enable(uart, buf-&amp;gt;data, sizeof(buf-&amp;gt;data),
	// 		       UART_WAIT_FOR_RX);

	// 	break;

	// case UART_RX_BUF_REQUEST:
	// 	LOG_DBG(&amp;quot;rx_buf_request&amp;quot;);
	// 	buf = k_malloc(sizeof(*buf));
	// 	if (buf) {
	// 		buf-&amp;gt;len = 0;
	// 		uart_rx_buf_rsp(uart, buf-&amp;gt;data, sizeof(buf-&amp;gt;data));
	// 	} else {
	// 		LOG_WRN(&amp;quot;Not able to allocate UART receive buffer&amp;quot;);
	// 	}

	// 	break;

	// case UART_RX_BUF_RELEASED:
	// 	LOG_DBG(&amp;quot;rx_buf_released&amp;quot;);
	// 	buf = CONTAINER_OF(evt-&amp;gt;data.rx_buf.buf, struct uart_data_t,
	// 			   data);
	// 	if (buf_release &amp;amp;&amp;amp; (current_buf != evt-&amp;gt;data.rx_buf.buf)) {
	// 		k_free(buf);
	// 		buf_release = false;
	// 		current_buf = NULL;
	// 	}

	// 	break;

	// case UART_TX_ABORTED:
	// 		LOG_DBG(&amp;quot;tx_aborted&amp;quot;);
	// 		if (!aborted_buf) {
	// 			aborted_buf = (uint8_t *)evt-&amp;gt;data.tx.buf;
	// 		}

	// 		aborted_len += evt-&amp;gt;data.tx.len;
	// 		buf = CONTAINER_OF(aborted_buf, struct uart_data_t,
	// 				   data);

	// 		uart_tx(uart, &amp;amp;buf-&amp;gt;data[aborted_len],
	// 			buf-&amp;gt;len - aborted_len, SYS_FOREVER_MS);

	// 	break;

	default:
		break;
	}
}

void main(void)
{
	LOG_INF(&amp;quot;Hello World! %s&amp;quot;, CONFIG_BOARD);

	int err;
	//int pos;
	//struct uart_data_t *rx;
	//struct uart_data_t *tx;

   	//fifoInit();
	const struct device *uart;
   	uart = device_get_binding(&amp;quot;UART_1&amp;quot;);
	__ASSERT(uart, &amp;quot;Failed to get UART device&amp;quot;);
	//interrupt_driven(uart);

	if (!uart) {
		return /*-ENXIO*/;
	}

	// rx = k_malloc(sizeof(*rx));
	// if (rx) {
	// 	rx-&amp;gt;len = 0;
	// } else {
	// 	return /*-ENOMEM*/;
	// }

	//k_work_init_delayable(&amp;amp;uart_work, uart_work_handler);

	err = uart_callback_set(uart, uart_cb, NULL);
	if (err) {
		LOG_ERR(&amp;quot;Cannot initialize UART callback&amp;quot;);
		return /*err*/;
	}
	else LOG_INF(&amp;quot;UART callback handler successfully initialised!&amp;quot;);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# nothing here
CONFIG_UART_ASYNC_API=y
CONFIG_LOG=y&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I’m not able to reproduce the error, see log below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v3.0.99-ncs1  ***
[00:00:00.366,516] &amp;lt;inf&amp;gt; application_module: Hello World! nrf52840dk_nrf52840
[00:00:00.366,516] &amp;lt;inf&amp;gt; application_module: UART callback handler successfully initialised!&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could this maybe be a&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/build/dts/index.html#devicetree"&gt;devicetree&lt;/a&gt; issue with your custom board?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/379588?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2022 15:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deb17efa-1242-4ae8-bf5f-9f21ba4bd421</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;The problem is that api-&amp;gt;callback_set is NULL. Where am I not setting this?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/callback.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/379461?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2022 08:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70b13830-5f43-4080-9338-da2503eae3f9</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>[quote user="NautDesigner"]Here is the callback code.[/quote]
&lt;p&gt;&lt;span&gt;Thanks, Paul! Looks ok to me, I would say.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What is the exact error code that is returned by &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_callback_set"&gt;uart_callback_set()&lt;/a&gt;?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/379151?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 13:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05f9c3a0-ebf8-4e78-86bd-e6aae54ab85b</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Here is the callback code.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void uart_cb(const struct device *dev, struct uart_event *evt, void *user_data)
{
	ARG_UNUSED(dev);

	static uint8_t *current_buf;
	static size_t aborted_len;
	static bool buf_release;
	struct uart_data_t *buf;
	static uint8_t *aborted_buf;

	switch (evt-&amp;gt;type) {
	case UART_TX_DONE:
		LOG_DBG(&amp;quot;tx_done&amp;quot;);
		if ((evt-&amp;gt;data.tx.len == 0) ||
		    (!evt-&amp;gt;data.tx.buf)) {
			return;
		}

		if (aborted_buf) {
			buf = CONTAINER_OF(aborted_buf, struct uart_data_t,
					   data);
			aborted_buf = NULL;
			aborted_len = 0;
		} else {
			buf = CONTAINER_OF(evt-&amp;gt;data.tx.buf, struct uart_data_t,
					   data);
		}

		k_free(buf);

		buf = k_fifo_get(&amp;amp;fifo_uart_tx_data, K_NO_WAIT);
		if (!buf) {
			return;
		}

		if (uart_tx(uart, buf-&amp;gt;data, buf-&amp;gt;len, SYS_FOREVER_MS)) {
			LOG_WRN(&amp;quot;Failed to send data over UART&amp;quot;);
		}

		break;

	case UART_RX_RDY:
		LOG_DBG(&amp;quot;rx_rdy&amp;quot;);
		buf = CONTAINER_OF(evt-&amp;gt;data.rx.buf, struct uart_data_t, data);
		buf-&amp;gt;len += evt-&amp;gt;data.rx.len;
		buf_release = false;

		if (buf-&amp;gt;len == UART_BUF_SIZE) {
			k_fifo_put(&amp;amp;fifo_uart_rx_data, buf);
		} else if ((evt-&amp;gt;data.rx.buf[buf-&amp;gt;len - 1] == &amp;#39;\n&amp;#39;) ||
			  (evt-&amp;gt;data.rx.buf[buf-&amp;gt;len - 1] == &amp;#39;\r&amp;#39;)) {
			k_fifo_put(&amp;amp;fifo_uart_rx_data, buf);
			current_buf = evt-&amp;gt;data.rx.buf;
			buf_release = true;
			uart_rx_disable(uart);
		}

		break;

	case UART_RX_DISABLED:
		LOG_DBG(&amp;quot;rx_disabled&amp;quot;);
		buf = k_malloc(sizeof(*buf));
		if (buf) {
			buf-&amp;gt;len = 0;
		} else {
			LOG_WRN(&amp;quot;Not able to allocate UART receive buffer&amp;quot;);
			k_work_reschedule(&amp;amp;uart_work, UART_WAIT_FOR_BUF_DELAY);
			return;
		}

		uart_rx_enable(uart, buf-&amp;gt;data, sizeof(buf-&amp;gt;data),
			       UART_WAIT_FOR_RX);

		break;

	case UART_RX_BUF_REQUEST:
		LOG_DBG(&amp;quot;rx_buf_request&amp;quot;);
		buf = k_malloc(sizeof(*buf));
		if (buf) {
			buf-&amp;gt;len = 0;
			uart_rx_buf_rsp(uart, buf-&amp;gt;data, sizeof(buf-&amp;gt;data));
		} else {
			LOG_WRN(&amp;quot;Not able to allocate UART receive buffer&amp;quot;);
		}

		break;

	case UART_RX_BUF_RELEASED:
		LOG_DBG(&amp;quot;rx_buf_released&amp;quot;);
		buf = CONTAINER_OF(evt-&amp;gt;data.rx_buf.buf, struct uart_data_t,
				   data);
		if (buf_release &amp;amp;&amp;amp; (current_buf != evt-&amp;gt;data.rx_buf.buf)) {
			k_free(buf);
			buf_release = false;
			current_buf = NULL;
		}

		break;

	case UART_TX_ABORTED:
			LOG_DBG(&amp;quot;tx_aborted&amp;quot;);
			if (!aborted_buf) {
				aborted_buf = (uint8_t *)evt-&amp;gt;data.tx.buf;
			}

			aborted_len += evt-&amp;gt;data.tx.len;
			buf = CONTAINER_OF(aborted_buf, struct uart_data_t,
					   data);

			uart_tx(uart, &amp;amp;buf-&amp;gt;data[aborted_len],
				buf-&amp;gt;len - aborted_len, SYS_FOREVER_MS);

		break;

	default:
		break;
	}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Async UART Example from peripheral_uart</title><link>https://devzone.nordicsemi.com/thread/379105?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 11:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a7eefd2-98da-4364-aaac-49b57a6a57eb</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Paul,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]The problem is that I&amp;#39;m getting an error in&amp;nbsp;uart_callback_set(uart, uart_cb, NULL) that is causing &amp;quot;Cannot initialize UART callback&amp;quot; to be displayed. I&amp;#39;m using UART1 which works with a different interrupt version of this code. Not sure what I&amp;#39;m missing here to get the callback initialized.[/quote]
&lt;p&gt;&lt;span&gt;In your code snippet, I’m not able to find the definition of the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_callback_t"&gt;call-back handler&lt;/a&gt; itself. That is probably the reason you get ‘Cannot initialise UART call-back’ displayed. &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>