<?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>Use 2 UARTE with SDK15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33558/use-2-uarte-with-sdk15</link><description>Hello, 
 I&amp;#39;m trying to configure 2 serial ports for a custom board with nRF52840 chip, but when I try to instance the second UART &amp;quot;NRF_SERIAL_UART_DEF(serial_uart1, 1);&amp;quot; the compiler raise an error. 
 ../../../../../../modules/nrfx/drivers/include/nrfx_uart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 May 2018 04:15:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33558/use-2-uarte-with-sdk15" /><item><title>RE: Use 2 UARTE with SDK15</title><link>https://devzone.nordicsemi.com/thread/131781?ContentTypeID=1</link><pubDate>Mon, 14 May 2018 04:15:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e67b98f-bdb6-4c38-a0d8-85f97539fc9f</guid><dc:creator>silivanov</dc:creator><description>&lt;p&gt;It helped me a solution. but what kind of NRF_SERIAL_CONFIG_DEF?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use 2 UARTE with SDK15</title><link>https://devzone.nordicsemi.com/thread/129189?ContentTypeID=1</link><pubDate>Fri, 20 Apr 2018 17:50:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3b1308b-f311-4f38-a55b-7263f4a294c7</guid><dc:creator>shsanchez</dc:creator><description>&lt;p&gt;It works perfectly.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use 2 UARTE with SDK15</title><link>https://devzone.nordicsemi.com/thread/128899?ContentTypeID=1</link><pubDate>Thu, 19 Apr 2018 07:11:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f17ddcf0-bf9a-4c60-be75-6d609289eb16</guid><dc:creator>kl-cruz</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sure!&lt;/p&gt;
&lt;p&gt;That&amp;#39;s right. UART1 is not supported. Serial peripheral with number 1 is only UARTE1 in nRF52840 SoC.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Required changes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To make it work with small amount of work please replace lines 77 and 78 in&amp;nbsp;nRF5_SDK_15.0.0_a53641a\integration\nrfx\legacy\nrf_drv_uart.h file.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Lines to change" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_uart_5F00_h1.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;WIth code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    #define NRF_DRV_UART_CREATE_UART(id)   _NRF_DRV_UART_CREATE_UART(id)
    #define _NRF_DRV_UART_CREATE_UART(id)  NRF_DRV_UART_CREATE_UART_##id
    #define NRF_DRV_UART_CREATE_UART_0  \
        .uart = NRFX_UART_INSTANCE(0),
    #define NRF_DRV_UART_CREATE_UART_1  \
        .uart = { .p_reg = NULL },&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To achieve:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Lines changed" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_uart_5F00_h2.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;It adds support for UARTE1 in nrf_drv_uart layer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to catch the case when UARTE1 is using without easydma support&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can also add assert in&amp;nbsp;nRF5_SDK_15.0.0_a53641a\integration\nrfx\legacy\nrf_drv_uart.c in line 115 to catch the case if somewhere UARTE1 is overriden to be used without EasyDMA support:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_uart_5F00_c1.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Please add code below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifdef NRF52840_XXAA
    if (inst_idx == 1)
    {
        ASSERT(p_config-&amp;gt;use_easy_dma);
    }
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to achieve:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nrf_5F00_drv_5F00_uart_5F00_c2.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NRF_SERIAL with UARTE1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Please remember to use NRF_SERIAL_MODE_DMA when create instance for UARTE1 in nrf serial using NRF_SERIAL_CONFIG_DEF.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_SERIAL_CONFIG_DEF(serial_config, NRF_SERIAL_MODE_DMA,
                      &amp;amp;serial_queues, &amp;amp;serial_buffs, NULL, sleep_handler);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think it should help You. In case of any problem please let me know!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>