<?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>Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76475/thingy-91-gpio-configuration</link><description>Hi, 
 I am trying to configure a GPIO pin P0.21(as this is exposed pin on Thingy:91) from nRF9160 on Thingy:91. 
 I am using nRF Connect SDK 1.4.1 with Nordic version of SES. 
 I tried using from zephyr documented here . 
 
 But I can&amp;#39;t see the pin going</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Jun 2021 07:24:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76475/thingy-91-gpio-configuration" /><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/316388?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 07:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6e60195-3d64-4ef4-aea0-1c647f7b5849</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p lang="en-GB"&gt;Thanks for explaining the details!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/316285?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 13:35:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3ccb142-f09d-4c49-8193-54a0aeb278d5</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote userid="100109" url="~/f/nordic-q-a/76475/thingy-91-gpio-configuration/316167#316167"]I’m still not quite sure how you physically can access P0.21 on the Thingy:91. Could you elaborate and/or send me a picture of it?[/quote]
&lt;p&gt;As it is mentioned in Thingy:91 pin mapping (SB7 is connected to P0.21 on the 9160 side and P0.21 on the nrf52840 side) in the following&amp;nbsp;image:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/0636.Capture.PNG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I want to establish a communication between 9160 and 52840. For which I am thinking to use &lt;strong&gt;MCU_IF3&lt;/strong&gt; as signal line (a high from 9160 will indicate 9160 wants to connect with 52840). So, I tried configuring P0.21 from 52840 side as Input GPIO, and P0.21 from 9160 side as Output GPIO. Here is the picture of Thingy:91 to make it more clear for you.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/1207.Thingy91.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I am testing with oscilloscope on SB7 highlighted with red square in the image.&lt;/p&gt;
&lt;p&gt;I will check with Run CMake command and will get back to this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/316167?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 06:50:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3f6c4ba-ef70-48e7-a7a0-8b22a2bb342a</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Shivek"]but nothing on GPIO P0.21. I tried cutting the SB7 to disconnect from nRF52840, didn&amp;#39;t make any difference.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;I’m still not quite sure how you physically can access P0.21 on the Thingy:91. Could you elaborate and/or send me a picture of it?&lt;/p&gt;
[quote user="Shivek"]I am building my application using SESv5.10d Nordic edition.[/quote]
&lt;p lang="en-GB"&gt;When adding or updating configuration files, you have to reload your project settings into SES to make them become effective before building. You can do that as shown in the picture below. I recommend you to check the build log to make sure that the overlay file has been considered during the compilation process.&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1624258350703v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;Regards,&lt;/p&gt;
&lt;p lang="en-GB"&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/316089?ContentTypeID=1</link><pubDate>Fri, 18 Jun 2021 13:29:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee263080-4b07-4c71-ae74-daa0017985b3</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;I have gone through the link you mentioned in your last post. So, I am assuming that we don&amp;#39;t have to tell compiler if we just add a text file and rename it as &lt;em&gt;thingy91_nrf9160ns.overlay.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I tried switching the red light ON, its working fine with the same code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;struct device *gpio;

gpio = device_get_binding(&amp;quot;GPIO_0&amp;quot;);
printf(&amp;quot;\r\nfunction return:%d&amp;quot;,err);

err = gpio_pin_configure(gpio, 21, GPIO_OUTPUT_ACTIVE);
err = gpio_pin_configure(gpio, 29, GPIO_OUTPUT_ACTIVE);

