<?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 enable both physical uart0 and ble nus service uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116026/how-to-enable-both-physical-uart0-and-ble-nus-service-uart</link><description>Hi, I&amp;#39;m using nrf52810 ,nrf connect, zephyr, vscode extension. I’m having trouble using both UART0 and the NUS UART service. Here’s a snippet from my overlay file: 
 
 / { 
 chosen { 
 nordic,nus-uart = &amp;amp; uart0 ; 
 }; 
 }; 
 
 
 &amp;amp; uart0 { 
 compatible</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Nov 2024 19:31:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116026/how-to-enable-both-physical-uart0-and-ble-nus-service-uart" /><item><title>RE: How to enable both physical uart0 and ble nus service uart</title><link>https://devzone.nordicsemi.com/thread/509561?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 19:31:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:094e03e6-0bcc-459c-949b-8a7ce689d7b4</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi Teijo,&lt;/p&gt;
&lt;p&gt;The problem is that nRF52810 has only one hardware UART and it&amp;#39;s not possible to use the UART peripheral together for multiple stuff.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You suggestion of using a dummy UART (say, uart1) for the NUS in the dts file could help (though I have not tried it here). You could maybe set it&amp;#39;s status as disabled in the dts so that it does not attempt to assign a physical pin to it. I see that you have tried this and you get errors. Could you share your overlay file?&lt;/p&gt;
&lt;p&gt;Another idea would be to maybe try time-sharing the UART0 and NUS.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable both physical uart0 and ble nus service uart</title><link>https://devzone.nordicsemi.com/thread/509443?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 12:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50f95255-1abe-4c6a-8dec-5053e52a0e26</guid><dc:creator>Teijokk</dc:creator><description>&lt;p&gt;Thank you for the answer.&lt;/p&gt;
&lt;p&gt;I added this definition (without an &lt;code&gt;@base&lt;/code&gt; address) to the &lt;code&gt;nrf52810.dtsi&lt;/code&gt; file, and it still compiles fine:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;uart1:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uart_dummy&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Overlay file:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;/&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;chosen&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;nordic,nus-uart&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;prj file:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;CONFIG_UART_ASYNC_API&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NRFX_UARTE0&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_NRFX_UARTE1=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SERIAL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;In the &lt;code&gt;uart_peripheral&lt;/code&gt; example, &lt;code&gt;CONFIG_NRFX_UARTE0&lt;/code&gt; was set to &lt;code&gt;y&lt;/code&gt;. I tried setting &lt;code&gt;CONFIG_NRFX_UARTE1=y&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Can you provide advice on these configurations?&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;get a compilation error related to this line:&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;uart&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;DEVICE_DT_GET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_CHOSEN&lt;/span&gt;&lt;span&gt;(nordic_nus_uart));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;C:/ncs/v2.5.0/zephyr/include/zephyr/device.h:85:41: error: &amp;#39;__device_dts_ord_65&amp;#39; undeclared here (not in a function); did you mean &amp;#39;__device_dts_ord_15&amp;#39;?&lt;br /&gt; 85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)&lt;br /&gt; | ^~~~~~~~~&lt;br /&gt;C:/ncs/v2.5.0/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro &amp;#39;_DO_CONCAT&amp;#39;&lt;br /&gt; 132 | #define _DO_CONCAT(x, y) x ## y&lt;br /&gt; | ^&lt;br /&gt;C:/ncs/v2.5.0/zephyr/include/zephyr/device.h:85:33: note: in expansion of macro &amp;#39;_CONCAT&amp;#39;&lt;br /&gt; 85 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)&lt;br /&gt; | ^~~~~~~&lt;br /&gt;C:/ncs/v2.5.0/zephyr/include/zephyr/device.h:211:37: note: in expansion of macro &amp;#39;DEVICE_NAME_GET&amp;#39;&lt;br /&gt; 211 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))&lt;br /&gt; | ^~~~~~~~~~~~~~~&lt;br /&gt;C:/ncs/v2.5.0/zephyr/include/zephyr/device.h:228:34: note: in expansion of macro &amp;#39;DEVICE_DT_NAME_GET&amp;#39;&lt;br /&gt; 228 | #define DEVICE_DT_GET(node_id) (&amp;amp;DEVICE_DT_NAME_GET(node_id))&lt;br /&gt; | ^~~~~~~~~~~~~~~~~~&lt;br /&gt;C:/sw/ble/peripheral_uart_issue/src/main.c:63:36: note: in expansion of macro &amp;#39;DEVICE_DT_GET&amp;#39;&lt;br /&gt; 63 | static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart));&lt;br /&gt; | ^~~~~~~~~~~~~~~~~~&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;Any help is appreciate.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;br&lt;/div&gt;
&lt;div&gt;Teijo&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable both physical uart0 and ble nus service uart</title><link>https://devzone.nordicsemi.com/thread/509347?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 04:20:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27c1af7e-9fb5-4920-932c-4840725de2b0</guid><dc:creator>Zachary Parrish</dc:creator><description>&lt;p&gt;Hi Teijo,&lt;/p&gt;
&lt;p&gt;Since the nRF52810 has only one UART, you can&amp;#39;t use both UART0 and NUS on the same peripheral. Try this in your DTS:&lt;/p&gt;
&lt;p&gt;dts&lt;/p&gt;
&lt;p&gt;/ {&lt;br /&gt; chosen {&lt;br /&gt; nordic,nus-uart = &amp;amp;uart1;&lt;br /&gt; };&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;uart0 {&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;uart1 {&lt;br /&gt; status = &amp;quot;disabled&amp;quot;; // Dummy UART for NUS&lt;br /&gt;};&lt;br /&gt;This lets NUS use a &amp;quot;dummy&amp;quot; UART without conflicting with UART0.&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;
&lt;p style="padding-left:660px;"&gt;&lt;span style="font-size:75%;"&gt;&lt;a style="background-color:#ffffff;color:#000000;text-decoration:underline;" href="https://monkeymartgame.io"&gt;monkey mart&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>