<?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>nRF5340, switch UART code to use another peripheral (uart1 instead of uart0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108737/nrf5340-switch-uart-code-to-use-another-peripheral-uart1-instead-of-uart0</link><description>I would like to setup a project that uses multiple UART peripherals, based off separate projects I have that each use 1 UART peripheral: 
 
 Separate project #1 (based off NCS 2.5.0 at nrf/samples/bluetooth/peripheral_uart) uses UART (based off DT_NODELABEL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Feb 2024 22:53:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108737/nrf5340-switch-uart-code-to-use-another-peripheral-uart1-instead-of-uart0" /><item><title>RE: nRF5340, switch UART code to use another peripheral (uart1 instead of uart0)</title><link>https://devzone.nordicsemi.com/thread/471657?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 22:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d6a4ca1-f592-44a8-a340-1fb6cb3108e0</guid><dc:creator>afok-esmart</dc:creator><description>&lt;p&gt;I also did get it working for my dual-core project as well; I ended using UART1 (with different pins) for the #1 code and UART0 (default i.e., no pins were changed) for the #2 code. In my case, &lt;span style="text-decoration:underline;"&gt;I didn&amp;#39;t need UART1 to output to the VCOM&lt;/span&gt; and chose P0.25 and P0.26.&amp;nbsp;&lt;strong&gt;In short, these were the &lt;span&gt;additional&lt;/span&gt; code changes I needed to make&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;nrf.overlay, add &amp;#39;&amp;amp;pinctrl&amp;#39; block&lt;/strong&gt; with my own default/sleep configurations (but w/ P0.25 and P0.26)
&lt;ul&gt;
&lt;li&gt;My default &amp;amp; sleep configurations had label &amp;#39;&lt;span&gt;&lt;strong&gt;uart1_alt_default&lt;/strong&gt;&lt;/span&gt;&amp;#39; and &amp;#39;&lt;span&gt;&lt;strong&gt;uart1_alt_sleep&lt;/strong&gt;&lt;/span&gt;&amp;#39; respectively&lt;/li&gt;
&lt;li&gt;Configurations had same format as ones like &amp;#39;uart0_default&amp;#39; and &amp;#39;uart0_sleep&amp;#39; (see NCS 2.5.0 at zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nrf.overlay, edit &amp;#39;&amp;amp;uart1&amp;#39; block&lt;/strong&gt;&amp;nbsp;to additionally have:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;pinctrl-0=&amp;lt; &amp;amp;&lt;span&gt;&lt;strong&gt;uart1_alt_default&lt;/strong&gt;&lt;/span&gt; &amp;gt;&lt;/li&gt;
&lt;li&gt;pinctrl-1=&amp;lt; &amp;amp;&lt;span&gt;&lt;strong&gt;uart1_alt_sleep&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&amp;gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340, switch UART code to use another peripheral (uart1 instead of uart0)</title><link>https://devzone.nordicsemi.com/thread/471656?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 22:51:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f747a020-2770-45f3-98c3-7e0e28393679</guid><dc:creator>afok-esmart</dc:creator><description>&lt;p&gt;Yes that seemed to be it; the net core was indeed &amp;#39;getting in the way&amp;#39; (thanks Hieu). &lt;strong&gt;If I made my changes to #1 (see original post), but in another project that didn&amp;#39;t utilize the network core, they worked.&lt;/strong&gt; In hindsight, I probably should have tried this first. But glad to know my changes to #1 are at least one way to change from uart0 to uart1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340, switch UART code to use another peripheral (uart1 instead of uart0)</title><link>https://devzone.nordicsemi.com/thread/471421?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2024 21:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2417097-f85d-4d10-8432-9c5f79b3c51e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi afok-esmart,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dtsi#L113-L119"&gt;By default, the 2nd UART interface with P1.00 and P1.01 are given to the network core UART&lt;/a&gt;. That&amp;#39;s likely why you are not getting the application core UART1 output, whose default pins are the same.&lt;/p&gt;
&lt;p&gt;Do you need UART1 to output to the virtual COM port? If not, the simplest way is to just change the pins to another unused pin. You can use &lt;a href="https://nrfconnect.github.io/vscode-nrf-connect/guides/work_with_devicetree_editor.html"&gt;the Devicetree Visual Editor&lt;/a&gt; to help you pick something not yet occupied.&lt;/p&gt;
&lt;p&gt;If you&amp;nbsp;do need the output to go to virtual COM too, you have a few options.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Only possible on nRF5340DK v1.0.0) Wire the changed pins to the UART interface available on P24 on the DK.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Give the network core some other pins to use.
&lt;ol&gt;
&lt;li&gt;Overlay the gpio_fwd node with other pins for the network core.&lt;/li&gt;
&lt;li&gt;If you are building the network core as a child image, add an overlay to the child_image folder to change &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet-pinctrl.dtsi#L7-L27"&gt;the network core&amp;#39;s default UART pins&lt;/a&gt; to the new pins.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Disable network core UART altogether.
&lt;ol&gt;
&lt;li&gt;Disable the gpio_fwd node in overlay by setting &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;status&lt;/span&gt; to &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;If you are building the network core as a child image, add an overlay to the child_image folder to disable &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts#L132-L138"&gt;the network core UART node&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>