<?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>Cannot use UART1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118699/cannot-use-uart1</link><description>Hello, I cannot use UART1, and I don`t know the reason for that. I run the exercise: https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-4-serial-communication-uart/topic/exercise-1-5/ 
 using UART0, and it works fine. When</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Feb 2025 15:17:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118699/cannot-use-uart1" /><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522914?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 15:17:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10e76c3b-1d89-48b4-b880-0ad84f0443f4</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As I stated in one of my previous replies:&lt;/p&gt;
[quote user="Marte.M"]The pins of UART0 are routed through the interface MCU on the nRF52840 DK, so this is the UART interface you can access through the physical port on the DK. If you want to use UART1, you must change the pins in the devicetree overlay so that UART1 uses the pins that are used by UART0. You must also change zephyr,console to UART1 in devicetree.[/quote]
&lt;p&gt;The pins of UART1 are not connected to the USB connector on the DK, but the pins of UART0 are. In other words, you also need to change the UART1 node in the devicetree overlay such that it uses the pins that are originally used by UART0, i.e., the pins that are connected to the USB connector.&lt;/p&gt;
&lt;p&gt;Here you can see the default pins used by UART0 and UART1:&lt;/p&gt;
&lt;p&gt;UART0&lt;/p&gt;
&lt;table height="71" width="229"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;UART_TX&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;P0.06&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UART_RX&lt;/td&gt;
&lt;td&gt;P0.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UART_RTS&lt;/td&gt;
&lt;td&gt;P0.06&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UART_CTS&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;P0.07&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;UART1&lt;/p&gt;
&lt;table height="23" width="153"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;UART_TX&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;P1.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UART_RX&lt;/td&gt;
&lt;td&gt;P1.01&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522647?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 12:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bb336b5-6911-43a5-a434-6a6923b5f62f</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;No, I just connected the board to the laptop using USB and tried to receive messages from the board and display them on the terminal. Then, I tried transmitting messages to the board using the laptop keyboard. I updated this part of the DTS file to use uart1 rather than uart0.&lt;br /&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1739364014652v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522640?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 12:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e193940-e4ba-4bd8-8415-fac81c94fd4a</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What do you have connected to the other end of the UART to receive or transmit data? Have you connected the GPIOs of UART1 to something?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522619?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 10:45:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32a45b9c-a8bd-4e57-a13f-5997b415f374</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;When I used uart1 rather than uart0, I couldn`t receiver nor transmit any data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522609?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 10:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8face165-5003-4142-8231-7166c7b97190</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you clarify what you mean or what the problem is?&lt;/p&gt;
&lt;p&gt;There is nothing in UART1&amp;#39;s definition that should prevent it from working.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522256?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 15:11:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d732cb1-2144-4bd2-9d19-1537e2f3c8f4</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;Thank you for your response.&lt;br /&gt;Is there anything in the definition of the uart1 that prevents it from working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522237?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 14:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e687034-6abd-43b7-b49c-6aa08413ff57</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;UART0 is defined on lines 7-27 in &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs2/boards/nordic/nrf52840dk/nrf52840dk_nrf52840-pinctrl.dtsi#L7-L27"&gt;nrf52840dk_nrf52840-pinctrl.dtsi&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart0_default: uart0_default {
	group1 {
		psels = &amp;lt;NRF_PSEL(UART_TX, 0, 6)&amp;gt;,
			&amp;lt;NRF_PSEL(UART_RTS, 0, 5)&amp;gt;;
	};
	group2 {
		psels = &amp;lt;NRF_PSEL(UART_RX, 0, 8)&amp;gt;,
			&amp;lt;NRF_PSEL(UART_CTS, 0, 7)&amp;gt;;
		bias-pull-up;
	};
};

uart0_sleep: uart0_sleep {
	group1 {
		psels = &amp;lt;NRF_PSEL(UART_TX, 0, 6)&amp;gt;,
			&amp;lt;NRF_PSEL(UART_RX, 0, 8)&amp;gt;,
			&amp;lt;NRF_PSEL(UART_RTS, 0, 5)&amp;gt;,
			&amp;lt;NRF_PSEL(UART_CTS, 0, 7)&amp;gt;;
		low-power-enable;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;While UART1 is defined on lines 21-45 of the same file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart1_default: uart1_default {
	group1 {
		psels = &amp;lt;NRF_PSEL(UART_RX, 1, 1)&amp;gt;;
		bias-pull-up;
	};
	group2 {
		psels = &amp;lt;NRF_PSEL(UART_TX, 1, 2)&amp;gt;;
	};
};

uart1_sleep: uart1_sleep {
	group1 {
		psels = &amp;lt;NRF_PSEL(UART_RX, 1, 1)&amp;gt;,
			&amp;lt;NRF_PSEL(UART_TX, 1, 2)&amp;gt;;
		low-power-enable;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/522001?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 15:13:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe47e96e-0955-4c72-adf6-6260bf3ef70c</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;Currently, there is no specific use case. However, I want to enable both for future work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/521997?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 15:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:948c797b-6eb9-4423-a1af-adcd59b918d1</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1145.devicetree_5F00_generated.h"&gt;devzone.nordicsemi.com/.../1145.devicetree_5F00_generated.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the generated device tree file. Could you please tell me the lines of pinctrl that exist for uart0, not uart1?&lt;/p&gt;
&lt;p&gt;I thought uart1 assigned pinctrl as the&amp;nbsp;nrf52840dk_nrf52840.dts file contains this configuration for uart1&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;arduino_serial&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; current-speed &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;115200&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; pinctrl-0 &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1_default&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; pinctrl-1 &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1_sleep&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; pinctrl-names &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;quot;sleep&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;&lt;span&gt;and the nrf52840dk_nrf52840-pinctrl.dtsi contains this configuration for uart1_default and uart1_sleep&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;uart1_default:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uart1_default&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;group1&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; psels &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_RX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&amp;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; bias-pull-up;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&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;group2&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; psels &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_TX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;)&amp;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;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;uart1_sleep:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uart1_sleep&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;group1&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; psels &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_RX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&amp;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; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_TX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;)&amp;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; low-power-enable;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&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;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/521964?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 14:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb827bd-d46c-4ffb-9a19-3ea8b036d97b</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you explain what you want to use the different UARTs for?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/521956?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 13:52:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1b739d8-2bf2-412e-940c-2d9705dfee9c</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Look at the generated dts in build/zephyr - UART1 has none of the pinctrl stuff IIRC. You also need to disable all conflicting shared peripherials (TWI/SPI) in the dts overlay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/521955?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 13:45:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8bad7d6-f10f-429e-b00d-e4d5140ca4db</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;I want to use both uart0 and uart1, not just one of them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot use UART1</title><link>https://devzone.nordicsemi.com/thread/521944?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 13:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6e8ea75-12ce-4444-ba86-c83aad9a49cd</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is there a particular reason you want to use UART1 instead of UART0?&lt;/p&gt;
&lt;p&gt;The pins of UART0 are routed through the interface MCU on the nRF52840 DK, so this is the UART interface you can access through the physical port on the DK. If you want to use UART1, you must change the pins in the devicetree overlay so that UART1 uses the pins that are used by UART0. You must also change zephyr,console to UART1 in devicetree.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>