<?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>How to init 2nd UARTin nRF52840?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90101/how-to-init-2nd-uartin-nrf52840</link><description>Hi All, 
 I&amp;#39;d like to init two uart in nRF52840. 
 However, i don&amp;#39;t know how to init the 2nd uart. 
 Is there any example about that? 
 Thanks.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jul 2022 10:03:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90101/how-to-init-2nd-uartin-nrf52840" /><item><title>RE: How to init 2nd UARTin nRF52840?</title><link>https://devzone.nordicsemi.com/thread/377574?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 10:03:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:693676a8-b0a1-4e69-9328-d019eb5fa9b4</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;It&amp;#39;s several years since last time I looked at the nRF5 SDK, but I&amp;#39;ll try to help you. Could you take a look at &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63990/rf52840-two-instances-of-uart-uarte"&gt;RF52840 Two instances of UART/UARTE&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to init 2nd UARTin nRF52840?</title><link>https://devzone.nordicsemi.com/thread/377565?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 09:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98f15ff9-92d1-465c-a92e-8cb5ffe9be74</guid><dc:creator>Jarvis.chen</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;m using &amp;quot;nRF5_SDK_17.1.0&amp;quot; with &amp;quot;SEGGER Embedded Studio&amp;quot;.&lt;/p&gt;
&lt;p&gt;Would you share some information about the development of 2 uart?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to init 2nd UARTin nRF52840?</title><link>https://devzone.nordicsemi.com/thread/377564?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 09:19:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec515693-4a65-4df0-906a-176f4a521da1</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Oh, it seems like you&amp;#39;re using the nRF5 SDK, correct? My advice was for the nRF Conect SDK&lt;/p&gt;
&lt;p&gt;For new products I would recommend you to use the nRF Connect SDK, see&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;nRF Connect SDK and nRF5 SDK statement&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to init 2nd UARTin nRF52840?</title><link>https://devzone.nordicsemi.com/thread/377562?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 09:17:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5de8f019-a576-45ed-b3b1-b00227f9c9bf</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I think this is quite straight forward, could you try something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;...
...
#define UART_0 DT_LABEL(DT_NODELABEL(uart0))
#define UART_1 DT_LABEL(DT_NODELABEL(uart1))

static const struct device *uart_dev_0;
static const struct device *uart_dev_1;

void main(void)
{
    ...
    uart_dev_0 = device_get_binding(UART_0);
    uart_dev_1 = device_get_binding(UART_1);
    ...
    //Now use uart_dev_0 with the UART API to control UART0
    //and use uart_dev_1 with the UART API to control UART1
    ...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t tested this, so let me know if you encounter any issues.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>