<?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 assign UART to different pins</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124170/how-to-assign-uart-to-different-pins</link><description>If I understand correctly, you can pretty much assign any pin to any peripheral. I&amp;#39;ve been using a modded central uart project on a dev board but on this other board I&amp;#39;m using, I don&amp;#39;t have access to the same pins. I think the pins are assigned in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Nov 2025 09:09:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124170/how-to-assign-uart-to-different-pins" /><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/554224?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2025 09:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f4a9382-ac67-4036-a930-6a32a7fa93a6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I just verified that it worked with the blinking pattern of your 3 LEDs. They blinked faster when P0.29 was connected to GND when I reset the device. So what I did was to redefine button0, as you can see in the app.overlay. If you look in your main.c, you can see that you fetch the switch:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SWITCH_NODE DT_ALIAS(sw0)
static const struct gpio_dt_spec user_switch = GPIO_DT_SPEC_GET(SWITCH_NODE, gpios);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;using sw0. sw0 is fetched from the aliases list in nrf52840dk_nrf52840.dts:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1763024708154v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;You can see the ones that are &amp;quot;greyed out&amp;quot; in this list, those are the ones that are redefined in app.overlay. This also means that you technically still have led3 (although it is not being used in your application. The same goes for sw1-3 that are defined but not used.&lt;/p&gt;
&lt;p&gt;The reason sw0 is not grey is that it is still mapped to button0, but button0 is redefined, so if you scroll up in that same file, you will see that the definition of button0 is greyed out.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/554152?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 14:49:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a2464cc-d765-4956-9a54-68c7d2036f33</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry to be slow, but I can&amp;#39;t see how this new part of the overlay file, ie this:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt; buttons 
 {
 compatible = &amp;quot;gpio-keys&amp;quot;;

 button0: button_0 
 {
 gpios = &amp;lt;&amp;amp;gpio0 29 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
 label = &amp;quot;Push button switch 0&amp;quot;;
 zephyr,code = &amp;lt;INPUT_KEY_0&amp;gt;;
 };
 };&lt;/pre&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;&lt;/div&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;Is then used to enable me to read the pin. &lt;br /&gt;&lt;br /&gt;Previously, when I took the original dts file and used sw0 I could just do this:&lt;br /&gt;&lt;br /&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#af00db;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;#define SWITCH_NODE DT_ALIAS(sw0)
static const struct gpio_dt_spec user_switch = GPIO_DT_SPEC_GET(SWITCH_NODE, gpios)

gpio_pin_configure_dt(&amp;amp;user_switch, GPIO_INPUT);

pin_value = gpio_pin_get_dt(&amp;amp;user_switch);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And pin value would change when the switch was pressed or not. &lt;br /&gt;&lt;br /&gt;So how does the new bit of code map to being able to read the pin? You&amp;#39;ve introduced this new [to me] &lt;br /&gt;&lt;br /&gt;zephyr,code = &amp;lt;INPUT_KEY_0&amp;gt;;zephyr,code = &amp;lt;INPUT_KEY_0&amp;gt;;&lt;br /&gt;&lt;br /&gt;And called it button0&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tried this:&lt;br /&gt;&lt;br /&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#af00db;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;#define SWITCH_NODE DT_ALIAS(button0)
And this
#define SWITCH_NODE DT_ALIAS(button_0)&lt;/pre&gt;
&lt;div&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&lt;br /&gt;&lt;br /&gt;But I get the same old error telling me &lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[{
    &amp;quot;resource&amp;quot;: &amp;quot;/home/robertw/ncs/v2.8.0/zephyr/include/zephyr/devicetree.h&amp;quot;,
    &amp;quot;owner&amp;quot;: &amp;quot;cpptools&amp;quot;,
    &amp;quot;severity&amp;quot;: 8,
    &amp;quot;message&amp;quot;: &amp;quot;&amp;#39;DT_N_ALIAS_button0_P_gpios_IDX_0_VAL_pin&amp;#39; undeclared here (not in a function); did you mean &amp;#39;DT_N_S_buttons_S_button_0_P_gpios_IDX_0_VAL_pin&amp;#39;?&amp;quot;,
    &amp;quot;source&amp;quot;: &amp;quot;gcc&amp;quot;,
    &amp;quot;startLineNumber&amp;quot;: 240,
    &amp;quot;startColumn&amp;quot;: 32,
    &amp;quot;endLineNumber&amp;quot;: 240,
    &amp;quot;endColumn&amp;quot;: 32
}]&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/554144?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 14:23:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:223beab2-5bf8-459b-9834-931a16b336a4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Oh, sorry. I just went with what I saw in the app.overlay.&lt;/p&gt;
&lt;p&gt;The idea is that you copy the parts that you want to change from the board files, paste it in your app.overlay, and change it in the app.overlay.&lt;/p&gt;
&lt;p&gt;I added it in the app.overlay of this project (as well as some minor, non important changes in my test_overlay_function() in main.c):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ccust_5F00_uart2.zip"&gt;devzone.nordicsemi.com/.../ccust_5F00_uart2.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/554135?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 13:51:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c021794b-6bb7-423c-a4d7-d68e6b26ee60</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;Many thanks, will read through more thoroughly it and give it a go.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In the meantime, after a quick scan, one question: what is the situation with the input pin on P0 29 please? There doesn&amp;#39;t seem to be anything for the issue where it was claiming:&amp;nbsp;&lt;/p&gt;
[quote userid="79197" url="~/f/nordic-q-a/124170/how-to-assign-uart-to-different-pins/553947"]message&amp;quot;: &amp;quot;identifier \&amp;quot;__device_dts_ord_DT_N_ALIAS_sel_sw_pin_P_gpios_IDX_0_PH_ORD\&amp;quot; is undefined&amp;quot;,&lt;br /&gt;[/quote]
&lt;p&gt;&lt;br /&gt;Thanks again.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/554121?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 12:46:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe8a981b-682b-412f-b5f7-02962572d659</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;FYI, I just looked through some of the warnings, such as this one:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1762951666009v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	get_mac_addr(read_mac_addr);
	if ((SCAN_FOR_NAME == scan_type) || (true == check_blank_addr(read_mac_addr)))
	{
		err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_NAME, DEVICE_NAME);
		filter_type = SCAN_FOR_NAME;
		new_pairing = true;
	}
	else if (SCAN_FOR_ADDR == scan_type)
	{						
		addr.type = BT_ADDR_LE_RANDOM;
		for (i=0; i&amp;lt;BT_ADDR_LE_STR_LEN; i++)
			addr.a.val[i] = read_mac_addr[i];	
		err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_ADDR, &amp;amp;addr);	
		filter_type = SCAN_FOR_ADDR;			
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;BT_ADDR_LE_STR_LEN = 30, and the add.a.val[i] ony have 6 elements, so you risk corrupting your RAM when writing outside the initial 6 elements in the array. You should definitiely look into this. Use &amp;quot;i &amp;lt;&amp;nbsp;BT_ADDR_SIZE&amp;quot; instead of &amp;quot;BT_ADDR_LE_STR_LEN&amp;quot;.&lt;/p&gt;
&lt;p&gt;Please see the attached projec.t I modified the app.overlay, added the sleep configuration for the UART, and also added the &amp;quot;&amp;amp;uicr&amp;quot;, which is needed to be able to use the NFC pins as normal GPIOs.&lt;/p&gt;
&lt;p&gt;I also added a small function (test_overlay_function()) in main.c, just to check that everything is working.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that if you are testing on a DK, the NFC pins (P0.09 and P0.10) is not routed out to the pin header without moving some 0R resistors. That should be fine if you have a custom board.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5086.ccust_5F00_uart.zip"&gt;devzone.nordicsemi.com/.../5086.ccust_5F00_uart.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/553957?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 11:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea242bd-3257-4683-9e06-31546da4a0e2</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/central_5F00_uart_5F00_11_5F00_11.zip"&gt;devzone.nordicsemi.com/.../central_5F00_uart_5F00_11_5F00_11.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;File attached. &lt;br /&gt;I have a switch on Port 0 29. &lt;br /&gt;UART Out is on P 0 10, &lt;br /&gt;UART in is on P0 09&lt;br /&gt;&lt;br /&gt;RTS 0 13&lt;br /&gt;CTS 0 15&lt;br /&gt;&lt;br /&gt;Although I am pretty sure we won&amp;#39;t use those last two flow control pins and do NOT want to use them to start with.&lt;br /&gt;&lt;br /&gt;Point taken on the formatting&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/553955?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 11:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72a56546-4cf7-42d0-8c41-a4c1b585b8cc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you please upload your application, and state clearly what pins you want to use, and I can try to have a look?&lt;/p&gt;
&lt;p&gt;Also, when you are pasting code snippets, it is easier to read (indentation is much better) if you use &amp;quot;insert&amp;quot;-&amp;gt;&amp;quot;Code&amp;quot; here in DevZone.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/553947?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 10:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e13d16-b4d8-4208-88d4-b04a0d80aeb9</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;OK, next question, what about input pins. I&amp;#39;ve spent another day trying to get this working.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve added this to the overlay file.&lt;/p&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;buttons&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;compatible&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;quot;gpio-keys&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;sel_sw_pin:&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;sel_sw_pin&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;gpios&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;lt;&amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;gpio0&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#098658;"&gt;29&lt;/span&gt;&lt;span style="color:#000000;"&gt; (&lt;/span&gt;&lt;span style="color:#800000;"&gt;GPIO_PULL_UP&lt;/span&gt;&lt;span style="color:#000000;"&gt; | &lt;/span&gt;&lt;span style="color:#800000;"&gt;GPIO_ACTIVE_LOW&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;label&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &lt;/span&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;sel_sw_pin&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This is now the alias section&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;aliases&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;grn-led-pin&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;green_led_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;led0&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;led0&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;blue-led-pin&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;blue_led_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;led1&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;led1&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;red-led-pin&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;red_led_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;led2&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;led2&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;sel-sw-pin&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;sel_sw_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;span style="color:#000000;"&gt; };&lt;br /&gt;&lt;br /&gt;But I get an error on the second line below:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#af00db;"&gt;#define&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SWITCH_NODE&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;DT_ALIAS&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;(sel_sw_pin)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;static&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;const&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;struct&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;gpio_dt_spec&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;user_switch&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;GPIO_DT_SPEC_GET&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SWITCH_NODE&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="color:#000000;"&gt;, gpios);&lt;br /&gt;&lt;br /&gt;With this familiar friend:&lt;br /&gt;&lt;br /&gt;message&amp;quot;: &amp;quot;identifier \&amp;quot;__device_dts_ord_DT_N_ALIAS_sel_sw_pin_P_gpios_IDX_0_PH_ORD\&amp;quot; is undefined&amp;quot;,&lt;br /&gt;&lt;br /&gt;It clearly is defined. :-( &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, I&amp;#39;ve tried adding this to the overlay:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;uicr&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;nfct-pins-as-gpios&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;span style="color:#000000;"&gt;And I get these errors:&lt;br /&gt;&lt;br /&gt;CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):&lt;br /&gt;&amp;nbsp; CMake configure failed for Zephyr project: central_uart&lt;br /&gt;&lt;br /&gt;&amp;nbsp; Location: /home/robertw/Software/Nordic/custom_service/central_uart&lt;br /&gt;Call Stack (most recent call first):&lt;br /&gt;&amp;nbsp; cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)&lt;br /&gt;&amp;nbsp; cmake/modules/sysbuild_default.cmake:20 (include)&lt;br /&gt;&amp;nbsp; /home/robertw/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)&lt;br /&gt;&amp;nbsp; /home/robertw/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)&lt;br /&gt;&amp;nbsp; /home/robertw/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)&lt;br /&gt;&amp;nbsp; template/CMakeLists.txt:10 (find_package)&lt;br /&gt;&lt;br /&gt;If I remove that and add this:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;pinctrl&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;uart0_default:&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;uart0_default&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;group1&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;psels&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;NRF_PSEL&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#800000;"&gt;UART_TX&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;0&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;10&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&amp;gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;NRF_PSEL&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#800000;"&gt;UART_RTS&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;0&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;13&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;group2&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;psels&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;NRF_PSEL&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#800000;"&gt;UART_RX&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;0&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;09&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&amp;gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;NRF_PSEL&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#800000;"&gt;UART_CTS&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;0&lt;/span&gt;&lt;span style="color:#000000;"&gt;, &lt;/span&gt;&lt;span style="color:#098658;"&gt;15&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;bias-pull-up&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; }; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;br /&gt;I get these errors:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; Location: /home/robertw/Software/Nordic/custom_service/central_uart&lt;br /&gt;Call Stack (most recent call first):&lt;br /&gt;&amp;nbsp; cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)&lt;br /&gt;&amp;nbsp; cmake/modules/sysbuild_default.cmake:20 (include)&lt;br /&gt;&amp;nbsp; /home/robertw/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)&lt;br /&gt;&amp;nbsp; /home/robertw/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)&lt;br /&gt;&amp;nbsp; /home/robertw/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)&lt;br /&gt;&amp;nbsp; template/CMakeLists.txt:10 (find_package)&lt;br /&gt;&lt;br /&gt;It tells me look at CMakeOutput.log&lt;br /&gt;&lt;br /&gt;But that has the hilariously unhelpful:&lt;br /&gt;&lt;br /&gt;The system is: Linux - 6.6.105-desktop-1.mga9 - x86_64&lt;br /&gt;&lt;br /&gt;Line and nothing else in it. :-(&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&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: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/553518?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2025 08:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b5a9e4a-0454-4728-add1-1da9e36fa977</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I agree that this is a bit confusing. The DeviceTree language is different from C. You can read about the syntax documentation &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/dts/intro-syntax-structure.html"&gt;here&lt;/a&gt;, and it is also discussed on &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-2-reading-buttons-and-controlling-leds/topic/devicetree/#devicetree-basics"&gt;DevAcademy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And yes, it is confusing that you can&amp;#39;t use underscore there, but when you translate it into C, to reference it, all &amp;quot;-&amp;quot; are translated to &amp;quot;_&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One neat trick is, if you are using the nRF Connect for VS Code extension, you can right click elements in the devicetree files (.dts/.dtsi/.overlay), and select &amp;quot;Copy C Identifier&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is a bit sensitive to what you right click, but e.g. if I copy the grn-led-pin:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1762417173233v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is what is copied into the clipboard:&lt;/p&gt;
&lt;p&gt;DT_PROP(DT_PATH(aliases), grn_led_pin)&lt;/p&gt;
&lt;p&gt;which you can use in your C-files.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/553421?ContentTypeID=1</link><pubDate>Wed, 05 Nov 2025 11:50:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0f53fcd-535d-4379-a044-06072353a03d</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;OK, that does work, thank, you, but what on earth is that all about? I have used underscore in C for decades and never come across an issue with it before. Why can you not use underscores here?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The other thing that makes no sense here is that&amp;nbsp;grn-led-pin&amp;nbsp; isn&amp;#39;t actually used anywhere, so that is that all about? What is the point of the alias?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/553373?ContentTypeID=1</link><pubDate>Wed, 05 Nov 2025 08:23:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a03d4373-9623-422d-90bd-00a6295bb45c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What NCS version are you using? I tried building it in v3.1.0, and it gave me this error, not the one that you saw:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7318.pastedimage1762330817079v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;When I changed the app.overlay:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2023 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

