<?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>override SHELL control over UART backend</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109947/override-shell-control-over-uart-backend</link><description>Hi, 
 I&amp;#39;m using SHELL with UART backend to include testing functionality in the firmware. One of the tests requires to implement a bridge between the UART and a UWB chip on the board, as if Nordic is passthrough. To do this bridge functionality, I want</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Apr 2024 16:42:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109947/override-shell-control-over-uart-backend" /><item><title>RE: override SHELL control over UART backend</title><link>https://devzone.nordicsemi.com/thread/477371?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2024 16:42:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c79bcc1-c300-4c6c-a1be-981e05ca42b1</guid><dc:creator>Ahmed Samir</dc:creator><description>&lt;p&gt;Thanks for checking, and please check with them also if logger needs to be disabled&amp;nbsp;during accessing the UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: override SHELL control over UART backend</title><link>https://devzone.nordicsemi.com/thread/477332?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2024 13:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e7cc83c-5ce2-4f1c-b4e2-e6bce19a4bd0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I believe it should be possible to use the UART directly to transmit data while the logger and shell is enabled.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try&amp;nbsp;the following:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Get the UART instance used by shell&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/drivers/uart.h&amp;gt;

const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Send data 1 byte at a time using uart_poll_out()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void print_uart(char *buf)
{
	int msg_len = strlen(buf);

	for (int i = 0; i &amp;lt; msg_len; i++) {
		uart_poll_out(uart, buf[i]);
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I can ask the developers on Monday if they foresee any potential conflicts with this approach.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>