k_sleep(K_SECONDS(5));
err = gpio_pin_set(uart, 21, 1);
err = gpio_pin_set(gpio, 29, 1);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After 5 sec, I can see the red LED ON but nothing on GPIO P0.21. I tried cutting the SB7 to disconnect from nRF52840, didn&amp;#39;t make any difference.&amp;nbsp;&lt;/p&gt;
[quote userid="100109" url="~/f/nordic-q-a/76475/thingy-91-gpio-configuration/315997#315997"]How are you building your application? Via SES or a bash/terminal?[/quote]
&lt;p&gt;I am building my application using SESv5.10d Nordic edition.&lt;/p&gt;
&lt;p&gt;This is disappointing to me as our next target is to build custom application using nRF9160 and nRF52840.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for keeping up with me.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/315997?ContentTypeID=1</link><pubDate>Fri, 18 Jun 2021 05:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a029393-ea69-43ee-883a-a2a07eb97c4c</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p lang="en-GB"&gt;Have you just tried to fire up one of the lightwell LEDs to&amp;nbsp;confirm that the snippet works in general?&lt;/p&gt;
&lt;p lang="en-GB"&gt;It is possible to change properties in the .dts files, but I’m not recommending you to do so. What you are trying to achieve is exactly the purpose of an overlay file, as you can read more about &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/zephyr/guides/dts/howtos.html#use-devicetree-overlays"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p lang="en-GB"&gt;How are you building your application? Via SES or a bash/terminal?&lt;/p&gt;
&lt;p lang="en-GB"&gt;Regards,&lt;/p&gt;
&lt;p lang="en-GB"&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/315983?ContentTypeID=1</link><pubDate>Thu, 17 Jun 2021 21:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d363c243-20f2-4a14-b270-4e87160d9a4e</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;I tried making overlay file. But it didn&amp;#39;t help me. I disabled the uart and I deleted the cts-pin property. Just one thing I did differently is I deleted P0.21 property in&amp;nbsp; thingy91_nrf9160_common.dts files. Below is the screenshot of the updated dts file.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/5531.Capture.PNG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So, as mentioned in the schematics of Thingy91. P0.21 is attached to cts-pin of the uart1(as opposed to what you suggested me). But still I am not getting the control of the GPIO pin.&lt;/p&gt;
&lt;p&gt;Can you please make sure that I don&amp;#39;t have to add the overlay file to tell the compiler about it. I mean I just make a text file and added those lines which&amp;nbsp; you told me to. Is that enough for the purpose?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/315980?ContentTypeID=1</link><pubDate>Thu, 17 Jun 2021 20:42:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b745e0e8-0245-4ea8-9c33-6179d22fa1dd</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Thanks for responding. I will try that once I am finished with other task.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Thingy:91 GPIO configuration</title><link>https://devzone.nordicsemi.com/thread/315969?ContentTypeID=1</link><pubDate>Thu, 17 Jun 2021 18:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ca55e46-97c6-4ba0-bf25-316210bbeedf</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p lang="en-GB"&gt;Hello Shivek,&lt;/p&gt;
&lt;p lang="en-GB"&gt;I’m not quite sure what you mean by pin P0.21 is the exposed one on the Thingy:91. Can you elaborate?&lt;/p&gt;
&lt;p lang="en-GB"&gt;Anyway, as you can see in the &lt;a href="https://infocenter.nordicsemi.com/topic/ug_thingy91/UG/thingy91/hw_description/pin_maps.html"&gt;pin mapping&lt;/a&gt; of the Thingy:91, P0.21 is used as MCU_IF3. This means that the pin is part of the interface mapping towards the nRF52840, as you can see in the picture below (for more information please check the Hardware files section on the &lt;a href="https://www.nordicsemi.com/Software-and-tools/Prototyping-platforms/Nordic-Thingy-91/Download"&gt;Thingy:91 Download page&lt;/a&gt;).&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0044.pastedimage1623954933851v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;If you&amp;nbsp;have a look at the file .&lt;em&gt;./build/zephyr/zephyr.dts&amp;nbsp;&lt;/em&gt;(in your application root folder), you can find the details on the usage of this pin, as shown here:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart0: uart@8000 {
				compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
				reg = &amp;lt; 0x8000 0x1000 &amp;gt;;
				interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
				status = &amp;quot;okay&amp;quot;;
				label = &amp;quot;UART_0&amp;quot;;
				current-speed = &amp;lt; 0x1c200 &amp;gt;;
				tx-pin = &amp;lt; 0x12 &amp;gt;;
				rx-pin = &amp;lt; 0x13 &amp;gt;;
				rts-pin = &amp;lt; 0x14 &amp;gt;;
				cts-pin = &amp;lt; 0x15 &amp;gt;;
			};&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;This is probably reason why the pin is not going high after power-up, because it is used as the cts-pin by the UART0 peripheral. You might wanna disable the UART0:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart0 {
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;or at least remove the pin assignment from it:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart0 {
    /delete-property/ cts-pin;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;To do so, you can create a file in your application root folder named: &lt;em&gt;thingy91_nrf9160.overlay&lt;/em&gt; (or t&lt;em&gt;hingy91_nrf9160ns.overlay&lt;/em&gt;,&amp;nbsp;depending on what you are building your application for), and add the above mentioned content.&lt;/p&gt;
&lt;p lang="en-GB"&gt;Alternatively, just to check if your code works, you could use the pins 29, 30 and 31 as they will fire up the lightwell LEDs in different colours.&lt;/p&gt;
&lt;p lang="en-GB"&gt;I hope this will help you!&lt;/p&gt;
&lt;p lang="en-GB"&gt;Regards,&lt;/p&gt;
&lt;p lang="en-GB"&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>