<?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 a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118086/use-reset-pin-as-a-normal-gpio---nrf52832</link><description>Hi, I am using a custom nrf52832 device. In that device , button is connected with reset pin P0.21. due to reset functionality I am not able get interrupt from button. 
 how can I use P0.21 as normal gpio?? Can I implement long-press functionality on</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Jan 2025 09:29:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118086/use-reset-pin-as-a-normal-gpio---nrf52832" /><item><title>RE: Use Reset pin as a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/519228?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 09:29:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:707c67d9-b410-4b75-865d-62e3526afc62</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;I understand, but in your last reply you said that the reset pin now worked as a GPIO, but that there were some other issues with your device after flashing. Do you also see these issues after a power cycle of the board when flashing? What exactly is the issue you&amp;#39;re currently facing on your end?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use Reset pin as a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/519101?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 14:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05aeb13a-8bc0-4f05-9144-c64ac6d65b69</guid><dc:creator>bhargav_gondaliya</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt; , I want to use reset pin as normal gpio. when I press single time it should be &lt;strong&gt;hard reset by calling NVIC_SystemReset();&lt;/strong&gt; and when pressed for &amp;gt;=10 sec it should be&lt;strong&gt; hard reset and erase an eeprom&lt;/strong&gt; ( I have external eeprom in my custom nrf52832 board.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;case if(pins &amp;amp; BIT(button_0.pin)){  // detect p0.21
        printk(&amp;quot;button 0 pressed&amp;quot;);
        LOG_INF(&amp;quot;reset pressed\n\r&amp;quot;);
        read_time(rtc_dev,(time_t *)&amp;amp;unix_time);   // read time from mcp7940
        uint32_t reset_pressed_epoch_time = unix_time;
        while (!gpio_pin_get_dt(&amp;amp;button_0) &amp;amp;&amp;amp; (unix_time - reset_pressed_epoch_time) &amp;lt;= 10) //if time &amp;lt;10 sec while loop wii execute 
        {
            k_msleep(100);
            read_time(rtc_dev,(time_t *)&amp;amp;unix_time);
        }
        if (unix_time - reset_pressed_epoch_time &amp;gt; 10)  // if time &amp;gt;10 this condition will be true
        {
            Reset_Flag=1;
            eeprom_write(i2c_dev,EEPROM_RESET_FLAG_ADDRESS, &amp;amp;Reset_Flag, 1); // write reset flag value in eeprom
            eeprom_write(i2c_dev,EEPROM_RESET_TIME_FLAG, &amp;amp;current_epoch_time, 4); // write reset time in eeprom 
            guide_flag=1;
            eeprom_write(i2c_dev,EEPROM_DEVICE_GUIDE_ADDRESS,&amp;amp;guide_flag,1);
            reset_hardware_locally();  // erase some portion of eeprom
            //reset_hardware();
            k_msleep(1000);
            NVIC_SystemReset();  // hard reset
        }
        else
        {
            k_msleep(1000);
            NVIC_SystemReset(); // if button pressed &amp;lt;10 sec else statement will execute
        }
        break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use Reset pin as a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/519060?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 12:46:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00746cb9-d9ff-446b-9faf-5b9fb428401b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, it should be fine setting it up like this. You need to use the /delete-property/ if the gpio-as-nreset is set by default I believe. But why are you enabling the Softreset when flashing after doing so? The pin shouldn&amp;#39;t be needed to do a full reset when flashing? Have you tried power cycling the board and see if it works afterwards when you&amp;#39;ve flashed it like this? A full power cycle might be needed after flashing the device when using softreset.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What exactly are you using the reset pin GPIO for in your project?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use Reset pin as a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/518823?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 11:18:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f03e30-c2a2-488a-a7a9-ffb04b852f5f</guid><dc:creator>bhargav_gondaliya</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using a nRF Connect SDK v2.6.0. I have tried that solution did not worked.&lt;/p&gt;
