<?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>Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106015/use-reset-pin-as-gpio---nrf52840</link><description>Hi all, 
 I am developing an application for a custom board using the nRF52840. I need to use the reset pin (P0.18) as a regular GPIO, configured as an input with an associated interrupt. However, I am unable to set this pin as a GPIO. The steps I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Sep 2024 22:46:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106015/use-reset-pin-as-gpio---nrf52840" /><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/501432?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 22:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89dcf844-c5c5-4fcf-85cf-ce306665ec5d</guid><dc:creator>kentorth</dc:creator><description>&lt;p&gt;My nrf52840dk_nrf52840.dts file had the following:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;amp;gpio0 {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; status = &amp;quot;okay&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; gpio-reserved-ranges = &amp;lt;0 2&amp;gt;, &amp;lt;6 1&amp;gt;, &amp;lt;8 3&amp;gt;, &amp;lt;17 7&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; gpio-line-names = &amp;quot;XL1&amp;quot;, &amp;quot;XL2&amp;quot;, &amp;quot;AREF&amp;quot;, &amp;quot;A0&amp;quot;, &amp;quot;A1&amp;quot;, &amp;quot;RTS&amp;quot;, &amp;quot;TXD&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;CTS&amp;quot;, &amp;quot;RXD&amp;quot;, &amp;quot;NFC1&amp;quot;, &amp;quot;NFC2&amp;quot;, &amp;quot;BUTTON1&amp;quot;, &amp;quot;BUTTON2&amp;quot;, &amp;quot;LED1&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;LED2&amp;quot;, &amp;quot;LED3&amp;quot;, &amp;quot;LED4&amp;quot;, &amp;quot;QSPI CS&amp;quot;, &amp;quot;RESET&amp;quot;, &amp;quot;QSPI CLK&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;QSPI DIO0&amp;quot;, &amp;quot;QSPI DIO1&amp;quot;, &amp;quot;QSPI DIO2&amp;quot;, &amp;quot;QSPI DIO3&amp;quot;,&amp;quot;BUTTON3&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;BUTTON4&amp;quot;, &amp;quot;SDA&amp;quot;, &amp;quot;SCL&amp;quot;, &amp;quot;A2&amp;quot;, &amp;quot;A3&amp;quot;, &amp;quot;A4&amp;quot;, &amp;quot;A5&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I verified UICR was cleared and it kept asserting.&amp;nbsp; The &lt;span&gt;&lt;em&gt;gpio-reserved-ranges&lt;/em&gt;&amp;nbsp;&lt;/span&gt;was what caused the assertion.&amp;nbsp; Commenting that line out allowed me to move forward.&amp;nbsp; Putting this here in case someone else runs into the same issue.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thanks!&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/498174?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 06:54:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09f430cd-c560-43cd-986a-6be50fe497b5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, if the board was&amp;nbsp;previously programmed in a way that enabled pin reset, you will have to earse the UICR, as that is persistent. That can be done like you do, or more generall with &amp;quot;nrfjprog --recover&amp;quot; (which will&amp;nbsp;also work if AP protect is enabled).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/498116?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 16:24:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f843900f-8a73-40fa-9ce1-db63d21523f8</guid><dc:creator>YoannR</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;The only way to make it works for me is to launch the command at first use of my custom board:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --eraseuicr&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Before using Flash command (with softreset) from VS Code action.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/496033?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2024 13:47:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f390986a-a883-4b84-84b0-49340d55c5b2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The correct way to use the reset pin as normal GPIO in recent SDK releases is to do as you have done, making sure&amp;nbsp;gpio-as-nreset is not set (either by not setting it in the board files or deleting the propery in an overlay file).&lt;/p&gt;
