<?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>UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97423/uarte-zephyr-async-api</link><description>Hi, 
 I am using an nRF52 DK board to perform some very simple tests. All I need to do is receive a line of text over serial, perform some calculations and return another line of text. I decided it would be least effort to use the Zephyr async API (and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Jun 2024 07:23:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97423/uarte-zephyr-async-api" /><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/487215?ContentTypeID=1</link><pubDate>Tue, 04 Jun 2024 07:23:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36eca8d2-1483-404b-8dba-5c0a8b74d4a9</guid><dc:creator>lanwer</dc:creator><description>&lt;p&gt;I can recommend you this lesson from the DebAcademy. I was able to use the Async Api successfully following it:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-4-serial-communication-uart/topic/uart-driver/"&gt;Link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I also found this youtube video super helpful:&amp;nbsp;&lt;a href="https://www.youtube.com/watch?v=ikRS9XXZGGA"&gt;UARTE Async&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414689?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 14:38:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fe5767d-bbf8-4f48-bdf3-3b3c52f760af</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Ok, then I will close this ticket.&lt;/p&gt;
&lt;p&gt;If you need more support for the callback in the future, please open a new ticket where you describe your current situation.&lt;/p&gt;
&lt;p&gt;Best regards, Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414465?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 16:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2330eab1-b440-45fd-a2c8-d4d43af7056a</guid><dc:creator>Martin Thompson</dc:creator><description>&lt;p&gt;I have successfully used the blocking uart RX function from the nrfx_uarte drivers :)&amp;nbsp; This is sufficient for my current work.&amp;nbsp; I may have to return in future as I still cannot get the DMA driven callback to work :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414345?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 11:01:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1edfd03-4b17-4e34-bb41-b7dc4fe0dece</guid><dc:creator>Martin Thompson</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for clarifying further on the various driver options.&amp;nbsp; Yes, I may be using the wrong end of the driver! It was not clear to me that prj.conf applies outside of the Zephyr context as well - I will try that later today &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Any thoughts on why I do not get any READY events in my handler would be gratefully received!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414335?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 10:08:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af0c14b8-47b6-48d2-9730-f5fc4ca5fc6f</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;I agree the Zephyr drivers *should* work, I was suggesting to try the nrfx driver mostly to see if you got any more helpful debug/error messages out of them.&lt;/p&gt;
[quote user="Martin Thompson"]It does not link, presumably I have to tell the tools I need another library.[/quote]
&lt;p&gt;I would suspect that perhaps you&amp;#39;ll have to enable your nrfx_uarte peripheral in prj.conf for it to link?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_NRFX_UARTE0"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_NRFX_UARTE0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or it could be that you&amp;#39;re seemingly using the hardware access layer driver instead of the actual uarte driver, which can be found at /v2.2.0/zephyr/drivers/serial/uart_nrfx_uarte.c&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/uarte/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/uarte/index.html&lt;/a&gt;&lt;/p&gt;
[quote user="Martin Thompson"]Some progress with the original problem using the Zephyr API: don&amp;#39;t make your Rx buffer too big... 256 bytes does not work[/quote]
&lt;p&gt;Glad to see you made progress with the Zephyr API, the 8-bit limitation comes from the maximum size of the uarte receive buffer:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuarte.html&amp;amp;cp=5_2_0_34_9_12&amp;amp;anchor=register.RXD.MAXCNT"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuarte.html&amp;amp;cp=5_2_0_34_9_12&amp;amp;anchor=register.RXD.MAXCNT&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure off the top of my head why you wouldn&amp;#39;t get the READY events through to your handler, but I&amp;#39;ll look into it.&lt;/p&gt;
[quote user="Martin Thompson"]the combination of confusions between SDK/rfconnect, Zephyr/non-zephyr, new/old UART, UARTE/UART drivers makes it *incredibly* difficult to find answers for yourself.[/quote]
&lt;p&gt;I agree this is intimidating when getting into this environment, but I think it mostly comes down to the documentation not always making it obvious what is new/old or common/fringe.&lt;/p&gt;
&lt;p&gt;SDK/nRFConnect: The nRF5 SDK is old and outdated, don&amp;#39;t use it. NCS (nRF Connect SDK) with Zephyr is what our developers are working on these days and will always be more up to date.&lt;/p&gt;
&lt;p&gt;Zephyr/non-Zephyr: I would recommend always using Zephyr&amp;#39;s drivers, and would only suggest using our drivers by themselves for debugging as they are being used under the hood when using Zephyr.&lt;/p&gt;
&lt;p&gt;UARTE/UART: UARTE is simply UART with EasyDMA, meaning data is sent directly from/to ram without cpu intervention. UART is normal good old UART. UARTE is default, and I would recommend using it, especially if you&amp;#39;re using BLE, as using EasyDMA can help you avoid BLE and UART fighting for CPU priority.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414244?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 20:12:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21b3c17d-f2b0-4a6a-a6f0-bbb3e5832d9d</guid><dc:creator>Martin Thompson</dc:creator><description>&lt;p&gt;Some progress with the original problem using the Zephyr API: don&amp;#39;t make your Rx buffer too big... 256 bytes does not work&amp;nbsp;(I think because the hardware only has an 8-bit counter - an error for this from the driver would be... helpful!) . Now I don&amp;#39;t get the extra END event. but the READY events are now not getting through to my handler...&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414242?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 19:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f272b77e-16d6-4e49-9977-7ab3a2032dfb</guid><dc:creator>Martin Thompson</dc:creator><description>&lt;p&gt;I&amp;#39;m pretty sure&amp;nbsp;there should be a &amp;#39;correct&amp;#39; way to do this, but my hacky workaround for now is:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;target_sources&lt;/span&gt;&lt;span&gt;(app PRIVATE src/main.c c:/app/ncs/v2.2.0/modules/hal/nordic/nrfx/drivers/src/nrfx_uarte.c)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;in CMakeLists.c &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414237?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 19:40:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36036429-5512-4944-81fd-8ba49370cf21</guid><dc:creator>Martin Thompson</dc:creator><description>&lt;p&gt;So, i have tried to use nrfx_uarte* directly.&amp;nbsp; It does not link, presumably I have to tell the tools I need another library.&amp;nbsp; So now I have a different problem.&amp;nbsp; After scouring the documentation for another hour, I can&amp;#39;t find what I need to there either.&amp;nbsp; I really felt that as an experienced embedded engineer I would be able to make something this straightforward work, but the combination of confusions between SDK/rfconnect, Zephyr/non-zephyr, new/old UART, UARTE/UART drivers makes it *incredibly* difficult to find answers for yourself.&amp;nbsp; So I am at the mercy of whoever reads this and might offer me a ray of light!&amp;nbsp; Simple examples which demonstrate (in a reusable way) how to operate the peripherals are also tricky to find - everything seems to depend on starting from a working sample,&amp;nbsp;but then adding features to that is a shot in the dark (as far as I can see)...&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Martin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414187?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 14:59:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:943ea978-413b-4d52-928d-e55538e9d9f1</guid><dc:creator>Martin Thompson</dc:creator><description>&lt;p&gt;Hi Einar, no I haven&amp;#39;t. It seemed to me that as I was using an RTOS (Zephyr) I should expect its features &amp;amp; APIs to work (given that they appear to be integrated with the nrf drivers) and that therefore would be the best way.&amp;nbsp; I didn&amp;#39;t want to get into everything at the driver level.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Perhaps *that* is where I made a mistake!&amp;nbsp; Is this not&amp;nbsp;recommended?&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE/Zephyr ASYNC API</title><link>https://devzone.nordicsemi.com/thread/414184?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 14:55:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1469d0d2-af95-448d-bbd5-d8785d9cb86f</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;Have you tried using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/uarte/driver.html#c.nrfx_uarte_rx"&gt;nrfx_uarte_rx&lt;/a&gt; function directly?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>