<?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>nRF9160DK Use Pins P0.00, P0.01, P0.14, P0.15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66268/nrf9160dk-use-pins-p0-00-p0-01-p0-14-p0-15</link><description>Hello, 
 This question is related to https://devzone.nordicsemi.com/f/nordic-q-a/44150/taking-adc-readings-from-p0-14-and-p0-15/173235#173235 . I am using nRF9160DK board. 
 I am trying to use all those pins P0.00, P0.01, P0.14, P0.15 either for SPI or</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 May 2023 11:07:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66268/nrf9160dk-use-pins-p0-00-p0-01-p0-14-p0-15" /><item><title>RE: nRF9160DK Use Pins P0.00, P0.01, P0.14, P0.15</title><link>https://devzone.nordicsemi.com/thread/426861?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 11:07:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04fd3ed1-984b-46af-becb-ef304bde1699</guid><dc:creator>jfpastrana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I think we have the same issue. We cannot control P0.00 as a simple GPIO.&lt;/p&gt;
&lt;p&gt;We are currently working with the following environment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NCS 2.3.0&lt;/li&gt;
&lt;li&gt;NRF9160&lt;/li&gt;
&lt;li&gt;Application copied from Asset Tracker V2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We have created a new board, taking as a reference the following issue:&amp;nbsp;&lt;a title="devicetree error: /ipc/ipc0: undefined node label 'sram0_shared'" href="https://devzone.nordicsemi.com/f/nordic-q-a/91260/devicetree-error-ipc-ipc0-undefined-node-label-sram0_shared" rel="noopener noreferrer" target="_blank"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/91260/devicetree-error-ipc-ipc0-undefined-node-label-sram0_shared&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Therefore, we have copied the folder:&amp;nbsp;C:\ncs\v2.3.0\zephyr\boards\arm\nrf9160dk_nrf9160 and renamed the boards to our custom name.&lt;/p&gt;
&lt;p&gt;The deviceTree looks as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;gpio0 {
	status = &amp;quot;okay&amp;quot;;
	label = &amp;quot;GPIO_0&amp;quot;;
};

&amp;amp;uart0 {
	current-speed = &amp;lt;115200&amp;gt;;
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;uart0_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;uart0_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};

&amp;amp;uart1 {
	current-speed = &amp;lt;115200&amp;gt;;
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;uart1_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;uart1_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};

&amp;amp;pinctrl {
	uart0_default: uart0_default {
		group1 {
    	psels = &amp;lt;NRF_PSEL(UART_TX, 0, 6)&amp;gt;;
    };
    group2 {
    	psels = &amp;lt;NRF_PSEL(UART_RX, 0, 7)&amp;gt;;
    };
  };
	uart0_sleep: uart0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 6)&amp;gt;;
			low-power-enable;
		};
		group2 {
			psels = &amp;lt;NRF_PSEL(UART_RX, 0, 7)&amp;gt;;
		};
	};

  uart1_default {
	group1 {
		psels = &amp;lt;NRF_PSEL(UART_TX, 0, 13)&amp;gt;;
	};	
	group2 {
		psels = &amp;lt;NRF_PSEL(UART_RX, 0, 14)&amp;gt;;
	};
	};

	uart1_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 13)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RX, 0, 14)&amp;gt;;
			low-power-enable;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Moreover, we have redefined UART1, which it is the UART which uses P0.00 in the evaluation board.&lt;/p&gt;
&lt;p&gt;Meanwhile the code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  const struct device *const gpio0_group = device_get_binding(&amp;quot;GPIO_0&amp;quot;);

  if (!gpio0_group) {
    printk(&amp;quot;Could not get GPIO 0 device\n&amp;quot;);
    return;
  }

  if (!device_is_ready(gpio0_group)) {
    printk(&amp;quot;GPIO 0 device not ready.\n&amp;quot;);
    return;
  }

  int ret = gpio_pin_configure(gpio0_group, 0, GPIO_OUTPUT);
  if (ret) {
    printk(&amp;quot;Set GPIO0 0 pin failed (%d)&amp;quot;, ret);
    return;
  }
  gpio_pin_set(gpio0_group, 0, 1);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We are able to change the output of other PIN, 5, for instance. But not this one.&lt;/p&gt;
&lt;p&gt;How do we should approach this issue?&lt;/p&gt;
&lt;p&gt;We cannot start from a hello world example....&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160DK Use Pins P0.00, P0.01, P0.14, P0.15</title><link>https://devzone.nordicsemi.com/thread/271059?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 11:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67068324-6aa2-4ff7-a7ba-e02f70a94d4c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;While the default configuration in the hardware is that those pins are routed to the headers, the default behavior of the board controller firmware is to rout them to the VCOM (these pins are used for taking modem traces).&lt;/p&gt;
&lt;p&gt;When you build an NCS project for the nrf9160dk_nrf52840 board, the &amp;quot;board controller&amp;quot; functionality gets added automatically. And on startup, it will set the &amp;quot;control pins&amp;quot; based on a set of Kconfig options. You can see the Kconfig options for the nrf9160dk_nrf52840 board here: &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/boards/arm/nrf9160dk_nrf52840/Kconfig"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/master/boards/arm/nrf9160dk_nrf52840/Kconfig&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can read more about how the board controller works here: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/zephyr/boards/arm/nrf9160dk_nrf52840/doc/index.html#board-controller-firmware"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/zephyr/boards/arm/nrf9160dk_nrf52840/doc/index.html#board-controller-firmware&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, to change the board controller behavior, you can use any NCS project (that does not use the GPIO pins). I usually use Zephyr&amp;#39;s hello_world sample. You can then add the Kconfig options you want to the prj.conf file, and flash the resulting hex file to the board controller (remember to set SW5 to the correct position).&lt;/p&gt;
&lt;p&gt;In your case, you want to set CONFIG_BOADR_NRF9160DK_UART1_ARDUINO=y.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>