&lt;p&gt;Have you checked with a debugger which pin number you get this assert for?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/495513?ContentTypeID=1</link><pubDate>Wed, 24 Jul 2024 21:00:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fd1d0dd-2006-4e3c-b53f-45498d8e6fc0</guid><dc:creator>kentorth</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I am currently using v2.7.0 with NRF52840 DK.&amp;nbsp; I want to use p0.18 as a chip select pin for SPI.&amp;nbsp; Per your answer above, I&amp;#39;ve modified the device tree overlay to match your UICR redefinition.&lt;/p&gt;
&lt;p&gt;Upon booting, I still get this&amp;nbsp;assertion:&lt;/p&gt;
&lt;p&gt;ASSERTION FAIL [(cfg-&amp;gt;port_pin_mask &amp;amp; (gpio_port_pins_t)(1UL &amp;lt;&amp;lt; (pin))) != 0U] @ WEST_TOPDIR/zephyr/include/zephyr/drivers/gpio.h:1005&lt;br /&gt; Unsupported pin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here are my overlay definitions:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;pinctrl&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;spi2_default:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;spi2_default&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;group1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;psels&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;SPIM_SCK&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;19&lt;/span&gt;&lt;span&gt;)&amp;gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;SPIM_MOSI&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;23&lt;/span&gt;&lt;span&gt;)&amp;gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;SPIM_MISO&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;00&lt;/span&gt;&lt;span&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;spi2&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi2&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;nordic,nrf-spi&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-0&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi2_default&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-1&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi2_sleep&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-names&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;quot;sleep&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;cs-gpios&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;gpio0&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;18&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;GPIO_ACTIVE_LOW&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uicr&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;/delete-property/&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gpio-as-nreset&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I&amp;#39;ve also tried without the uicr redefinition and also tried CONFIG_GPIO_AS_PINRESET in the proj.conf but it shows deprecrated.&lt;/span&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: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/457214?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2023 15:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef09480c-f1aa-4360-82a2-2f447d75b48d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Candela,&lt;/p&gt;
&lt;p&gt;Ah, sorry. On 2.3.0&amp;nbsp;CONFIG_GPIO_AS_PINRESET is what you should use, so you can ignore my comment about the devicetree as that is only relevant for&amp;nbsp;2.5.0 and later.&lt;/p&gt;
&lt;p&gt;Do you get it to work with VS Code as well as west flash now? For reference, this is what I tested with that worked for me:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        &amp;quot;nrf-connect.applicationOptions&amp;quot;: {
            &amp;quot;/home/eith/ncs/v2.5.0/zephyr/samples/basic/blinky&amp;quot;: {
              &amp;quot;flash&amp;quot;: {
                &amp;quot;softreset&amp;quot;: true,
                &amp;quot;skipBuild&amp;quot;: false
              }
            }
          }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/457210?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2023 14:59:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1291cf94-bd98-454c-8d3e-33b0f7eaa9d9</guid><dc:creator>Candela</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been trying&amp;nbsp;to modify the UICR node on an overlay file, but&amp;nbsp;upon reviewing the nRF52840dk original device tree file, I could not locate the &amp;quot;gpio-as-nreset&amp;quot; property, so I get an error when I try to&amp;nbsp;remove&amp;nbsp;it. I am using SDK v2.3.0 version,&amp;nbsp;could&amp;nbsp;this be the problem?&lt;/p&gt;
&lt;p&gt;I managed to softreset the device with west flash too.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Candela&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use RESET pin as GPIO - nRF52840</title><link>https://devzone.nordicsemi.com/thread/457188?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2023 14:10:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c28befe7-b113-415f-b613-c90edbc56120</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are two aspects here. Firstly,&amp;nbsp;CONFIG_GPIO_AS_PINRESET is deprecated, and you need to configure this in the device tree with&amp;nbsp;&amp;nbsp;gpio-as-nreset. So if you have your custom board files, don&amp;#39;t add it. If you are using DK board files (which as it), make an app.overlay file or similar with this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uicr {
        /delete-property/ gpio-as-nreset;
    };
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With this, the firmware itself will not configure the pin as reset, and you can use it as a GPIO.&lt;/p&gt;
&lt;p&gt;The next is programming. By default,&amp;nbsp;pin reset will be enabled when programming with west. You can avoid this with the &amp;quot;--softreset&amp;quot; option to west flash. This is also used by nRF Connect for VS Code, and to make vs code use soft reset you can add a softreset config as explained &lt;a href="https://nrfconnect.github.io/vscode-nrf-connect/release_notes/connect/2022.4.219.html?h=softreset#softreset"&gt;here&lt;/a&gt;. Note that you need to provide a path to a specific application, and this config only applies to that application (to use on multiple applications you need to specify it separately for each of the apps you need to use). (I have asked the team to make this a generic configuration and they are looking into that.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>