<?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>nrf52 stacked in a reset loop after setting NFCPINS as GPIO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93432/nrf52-stacked-in-a-reset-loop-after-setting-nfcpins-as-gpio</link><description>Hi, I&amp;#39;m having some trouble with a custom board based on nRF52832. 
 I need to use NFCPINS (P0.10 and P0.9) as GPIOs. As IDE I&amp;#39;m using Keil uVision. 
 The code works weel till I set PIN10 as Output. If i comment it the device doesn&amp;#39;t reset. 
 If I use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Nov 2022 20:55:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93432/nrf52-stacked-in-a-reset-loop-after-setting-nfcpins-as-gpio" /><item><title>RE: nrf52 stacked in a reset loop after setting NFCPINS as GPIO</title><link>https://devzone.nordicsemi.com/thread/393547?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 20:55:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6bae0cf-4036-46d4-ba07-ad88e5058038</guid><dc:creator>Dionisio</dc:creator><description>&lt;p&gt;UPDATE&lt;/p&gt;
&lt;p&gt;The problem was in the analog side of the board, bad footprint causing short circuiti between 3.3V and GND. Fixed and now works smoothly. Thank you for the support&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 stacked in a reset loop after setting NFCPINS as GPIO</title><link>https://devzone.nordicsemi.com/thread/393398?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 09:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2b403a9-9565-4762-a19d-410d680994f2</guid><dc:creator>Dionisio</dc:creator><description>&lt;p&gt;Yes, I tested the board all the night witout success. Using an oscilloscope I can see a spike of about 2ms going from 3.4V to 60mV on pin 10 before RESET occurs. A similar spike happens on the VDD. Pin 10 enables a load switch, so this should be the problem. Setting the pin 9 the reset doesn&amp;#39;t occur.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 stacked in a reset loop after setting NFCPINS as GPIO</title><link>https://devzone.nordicsemi.com/thread/393389?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 09:08:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caf1c751-2174-4eb3-897e-f32162e0e044</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The first time after programming reset from soft reset is the expected reason (as that is what is done after writing to UICR in the code snippet that is included by&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS). So if you do a full chip erase and program, then you should see it the first time, but not afterwards. There is no other code here that can cause a soft reset.&amp;nbsp;Did you test this more than once after the initial programming?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 stacked in a reset loop after setting NFCPINS as GPIO</title><link>https://devzone.nordicsemi.com/thread/393388?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 09:02:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94145b10-79c1-4d4b-bdcd-9b4e9a882a86</guid><dc:creator>Dionisio</dc:creator><description>&lt;p&gt;Hi Einar, thanks for the reply.&lt;/p&gt;
&lt;p&gt;In the previous post I made a mistake. The reset is happening when the pin 10 is setted.&lt;/p&gt;
&lt;p&gt;In order to print the state of the RESETREAS I&amp;#39;m using the following code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(){


 nrf_gpio_cfg_output(27);
 nrf_gpio_cfg_output(10);
 SEGGER_RTT_printf(0,&amp;quot;%x \n&amp;quot;,NRF_POWER-&amp;gt;RESETREAS);
 nrf_gpio_pin_set(10);
 
 while(1){}
 


}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;NRF_POWER-&amp;gt;RESETREAS is equal to 4. So a &amp;quot;Reset from Soft Reset&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 stacked in a reset loop after setting NFCPINS as GPIO</title><link>https://devzone.nordicsemi.com/thread/393374?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 08:21:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b49e0e16-430a-434e-be1b-8b855d5cfb94</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The simplest way to do this is your 3rd option, where you define&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS. When that is the case, this snippet from&amp;nbsp;modules/nrfx/mdk/system_nrf52.c is run during startup:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* Configure NFCT pins as GPIOs if NFCT is not to be used in your code. If CONFIG_NFCT_PINS_AS_GPIOS is not defined,
       two GPIOs (see Product Specification to see which ones) will be reserved for NFC and will not be available as
       normal GPIOs. */
    #if defined (CONFIG_NFCT_PINS_AS_GPIOS) &amp;amp;&amp;amp; defined(NFCT_PRESENT)
        if ((NRF_UICR-&amp;gt;NFCPINS &amp;amp; UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC &amp;lt;&amp;lt; UICR_NFCPINS_PROTECT_Pos)){
            nvmc_config(NVMC_CONFIG_WEN_Wen);
            NRF_UICR-&amp;gt;NFCPINS &amp;amp;= ~UICR_NFCPINS_PROTECT_Msk;
            nvmc_wait();
            nvmc_config(NVMC_CONFIG_WEN_Ren);
            NVIC_SystemReset();
        }
    #endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the correct approach (note that there is an intentional reset if the UICR has been written to, as it needs to have the right value at startup in order to take effect).&lt;/p&gt;
&lt;p&gt;As long as you define&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS for the project as you have shown in case 3, and remove the&amp;nbsp;other code you had for this that should be good.&lt;/p&gt;
&lt;p&gt;If you still get the&amp;nbsp;unexpected reset, I would check a few other things. First, what is the value of &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_8_2#register.RESETREAS"&gt;RESETREAS&lt;/a&gt; after you get the&amp;nbsp;unexpected&amp;nbsp;reset? This will tell you a bit about what caused the reset. The code is so simple that it is not much that could fail, but perhaps GPIO pin 10 is&amp;nbsp;connected to the reset pin? Or perhaps it is is connected so that somehow when you configure it as an output (and the default value then is low) you draw down the supply voltage so much that you get a brown out reset? The RESETREAS would give important information in these cases. And after checking that, it is probably time to take a look at your HW.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>