<?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>Error building sample blinky for custom board: &amp;#39;__device_dts_ord_13&amp;#39; undeclared here (not in a function)&amp;#39;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95643/error-building-sample-blinky-for-custom-board-__device_dts_ord_13-undeclared-here-not-in-a-function</link><description>I made a custom board with a nRF52840 module on it. Now I want test it blinking its led. So in VS Code and nRF Connect extension I created my custom board with the wizard tool. The DTS is 
 
 I added the aliases as suggested in the README.rst but using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 May 2023 10:53:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95643/error-building-sample-blinky-for-custom-board-__device_dts_ord_13-undeclared-here-not-in-a-function" /><item><title>RE: Error building sample blinky for custom board: '__device_dts_ord_13' undeclared here (not in a function)'</title><link>https://devzone.nordicsemi.com/thread/423741?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 10:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5a2e61a-8a4b-4e34-b9ea-c7898e8a55db</guid><dc:creator>Geetha</dc:creator><description>&lt;p&gt;Create an esp32.overlay file in the location of the project and paste the below code&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
     aliases {
             led0 = &amp;amp;myled0;
     };

     leds {
             compatible = &amp;quot;gpio-leds&amp;quot;;
             myled0: led_0 {
                     gpios = &amp;lt;&amp;amp;gpio0 2 GPIO_ACTIVE_LOW&amp;gt;;
             };
     };
};
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error building sample blinky for custom board: '__device_dts_ord_13' undeclared here (not in a function)'</title><link>https://devzone.nordicsemi.com/thread/404859?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2023 16:32:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:385febe7-25ec-4372-a242-f9c885680118</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to enable gpio1 in devicetree. All you need to do is to add the following to your custom dts file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;gpio1 {
	status = &amp;quot;okay&amp;quot;;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you still get the same error after adding this, delete the build directory completely&amp;nbsp;and build again.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error building sample blinky for custom board: '__device_dts_ord_13' undeclared here (not in a function)'</title><link>https://devzone.nordicsemi.com/thread/404620?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 15:29:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:def2bda0-f895-4d48-abe5-cab6dbd4c387</guid><dc:creator>Andrea Verdecchia</dc:creator><description>&lt;p&gt;I forgot to post the main code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;

/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS   1000

/* The devicetree node identifier for the &amp;quot;led0&amp;quot; alias. */
#define LED0_NODE DT_ALIAS(ledred)

/*
 * A build error on this line means your board is unsupported.
 * See the sample documentation for information on how to fix this.
 */
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

void main(void)
{
	int ret;

	if (!device_is_ready(led.port)) {
		return;
	}

	ret = gpio_pin_configure_dt(&amp;amp;led, GPIO_OUTPUT_ACTIVE);
	if (ret &amp;lt; 0) {
		return;
	}

	while (1) {
		ret = gpio_pin_toggle_dt(&amp;amp;led);
		if (ret &amp;lt; 0) {
			return;
		}
		k_msleep(SLEEP_TIME_MS);
	}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>