<?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>Unable to read from GPIO P0.10 on nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108732/unable-to-read-from-gpio-p0-10-on-nrf5340</link><description>I am trying to read from a GPIO configured as input and the value returned from gpio_pin_get_raw() is always 0. I have verified the voltage into the pin is 3.3v. Here is the code 
 
 
 
 
 
 
 
 
 
 
 I&amp;#39;m using ncs v2.4.2 
 This seems very simple. Am</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Mar 2024 23:00:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108732/unable-to-read-from-gpio-p0-10-on-nrf5340" /><item><title>RE: Unable to read from GPIO P0.10 on nRF5340</title><link>https://devzone.nordicsemi.com/thread/472147?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2024 23:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb2f37c4-9895-4b04-a263-3ad47b47a9e0</guid><dc:creator>tozz88</dc:creator><description>&lt;p&gt;Great. Thanks. This all works. It looks like I only needed the gpio-fwd section in my overlay file to be able to turn CONFIG_BT=y back on and sense activity in P0.10. Thanks for all your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read from GPIO P0.10 on nRF5340</title><link>https://devzone.nordicsemi.com/thread/471420?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2024 20:51:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c0c9bb1-cc41-4b1b-a8dd-ee3e4127c87b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, setting CONFIG_BT=y will enable the network core, which in turn enables the GPIO forwarding to the network core.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can create an overlay to change which pins are to be forwarded in the uart group for the gpio_fwd node. As an example, this overlay will remove the HWFC pins:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* Remove flow control pins*/
&amp;amp;gpio_fwd {
    uart {
        gpios = &amp;lt;&amp;amp;gpio1 1 0&amp;gt;, &amp;lt;&amp;amp;gpio1 0 0&amp;gt;;
    };
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The DT for the netcore build (hci_rpmsg) should also be updated so it doesn&amp;#39;t try to use the pins that are no longer being forwarded:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* remove flow control pins */
&amp;amp;pinctrl {
	uart0_default: uart0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 1, 1)&amp;gt;;
		};
		group2 {
			psels = &amp;lt;NRF_PSEL(UART_RX, 1, 0)&amp;gt;;
			bias-pull-up;
		};
	};
	uart0_sleep: uart0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 1, 1)&amp;gt;,
				&amp;lt;NRF_PSEL(UART_RX, 1, 0)&amp;gt;;
			low-power-enable;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To apply the overlay above to the hci_rpmsg child image, you can create a folder named &amp;#39;child_image&amp;#39; within your project&amp;#39;s source directory and place your overlay file inside it:&lt;/p&gt;
&lt;p&gt;├── child_image&lt;br /&gt;│&amp;nbsp;&amp;nbsp; └── hci_rpmsg.overlay&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/multi_image.html#permanent-configuration-changes-to-child-images"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/multi_image.html#permanent-configuration-changes-to-child-images&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read from GPIO P0.10 on nRF5340</title><link>https://devzone.nordicsemi.com/thread/471410?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2024 18:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0893886b-b8df-4a3b-ac0d-6a9d0a480d47</guid><dc:creator>tozz88</dc:creator><description>&lt;p&gt;Thank you. Yes, your hex file works on my system. From analyzing your sample app the main difference is you are using an empty prj.conf file?&lt;/p&gt;
&lt;p&gt;We do plan to use the network processor and I had CONFIG_BT=y in my prj.conf file. Setting this to CONFIG_BT=n allows my app to also read P0.10 now.&lt;/p&gt;
&lt;p&gt;Is it possible to remap nrf-gpio-forwarder to use a different gpio than P0.10? What would the overlay file for that look like?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read from GPIO P0.10 on nRF5340</title><link>https://devzone.nordicsemi.com/thread/471207?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2024 08:47:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41db5489-28c0-4851-8904-dcc9c01dc589</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t find any errors in the code you&amp;#39;ve posted. I also confirmed that it&amp;nbsp;works correctly on my 5340 DK without the need for any additional overlay files.&lt;/p&gt;
&lt;p&gt;Project&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pin_5F00_read.zip"&gt;devzone.nordicsemi.com/.../pin_5F00_read.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Compiled .hex&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8130.zephyr.hex"&gt;devzone.nordicsemi.com/.../8130.zephyr.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Result&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/pastedimage1709109812912v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Could you please&amp;nbsp;try to program the device with the zephyr.hex file above to see if that works? You can use nrfjprog to program it:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ nrfjprog --program zephyr.hex --chiperase --verify -r
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note: P0.10&amp;nbsp;will be assigned to the network core by default if you build for the the &amp;#39;nrf5340dk_nrf5340_cpuapp&amp;#39; board with a project that enables the network core (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/build/dts/api/bindings/gpio/nordic,nrf-gpio-forwarder.html"&gt;nordic,nrf-gpio-forwarder&lt;/a&gt;).&amp;nbsp;&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/pastedimage1709109940290v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read from GPIO P0.10 on nRF5340</title><link>https://devzone.nordicsemi.com/thread/471161?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2024 02:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65b67569-b206-4a0e-8620-f077cdf93b45</guid><dc:creator>tozz88</dc:creator><description>&lt;p&gt;I also tried the following. First, I added the following to my overlay file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	buttons {
		compatible = &amp;quot;gpio-keys&amp;quot;;
		button5: button_5 {
			gpios = &amp;lt;&amp;amp;gpio0 10 (GPIO_ACTIVE_HIGH)&amp;gt;;
			label = &amp;quot;IRQ_BT40&amp;quot;;
		};
	};

	aliases {
		ircr0 = &amp;amp;button5;
	};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then I rewrote the code as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define IRQ0 DT_NODELABEL(button5)
const struct gpio_dt_spec irqr = GPIO_DT_SPEC_GET(IRQ0, gpios);

void main(void)
{
  if (!device_is_ready(irqr.port)) printk(&amp;quot;IRQ not ready\n&amp;quot;);
  gpio_pin_configure_dt(&amp;amp;irqr, GPIO_INPUT);
  printk(&amp;quot;IRQ=%d\n&amp;quot;, gpio_pin_get_dt(&amp;amp;irqr));
  }
  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But this behaves the same as before.&lt;/p&gt;
&lt;p&gt;I looked through build/zephyr/zephyr.dts but don&amp;#39;t see any other device that uses P0.10.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>