<?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>pin reset disable</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110653/pin-reset-disable</link><description>Hi all 
 (I&amp;#39;m using vs studio code and nrf 2.5.1) 
 I&amp;#39;m having difficulty disabling the reset function related to the reset pin. I can&amp;#39;t use the pin as GPIO and if I put 0V (GND) on the pin the microcontroller restarts. 
 
 I already searched in the forum</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 May 2024 09:17:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110653/pin-reset-disable" /><item><title>RE: pin reset disable</title><link>https://devzone.nordicsemi.com/thread/481729?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 09:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82166a53-0043-48dc-8a73-003d9240d091</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you building for the nRF52833 DK or a custom board?&lt;/p&gt;
&lt;p&gt;The pin reset is enabled by default in the nRF52833 DK board DTS file. Did you comment this, or only in the project overlay?&lt;/p&gt;
&lt;p&gt;You can also use the delete-node property to disable it in the overlay:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/delete-node/ &amp;amp;uicr;&lt;/pre&gt;&lt;/p&gt;
[quote user="Lorenz898989"]I also found that the assignment of the thirty-first bit of PSELRESET (which is used to disconnect the function) was not being handled correctly: I ended up with PSELRESET[0,1] being valued at 0 instead of being valued at 1&amp;lt; &amp;lt;31 [/quote]
&lt;p&gt;You cannot &amp;quot;assign&amp;quot; the 31st bit and set it to 1 if it is already cleared/set to 0. UICR works like flash and needs to be erased to &amp;quot;write&amp;quot; bits to 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pin reset disable</title><link>https://devzone.nordicsemi.com/thread/481451?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 07:33:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:046d5a5c-c943-4111-9267-a2653140f4dc</guid><dc:creator>Lorenz898989</dc:creator><description>[quote userid="14926" url="~/f/nordic-q-a/110653/pin-reset-disable/481074"]&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The reset pin should now be configured in the devicetree, as described in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/releases/migration-guide-3.5.html#recommended-changes"&gt;migration guide draft&lt;/a&gt;. The Kconfig should still work for nRF Connect SDK v2.5.1 though.&lt;/p&gt;
&lt;p&gt;Note that if pinreset have been enabled by an older firmware, you need to erase UICR (using &amp;quot;Erase and Flash to Board&amp;quot; button in VSCode) in order to disable the pinreset functionality:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;cursor:zoom-in;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1714393128247v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;[/quote]
&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;J&amp;oslash;rgen&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I commented on the .dts file and on the .overlay file&amp;nbsp;in this way&lt;br /&gt; &amp;amp;uicr {&lt;br /&gt; //gpio-as-nreset; &lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;I recompiled the entire project and manually deleted the flash, however the micro controller keeps restarting.&lt;/p&gt;
&lt;p&gt;Any other suggestions?&lt;/p&gt;
&lt;p&gt;---------------------------------------------------------&lt;span&gt;--------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;I handled the problem in this way.&lt;br /&gt;As you can see in the code below I force one of the 2 registers on another pin so that the pin reset function is implicitly disabled:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void disablePinReset()
{

    NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // Read-only Enable
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
    }
    

    if ((NRF_UICR-&amp;gt;PSELRESET[0] == NRF_UICR-&amp;gt;PSELRESET[1]))
    {
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Een &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // ERASE UICR
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        };
        NRF_NVMC-&amp;gt;ERASEUICR = NVMC_ERASEUICR_ERASEUICR_Erase;

        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        };

        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // enable read
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        }
        
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // Write Enable
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        }
        NRF_UICR-&amp;gt;PSELRESET[0] = 17UL;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        }
        NRF_UICR-&amp;gt;PSELRESET[1] = 18UL; 
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        }
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos; // Read-only Enable
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
        {
        }

        NVIC_SystemReset(); // UICR changes require a reset to be effective
    }
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also found that the assignment of the thirty-first bit of PSELRESET (which is used to disconnect the function) was not being handled correctly: I ended up with PSELRESET[0,1] being valued at 0 instead of being valued at 1&amp;lt; &amp;lt;31 .&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuicr.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuicr.html&lt;/a&gt;&amp;nbsp;as reference for&amp;nbsp;PSELRESET&amp;nbsp;management&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pin reset disable</title><link>https://devzone.nordicsemi.com/thread/481074?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 12:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0f27ec9-5f0d-49e2-882d-b8e0370dbce1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The reset pin should now be configured in the devicetree, as described in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/releases/migration-guide-3.5.html#recommended-changes"&gt;migration guide draft&lt;/a&gt;. The Kconfig should still work for nRF Connect SDK v2.5.1 though.&lt;/p&gt;
&lt;p&gt;Note that if pinreset have been enabled by an older firmware, you need to erase UICR (using &amp;quot;Erase and Flash to Board&amp;quot; button in VSCode) in order to disable the pinreset functionality:&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/pastedimage1714393128247v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>