&lt;p&gt;currently I have deleted &lt;strong&gt;gpio-as-nreset;&lt;/strong&gt; property like as below.&lt;br /&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;is it validate according to the format?&lt;/p&gt;
&lt;p&gt;also I added a line in setting.json file.&lt;/p&gt;
&lt;p&gt;In vscode file/preferences/setting/&amp;quot;nrf-connect.flash.softreset&amp;quot;: true (enabled from setting)&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-from-2025_2D00_01_2D00_17-15_2D00_30_2D00_33.png" /&gt;&lt;br /&gt;after that I able to use reset pin as gpio. but it is correct solution to use reset pin as gpio?? after that I am not able to connect a device via ble, not updating display etc..&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;because I want to implement single press and long press functionality on that pin.&lt;br /&gt;below is my code for long press and single press&lt;pre class="ui-code" data-mode="text"&gt;case if(pins &amp;amp; BIT(button_0.pin)){
        printk(&amp;quot;button 0 pressed&amp;quot;);
        LOG_INF(&amp;quot;reset pressed\n\r&amp;quot;);
        read_time(rtc_dev,(time_t *)&amp;amp;unix_time);
        uint32_t reset_pressed_epoch_time = unix_time;
        while (!gpio_pin_get_dt(&amp;amp;button_0) &amp;amp;&amp;amp; (unix_time - reset_pressed_epoch_time) &amp;lt;= 10)
        {
            k_msleep(100);
            read_time(rtc_dev,(time_t *)&amp;amp;unix_time);
        }
        if (unix_time - reset_pressed_epoch_time &amp;gt; 10)
        {
            Reset_Flag=1;
            eeprom_write(i2c_dev,EEPROM_RESET_FLAG_ADDRESS, &amp;amp;Reset_Flag, 1);
            eeprom_write(i2c_dev,EEPROM_RESET_TIME_FLAG, &amp;amp;current_epoch_time, 4);
            guide_flag=1;
            eeprom_write(i2c_dev,EEPROM_DEVICE_GUIDE_ADDRESS,&amp;amp;guide_flag,1);
            reset_hardware_locally();
            //reset_hardware();
            k_msleep(1000);
            NVIC_SystemReset();
        }
        else
        {
            k_msleep(1000);
            NVIC_SystemReset();
        }
        break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use Reset pin as a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/518818?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 10:33:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:716914df-9fee-4aae-af4d-280cff6acf2b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What version of the nRF Connect SDK are you using? In the latest versions (at least from NCS 2.7.0 and newer) the correct way to set the reset pin as a GPIO is through the devicetree. By default, the board&amp;#39;s devicetree sets the GPIO as a reset with the following. Removing this line from the .dts file should make the reset pin function as a GPIO. This is documented in the Zephyr 3.5 migration guide:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/releases/migration-guide-3.5.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/releases/migration-guide-3.5.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;strong&gt;&amp;amp;uicr {&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; gpio-as-nreset;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;};&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Simon&lt;/span&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 a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/518750?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 05:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36f4d5fe-9474-40c4-a34d-79580bd05cf5</guid><dc:creator>bhargav_gondaliya</dc:creator><description>&lt;p&gt;Thanks &lt;a href="https://devzone.nordicsemi.com/members/x4ce"&gt;X4ce&lt;/a&gt; , how can I implement that solution in my application?&lt;br /&gt;currently my setting.json looks like as below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
    &amp;quot;nrf-connect.taskBindings&amp;quot;: {
        &amp;quot;pristineBuild&amp;quot;: [
            {
                &amp;quot;taskName&amp;quot;: &amp;quot;Build: long_press_v2/build (active)&amp;quot;,
                &amp;quot;buildConfigs&amp;quot;: [
                    &amp;quot;${workspaceFolder}/build&amp;quot;
                ]
            }
        ]
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use Reset pin as a normal GPIO - nRF52832</title><link>https://devzone.nordicsemi.com/thread/518650?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 13:44:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:669989cd-ced3-47ea-aa54-ee880d027e7e</guid><dc:creator>X4ce</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This might be helpful for you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/100486/reset-pin-as-gpio/429399"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/100486/reset-pin-as-gpio/429399&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>