<?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>About GPIO pin problem.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118529/about-gpio-pin-problem</link><description>Hello Developers, 
 I am working with the nRF52833 microcontroller using segger embedded studio with the latest SDK. My issue is that I can configure and use all GPIOs except P0.18. I&amp;#39;m unsure why this is happening. 
 In my case, I am using a basic LED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 08 Feb 2025 17:57:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118529/about-gpio-pin-problem" /><item><title>RE: About GPIO pin problem.</title><link>https://devzone.nordicsemi.com/thread/522084?ContentTypeID=1</link><pubDate>Sat, 08 Feb 2025 17:57:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a597f2a-aa64-4030-98d0-74749874310b</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This code is run following every NVIC_SystemReset(), which will stop the pin working as a GPIO:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* Configure GPIO pads as pPin Reset pin if Pin Reset capabilities desired. If CONFIG_GPIO_AS_PINRESET is not
      defined, pin reset will not be available. One GPIO (see Product Specification to see which one) will then be
      reserved for PinReset and not available as normal GPIO. */
    #if defined (CONFIG_GPIO_AS_PINRESET)
        if (((NRF_UICR-&amp;gt;PSELRESET[0] &amp;amp; UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected &amp;lt;&amp;lt; UICR_PSELRESET_CONNECT_Pos)) ||
            ((NRF_UICR-&amp;gt;PSELRESET[1] &amp;amp; UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected &amp;lt;&amp;lt; UICR_PSELRESET_CONNECT_Pos))){
            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] = 21;
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            NRF_UICR-&amp;gt;PSELRESET[1] = 21;
            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){}
            // UICR changes require a reset to be effective
            NVIC_SystemReset();
        }
    #endif
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO_AS_PINRESET is used in the project file Pre-Processor options list and must be either removed or altered say to &amp;quot;notCONFIG_GPIO_AS_PINRESET&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About GPIO pin problem.</title><link>https://devzone.nordicsemi.com/thread/522081?ContentTypeID=1</link><pubDate>Sat, 08 Feb 2025 11:23:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54aa23d6-331d-4220-b07c-01c9960b5a41</guid><dc:creator>k.hema sundar</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf_nvmc.h&amp;quot;
#include &amp;quot;nrf.h&amp;quot;

// Define GPIO Pins
#define G_LED1         NRF_GPIO_PIN_MAP(0,18)  
#define LDO_TRANS_PIN2 NRF_GPIO_PIN_MAP(1, 1)

// Function to check and erase UICR if P0.18 is set as nRESET
void disable_reset_pin(void) 
{
    if (NRF_UICR-&amp;gt;PSELRESET[0] != 0xFFFFFFFF || NRF_UICR-&amp;gt;PSELRESET[1] != 0xFFFFFFFF) 
    {
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Een; // Enable erase mode
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
        
        NRF_NVMC-&amp;gt;ERASEUICR = 1; // Erase UICR
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
        
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren; // Disable erase mode
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
        
        NVIC_SystemReset(); // Reset MCU to apply changes
    }
}


void configure_pins(void) 
{  
    nrf_gpio_cfg(G_LED1, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, 
                 NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE); 
      
    nrf_gpio_cfg(LDO_TRANS_PIN2, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT,
                 NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);
   
    nrf_gpio_pin_set(LDO_TRANS_PIN2); // Set P1.1 HIGH
}


void delay_ms(uint32_t ms) 
{
    for (uint32_t i = 0; i &amp;lt; (ms * 850); i++); 
}

void delay_s(uint32_t s) 
{
    delay_ms(s * 2000);
}

// Main function
int main(void) 
{
    disable_reset_pin();
    configure_pins();  
    
    while (1) 
    {
        nrf_gpio_pin_toggle(G_LED1);
        printf(&amp;quot;G_LED1 status: %d\n&amp;quot;, nrf_gpio_pin_read(G_LED1));
        delay_s(1);
    }
}
&lt;/pre&gt;I am erasing the UICR but still the pin is not working as GPIO&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About GPIO pin problem.</title><link>https://devzone.nordicsemi.com/thread/520955?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2025 22:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fced3237-812a-49a6-85dc-dcd507a525d9</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;On the nRF52833 P0.18 is optionally available as an active-low reset pin. To restore io pin mode look for and remove the setting for using the pin as a reset and then do a FLASH erase to erase UICR. P0.18: Once a reset pin always a reset pin until a UICR erase.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;4.5 UICR &amp;mdash; User information configuration registers&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Register Offset Description&lt;/em&gt;&lt;br /&gt;&lt;em&gt;PSELRESET[0] 0x200 Mapping of the nRESET function (see POWER chapter for details)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;PSELRESET[1] 0x204 Mapping of the nRESET function (see POWER chapter for details)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Note: All PSELRESET registers have to contain the same value for a pin mapping to be valid. If&amp;nbsp;values are not the same, there will be no nRESET function exposed on a GPIO. As a result, the&amp;nbsp;device will always start independently of the levels present on any of the GPIOs.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>