<?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>Writing to ring buffer directly from ASYNC UART API or other alternatives</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108452/writing-to-ring-buffer-directly-from-async-uart-api-or-other-alternatives</link><description>I am relatively new to Zephyr RTOS and I am trying to understanding its ASYNC UART API capabilities better. I am trying to move processing away from my async uart callback to a different thread. 
 To do this, I am exploring using Zephyr ring buffer in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Feb 2024 10:39:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108452/writing-to-ring-buffer-directly-from-async-uart-api-or-other-alternatives" /><item><title>RE: Writing to ring buffer directly from ASYNC UART API or other alternatives</title><link>https://devzone.nordicsemi.com/thread/469752?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 10:39:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a5c3afe-3507-4c32-87ff-b71ecc3eba5d</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You can find an example by a collegue here that use the ring buffer&amp;nbsp;for tx and the async api:&lt;br /&gt;&lt;a href="https://github.com/too1/ncs-uart-async-count-rx/blob/master/src/main.c"&gt;https://github.com/too1/ncs-uart-async-count-rx/blob/master/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think using the ring buffer for receiving data is such a good idea, instead you want to provide a consistent (fixed) sized buffer for rx when using async api (if you use the ring buffer that may not be the case). You can encounter overrun etc if you sometimes provide a very small buffer.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>