<?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 with openThread</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80597/uart-with-openthread</link><description>Hello Everyone, 
 I&amp;#39;m developing an application which makes use of UART in open thread sdk. 
 Now, libopenthread-nrf52840-sdk.a library already makes use of UART0, when I enable UART in sdk_config.h - it gives compilation error. 
 As described here ,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Oct 2021 08:56:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80597/uart-with-openthread" /><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/335018?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 08:56:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:981671f3-abc0-422a-b2e0-c42f197995bd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The issue is the pre-processor check in serial nrf_serial_init() - it should check if the legacy driver is actually enabled, not just if the legacy UART peripheral is present on the device.&lt;/p&gt;
&lt;p&gt;The fix is to use the same check as in the nrf_drv_uart_config_t struct:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/components/libraries/serial/nrf_serial.c b/components/libraries/serial/nrf_serial.c
index 730f4e74..c2e6f6bb 100644
--- a/components/libraries/serial/nrf_serial.c
+++ b/components/libraries/serial/nrf_serial.c
@@ -207,7 +207,7 @@ ret_code_t nrf_serial_init(nrf_serial_t const * p_serial,
     nrf_drv_uart_config_t drv_config;
     memcpy(&amp;amp;drv_config, p_drv_uart_config, sizeof(nrf_drv_uart_config_t));
     drv_config.p_context = (void *)p_serial;
-#if defined(UARTE_PRESENT) &amp;amp;&amp;amp; defined(UART_PRESENT)
+#if defined(NRF_DRV_UART_WITH_UARTE) &amp;amp;&amp;amp; defined(NRF_DRV_UART_WITH_UART)
     drv_config.use_easy_dma = (p_config-&amp;gt;mode == NRF_SERIAL_MODE_DMA);
 #endif
     ret = nrf_drv_uart_init(&amp;amp;p_serial-&amp;gt;instance,&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I tested it with the following configuration:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;q&amp;gt; UART_EASY_DMA_SUPPORT  - Driver supporting EasyDMA
 

#ifndef UART_EASY_DMA_SUPPORT
#define UART_EASY_DMA_SUPPORT 1
#endif

// &amp;lt;q&amp;gt; UART_LEGACY_SUPPORT  - Driver supporting Legacy mode
 

#ifndef UART_LEGACY_SUPPORT
#define UART_LEGACY_SUPPORT 0
#endif

// &amp;lt;e&amp;gt; UART0_ENABLED - Enable UART0 instance
//==========================================================
#ifndef UART0_ENABLED
#define UART0_ENABLED 0
#endif
// &amp;lt;q&amp;gt; UART0_CONFIG_USE_EASY_DMA  - Default setting for using EasyDMA
 

#ifndef UART0_CONFIG_USE_EASY_DMA
#define UART0_CONFIG_USE_EASY_DMA 0
#endif

// &amp;lt;/e&amp;gt;

// &amp;lt;e&amp;gt; UART1_ENABLED - Enable UART1 instance
//==========================================================
#ifndef UART1_ENABLED
#define UART1_ENABLED 1
#endif
// &amp;lt;/e&amp;gt;

// &amp;lt;/e&amp;gt;

// &amp;lt;/h&amp;gt; &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/334974?ContentTypeID=1</link><pubDate>Wed, 20 Oct 2021 04:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abec200d-85d6-4a2b-9f9f-755c5281657d</guid><dc:creator>ashish_shukla</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any update on this issue?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ashish Shukla&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/334198?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 14:06:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffe8b4e7-3cc3-4dd3-846a-3bb843fd0fcf</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Aha, now I have reproduced this issue, thank you for clarifying.&lt;/p&gt;
&lt;p&gt;I have not been able to fix it yet, but it is related to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44139/implementation-uart-to-examples-from-sdk/175985#175985"&gt;this answer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To find a solution, I will talk to some of my colleagues, and return tomorrow.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/334174?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb59b2c9-35d4-4316-b7dc-199b07a945f7</guid><dc:creator>ashish_shukla</dc:creator><description>&lt;p&gt;yes - the one shared by you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#ifndef UART0_ENABLED&lt;br /&gt;#define UART0_ENABLED 0&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;#ifndef UART1_ENABLED&lt;br /&gt;#define UART1_ENABLED 1&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;#ifndef APP_UART_ENABLED&lt;br /&gt;#define APP_UART_ENABLED 1&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;#ifndef APP_UART_DRIVER_INSTANCE&lt;br /&gt;#define APP_UART_DRIVER_INSTANCE 1&lt;br /&gt;#endif&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/334169?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:02:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2626f229-c1e8-4ed5-857e-a8b29cb88ab1</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="ashish_shukla"]To reproduce the issue, you can apply above settings to serial_uartes example.[/quote]
&lt;p&gt;Can you post the settings you refer to, here? &lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/334164?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 12:54:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7336eb68-e222-4449-92c0-91bd9de870ae</guid><dc:creator>ashish_shukla</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t share the project, it&amp;#39;s a project that we&amp;#39;ve deployed in the field. We&amp;#39;re adding some new features into it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Transition to nRF connect SDK will a big effort for us, we are considering that meanwhile.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To reproduce the issue, you can apply above settings to serial_uartes example. It&amp;#39;s the same compilation issue that I&amp;#39;m facing in my project.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/334135?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 11:57:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b63ade4-96c9-4d84-95a3-219e6aab2249</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Could you upload a zip file with the project that fails?&lt;br /&gt;This would make it easier to debug the problem.&lt;/p&gt;
&lt;p&gt;If you are still early in your project, we recommend new OpenThread projects to use the nRF Connect SDK.&lt;br /&gt;This is because new Thread features will be added to the nRF Connect SDK, and not the nRF5 SDK.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333972?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 13:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a43f267-f26b-4c70-9f6a-17aa3414d745</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I will add openthread to the &amp;quot;serial_uartes&amp;quot; example to try and recreate your issue.&lt;/p&gt;
&lt;p&gt;This will take some time, so I will return here with my results tomorrow.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333964?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 13:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b3d81ba-3f50-4236-b100-d59e2fddf71a</guid><dc:creator>ashish_shukla</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m familiar with&amp;nbsp;&lt;span&gt;serial_uartes example, built an application in past based on this. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With above settings&amp;nbsp;nrf_serial.c gives compilation error -&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrf_serial.c:211:15 &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;error: &amp;#39;nrf_drv_uart_config_t {aka struct &amp;lt;anonymous&amp;gt;}&amp;#39; has no member named &amp;#39;use_easy_dma&amp;#39;&lt;br /&gt; drv_config.use_easy_dma = (p_config-&amp;gt;mode == NRF_SERIAL_MODE_DMA);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you please try to compile this file at your end with open-thread&amp;nbsp;?&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333945?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 12:48:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a154f53-06fb-48e1-ae0c-01b6d4d4e291</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;When I set the following in sdk_config.h of one of the thread examples, the example builds fine.&lt;br /&gt;I found these in the userial_uartes example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#ifndef UART_ENABLED
#define UART_ENABLED 1
#endif

#ifndef UART1_ENABLED
#define UART1_ENABLED 1
#endif

#ifndef NRFX_UARTE_ENABLED
#define NRFX_UARTE_ENABLED 1
#endif

#ifndef NRFX_UARTE1_ENABLED
#define NRFX_UARTE1_ENABLED 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I suggest first testing the serial_uartes example, so you know how to use it. Then add relevant code and configuration to the thread example.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333938?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 12:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd64327-af73-44de-b291-ad5f642495a9</guid><dc:creator>ashish_shukla</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using &lt;span style="color:#008080;"&gt;UARTE&lt;/span&gt; peripheral.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ashish&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333930?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 12:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:817efc8f-812b-4454-90a6-d80e892b3fa5</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Just to make sure: Are you using the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fuart.html&amp;amp;cp=4_0_0_5_32"&gt;UART&lt;/a&gt; peripheral or &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fuarte.html&amp;amp;cp=4_0_0_5_33"&gt;UARTE&lt;/a&gt; peripheral?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333917?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 12:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05657be5-1b5e-4e48-90c2-ca2824aee931</guid><dc:creator>ashish_shukla</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your quick reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using serial_uartes example within peripheral examples. Can you please suggest settings when UART is controlled by nrf_serial library ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART with openThread</title><link>https://devzone.nordicsemi.com/thread/333904?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 11:26:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e63a66-add5-4e8c-8283-f43bb68137fe</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;In this case, the easiest alternative could just be to use UART1 instead of UART0.&lt;/p&gt;
&lt;p&gt;This depends on how you control the UART. But if you use the same method as in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/uart_example.html"&gt;UART sample&lt;/a&gt;, it should be the following settings:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#ifndef UART0_ENABLED
#define UART0_ENABLED 0
#endif

#ifndef UART1_ENABLED
#define UART1_ENABLED 1
#endif

#ifndef APP_UART_ENABLED
#define APP_UART_ENABLED 1
#endif

#ifndef APP_UART_DRIVER_INSTANCE
#define APP_UART_DRIVER_INSTANCE 1
#endif
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Does this fix your issue?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>