<?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>Using UARTE in nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86338/using-uarte-in-nrf52832</link><description>Hi, 
 I want to receive some data in my nRF52832 from MATLAB over UART and send some other data from nRF52832 back to MATLAB. I need some bandwidth for data transfer from nRF to MATLAB so I&amp;#39;d like to use EasyDMA. 
 I have started by trying to get some</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Mar 2022 14:12:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86338/using-uarte-in-nrf52832" /><item><title>RE: Using UARTE in nRF52832</title><link>https://devzone.nordicsemi.com/thread/360585?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 14:12:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce445364-a53a-4c6a-8e57-68272ce59b77</guid><dc:creator>dpalma</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you very much for your response.&lt;/p&gt;
&lt;p&gt;I get that developing an SDK for an SoC/SoP must be really tough. Some people want high-level libraries and others prefer functions closer to the hardware level. However, I think that even simple firmware development is quite hard&amp;nbsp;on the nRF SDK. Maybe the whole product is targeted to actual firmware developers (I am not).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Getting to the actual point. I have a MATLAB app for passing some parameters to the nRF through UART. Then, the nRF programs and controls some electronics on my board. Also, I want to transfer some real-time data back to MATLAB. Thus, I guess that I better implement UARTE. I will take a look at the example in&amp;nbsp;&lt;span&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;SDK\examples\peripheral\libuarte&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using UARTE in nRF52832</title><link>https://devzone.nordicsemi.com/thread/360571?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 13:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2013160-816b-466c-a5a9-a3d2fd308331</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am sorry that your first impression of the SDK is not good.&amp;nbsp;&lt;/p&gt;
[quote user=""] I found that nrf_libuarte_async is the proper library for handling UARTE communications, right?[/quote]
&lt;p&gt;That is correct. The libuarte library, which is demonstrated in the example found in SDK\examples\peripheral\libuarte is designed to collect multiple bytes into a string that either fills up the buffer size, or times out.&lt;/p&gt;
&lt;p&gt;Remember that there is no &amp;quot;message size&amp;quot; in UART. It is just a &amp;quot;simple&amp;quot; protocol sending byte by byte. One way to work around this, which is probably the most common way, is to have either a set message length, that you know that the other device will send, or to use some special byte to mark as the end of the string (&amp;#39;\n&amp;#39; is commonly used). If you have an option to do that, since you are sending the data yourself from Matlab, I would recommend to just keep receiving bytes, and look for the &amp;quot;stop&amp;quot; byte that you have decided on. This is more or less what the ble_app_uart (SDK\examples\ble_peripheral\ble_app_uart) example is doing. It will trigger on either the stop byte or when the buffer is full.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t suit your use case, then you can use the libuarte. Just note that this driver demands some more resources to run (more timers).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>