<?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>UART Interrupt mode RX</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105092/uart-interrupt-mode-rx</link><description>I have been working with different UART modes (Polling, Interrupt, Async). I have had a lot of troubles using Async mode, I have even created a seperate issue regarding this which has not yet been solved: 
 
 
 
 I have decided to try UART interrupt and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Oct 2023 14:13:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105092/uart-interrupt-mode-rx" /><item><title>RE: UART Interrupt mode RX</title><link>https://devzone.nordicsemi.com/thread/452630?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2023 14:13:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b728090-8b04-4b36-82db-01f05281be0e</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi again!&lt;/p&gt;
&lt;p&gt;First of all, it&amp;#39;s great that you&amp;#39;ve created another case for this question and linked to your other case so we can handle them separately since the topic is different! Keep doing that in the future as well&lt;/p&gt;
[quote user=""]&lt;div&gt;My code assumes that when communicating with other UART devices, message will always be terminated with either (\n or \r).&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I want to understand whether I am using UART Interrupt as supposed to? I would appreciate any ideas to make it more efficient and correct. Thanks in advance.&lt;/div&gt;[/quote]
&lt;p&gt;Regarding if you&amp;#39;re using it correct: Mainly &amp;#39;yes&amp;#39; and a tiny bit &amp;#39;no&amp;#39;. You are using interrupt based UART correct, but it is not &amp;quot;has to be \n or \r&amp;quot; termination (although that is typically the default ones used together with zero-termination)&lt;/p&gt;
&lt;p&gt;There are no &amp;quot;standard&amp;quot; way to terminate the message. Typically, depending on the type of device and/or implementation and use case, UART messages can be terminated with different means. Either through \n or \r as you list, but zero-termination or termination through &amp;#39;ff&amp;#39;, &amp;#39;aaa&amp;#39;, or other means are equally valid. This means that you will have to either define and/or look up what termination the devices you intend to communicate will be using as their method of termination&lt;/p&gt;
&lt;p&gt;Regarding if this is the most efficient implementation I will have to leave to other developers on the forum (either here on Zephyr forums) that has their own preferences and experiences. If the interrupt based UART works with your implementation, which it seems to do based on looking through your code, you should be golden.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>