/ {
	 chosen 
	 {
		 nordic,nus-uart = &amp;amp;uart0;
	 };
	 leds 
	 {
		compatible = &amp;quot;gpio-leds&amp;quot;;

        green_led_pin: green_led_pin 
		{
            gpios = &amp;lt;&amp;amp;gpio1 10 GPIO_ACTIVE_LOW&amp;gt;;
            label = &amp;quot;green_led_pin&amp;quot;;
        };
		

	};

	aliases 
	{
		grn-led-pin = &amp;amp;green_led_pin;
		led0 = &amp;amp;led0;
	};

};

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;only on line 27, changing:&lt;/p&gt;
&lt;p&gt;grn_led_pin = &amp;amp;green_led_pin;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;grn-led-pin = &amp;amp;green_led_pin;&lt;/p&gt;
&lt;p&gt;And then it built fine. (some warnings regarding arguement types).&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t see what I am seeing, please let me know what NCS version you are using, and what your build command/build configuration is.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/552999?ContentTypeID=1</link><pubDate>Fri, 31 Oct 2025 11:43:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:141227c1-d8e4-47e4-b721-4a895f7fb68a</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;Hi and thanks for that. After eventually fixing a few overlay file issues from your suggestion I am still getting exactly the same problems.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2313.central_5F00_uart.zip"&gt;devzone.nordicsemi.com/.../2313.central_5F00_uart.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hopefully this zip will help. Line 55 in main.c has that same&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;__device_dts_ord_DT_N_ALIAS_grn_led_pin_P_gpios_IDX_0_PH_ORD\&amp;quot; is undefined&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Issue&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/552975?ContentTypeID=1</link><pubDate>Fri, 31 Oct 2025 10:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39f78a74-4139-4092-b91a-8bf540f0ca59</guid><dc:creator>Edvin</dc:creator><description>[quote user="DiBosco"]1. What is this uart sleep all about?&amp;nbsp;[/quote]
&lt;p&gt;If you are ever to disable the UART, then this says what state the used GPIOs should use in this state. Even if you never disable the UART (in the case where you always want to be able to receive UART messages, which are asynchronous, you can not disable it), then these still need to be defined in your devicetree (.dts/.dtsi/.overlay files).&lt;/p&gt;
[quote user="DiBosco"]2. That link about disabling P0.09 etc, I could not follow. There was something about meerkats, but what the actual solution is I do not get.&amp;nbsp;[/quote]
&lt;p&gt;Sorry if I was unclear. You said: &amp;quot;What if I needed to us, say P0.09 and P0.10?&amp;quot;&lt;/p&gt;
&lt;p&gt;So I am not sure whether you want to use exactly P0.09 and P0.10, or if that was just an example, and it might as well be P0.11 and P0.12.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it was just an example, and you might as well use P0.11 and P0.12, then you can just copy the devicetree snippet describing the pin numbers from the .dts/.dtsi files and add it to your .overlay file, and change it there.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to use P0.09 or P0.10 specifically, you need to specify that these are not to be used as NFC, so you need to add&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS=y&amp;nbsp; to your prj.conf. Then set them in your .overlay file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="DiBosco"]&lt;p&gt;3. Where is this arcane syntax explained? Let&amp;#39;s take this for example:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;uart0_default: uart0_default {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; group1 {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; psels = &amp;lt;NRF_PSEL(UART_TX, 0, 09)&amp;gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;NRF_PSEL(UART_RTS, 0, 11)&amp;gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;[/quote]
&lt;p&gt;You can have a look here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/dts/intro-syntax-structure.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/dts/intro-syntax-structure.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But usually, you don&amp;#39;t need to write these from scratch. Find what you want to change in the default board files, copy the parts that you want to change into your &amp;lt;board_name&amp;gt;.overlay file, and make the changes there.&amp;nbsp;&lt;/p&gt;
[quote user="DiBosco"]a, Why is&amp;nbsp;uart0_default repeated after a colon?&amp;nbsp;[/quote]
&lt;p&gt;It is the syntax developed by Devicetree (see link above).&lt;/p&gt;
[quote user="DiBosco"]b. what is the &amp;quot;group&amp;quot; thing all about?&amp;nbsp;[/quote]
&lt;p&gt;It is just how it is defined in some yml file in Zephyr. Typically one group for input pins and one group for output pins.&lt;/p&gt;
[quote user="DiBosco"]c. What does psels mean?&amp;nbsp;[/quote]
&lt;p&gt;Pin selects. Just a syntax to map the correct pin accross all ports (P0, P1). Espesially useful for chips with many ports (P0 .. P9).&lt;/p&gt;
[quote user="DiBosco"]What do I need to do here please? [/quote]
&lt;p&gt;I suggest you make it a bit easier for yourself, and don&amp;#39;t try to create your own custom &amp;quot;gpioCustom&amp;quot;, but use the defined structure &amp;quot;leds&amp;quot; for output GPIOs (and &amp;quot;buttons&amp;quot; for input GPIOs).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Something like:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// in &amp;lt;board_name&amp;gt;.overlay:
 / {
    leds {
		compatible = &amp;quot;gpio-leds&amp;quot;;

        green_led_pin: green_led_pin {
            gpios = &amp;lt;&amp;amp;gpio1 10 GPIO_ACTIVE_LOW&amp;gt;;
            label = &amp;quot;green_led_pin&amp;quot;;
        };
		
		led0: led_0 {
			gpios = &amp;lt;&amp;amp;gpio0 3 GPIO_ACTIVE_HIGH&amp;gt;;
			label = &amp;quot;sample_pin&amp;quot;;
		};
    aliases {
        grn_led_pin = green_led_pin
		led0 = &amp;amp;led0;
	};
};


//in main.c:
#define LED_GREEN_NODE DT_ALIAS(grn_led_pin)
static const struct gpio_dt_spec green_led = GPIO_DT_SPEC_GET(LED_GREEN_NODE, gpios);

static void configure_gpio(void)
{
    int err = 0;
    // Output pins:
    
    err = gpio_pin_configure_dt(&amp;amp;green_led, GPIO_OUTPUT);
    if (err) {
        LOG_ERR(&amp;quot;couldn&amp;#39;t configure, err %d&amp;quot;, err);
    }
    
    gpio_pin_set_dt(&amp;amp;led0, 1); // turn on green LED.
    
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I believe something like that should work. If it doesn&amp;#39;t, please upload what you currently have, and I can have a look at something that I can build and test.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/552919?ContentTypeID=1</link><pubDate>Thu, 30 Oct 2025 14:25:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89800d69-2bd3-4cdc-8d7b-ccd796862ea4</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;Hi, finally back on this again. Thanks for the reply.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;An awful lot I&amp;#39;m still failing to grasp.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So, in no particular order:&lt;/p&gt;
&lt;p&gt;1. What is this uart sleep all about?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. That link about disabling P0.09 etc, I could not follow. There was something about meerkats, but what the actual solution is I do not get.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. Where is this arcane syntax explained? Let&amp;#39;s take this for example:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;uart0_default: uart0_default {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; group1 {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; psels = &amp;lt;NRF_PSEL(UART_TX, 0, 09)&amp;gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;NRF_PSEL(UART_RTS, 0, 11)&amp;gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;
&lt;p&gt;a, Why is&amp;nbsp;uart0_default repeated after a colon?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;b. what is the &amp;quot;group&amp;quot; thing all about?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;c. What does psels mean?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Having trawled through loads of other people asking similar questions I am completely failing to compile with simple GPIO reassignments for LED driving. I can change the dts file and it works fine, but the overlay file, not a chance. I&amp;#39;ve tried a zillion different combinations.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My app.overlay file which was already in the project and seems to be used according to the check above you mentioned:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;/&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;chosen&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;nordic,nus-uart&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;uart0&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;gpioCustom&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;green_led_pin:&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;green_led_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;gpios&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;lt;&amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;gpio1&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#098658;"&gt;10&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#800000;"&gt;GPIO_ACTIVE_LOW&lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;label&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &lt;/span&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;green_led_pin&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;aliases&lt;/span&gt;&lt;span style="color:#000000;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;grn_led_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &amp;amp;&lt;/span&gt;&lt;span style="color:#267f99;"&gt;green_led_pin&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;In main.c&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#af00db;"&gt;#define&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;LED_GREEN_NODE&lt;/span&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;DT_ALIAS&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;(grn_led_pin)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;static&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;const&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;struct&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#267f99;"&gt;gpio_dt_spec&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#001080;"&gt;green_led&lt;/span&gt;&lt;span style="color:#000000;"&gt; = &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;GPIO_DT_SPEC_GET&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;LED_GREEN_NODE&lt;/span&gt;&lt;span style="color:#000000;"&gt;, gpios);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;I am down to one error after loads of combinations of things:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;[{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;resource&amp;quot;: &amp;quot;/home/robertw/Software/Nordic/custom_service/central_uart/src/main.c&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;owner&amp;quot;: &amp;quot;C/C++: IntelliSense&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;code&amp;quot;: &amp;quot;20&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;severity&amp;quot;: 8,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;message&amp;quot;: &amp;quot;identifier \&amp;quot;__device_dts_ord_DT_N_ALIAS_grn_led_pin_P_gpios_IDX_0_PH_ORD\&amp;quot; is undefined&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;source&amp;quot;: &amp;quot;C/C++&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;startLineNumber&amp;quot;: 55,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;startColumn&amp;quot;: 46,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;endLineNumber&amp;quot;: 55,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;quot;endColumn&amp;quot;: 62&lt;br /&gt;}]&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;Or, more succinctly:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;__device_dts_ord_DT_N_ALIAS_grn_led_pin_P_gpios_IDX_0_PH_ORD\&amp;quot; is undefined&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;What do I need to do here please? &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;It shouldn&amp;#39;t be this difficult &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#000000;"&gt;to toggle a pin. :-( &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to assign UART to different pins</title><link>https://devzone.nordicsemi.com/thread/547922?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2025 13:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd93e8b7-9851-4687-a21e-7bf63d55ed82</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You are correct. It is recommended to leave everything in the SDK untouched. I prefer to, whenever I want to modify anything in a sample, even, to copy it outside the SDK and then run it from there. Copy the sample folder to a custom location, then clidk &amp;quot;Open an existing application&amp;quot; in VS Code:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1757076932326v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So to your actual question. You are on the right track. You should use an overlay file. There are a couple of different ways to do this. The most common way is to create a file with the board name that you are building for, such as:&lt;/p&gt;
&lt;p&gt;nrf52840dk_nrf52840.overlay&lt;/p&gt;
&lt;p&gt;if this is present in your application folder, or in a folder called &amp;quot;boards&amp;quot; that is present in your application folder (the same folder as the CMakeLists.txt), then the compiler should pick it up (you can verify it from the build log):&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1757077359721v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So in this file, you can specify everything you want to behave different from the default dts/dtsi files. So everything you want to change, you copy that block from the dts(i) file, paste it in your overlay file, and modify it there, such as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	uart0_default: uart0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 09)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RTS, 0, 11)&amp;gt;;
		};

		group2 {
			psels = &amp;lt;NRF_PSEL(UART_RX, 0, 10)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_CTS, 0, 12)&amp;gt;;
			bias-pull-up;
		};
	};

	uart0_sleep: uart0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 09)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RX, 0, 10)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RTS, 0, 11)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_CTS, 0, 12)&amp;gt;;
			low-power-enable;
		};
	};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;NB: You would want to change the uart0_sleep as well as uart0_default&lt;/p&gt;
&lt;p&gt;NBNB: pin P0.09 and P0.10 are by default the NFC pins on the nRF52840. This needs to be disabled to make them work as normal GPIOs. For this, please see this ticket:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/117026/can-the-nfc-port-be-disabled-and-used-as-gpio"&gt;Can the NFC port be disabled and used as GPIO?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>