pin reset disable

Hi all

(I'm using vs studio code and nrf 2.5.1)

I'm having difficulty disabling the reset function related to the reset pin.
I can't use the pin as GPIO and if I put 0V (GND) on the pin the microcontroller restarts.

I already searched in the forum.
-The config on prj.conf (deprecated config) doesn't work
- insert the --softreset argument into board.cmake dont work.

Advice?

best regards

Cristian

  • Hi,

    The reset pin should now be configured in the devicetree, as described in the migration guide draft. The Kconfig should still work for nRF Connect SDK v2.5.1 though.

    Note that if pinreset have been enabled by an older firmware, you need to erase UICR (using "Erase and Flash to Board" button in VSCode) in order to disable the pinreset functionality:

    Best regards,
    Jørgen

  • Hi,

    The reset pin should now be configured in the devicetree, as described in the migration guide draft. The Kconfig should still work for nRF Connect SDK v2.5.1 though.

    Note that if pinreset have been enabled by an older firmware, you need to erase UICR (using "Erase and Flash to Board" button in VSCode) in order to disable the pinreset functionality:

    Best regards,
    Jørgen

    Hi Jørgen

    I commented on the .dts file and on the .overlay file in this way
    &uicr {
    //gpio-as-nreset;
    };

    I recompiled the entire project and manually deleted the flash, however the micro controller keeps restarting.

    Any other suggestions?

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------

    EDIT:

    I handled the problem in this way.
    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:

    void disablePinReset()
    {
    
        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos; // Read-only Enable
        while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
        {
        }
        
    
        if ((NRF_UICR->PSELRESET[0] == NRF_UICR->PSELRESET[1]))
        {
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Een << NVMC_CONFIG_WEN_Pos; // ERASE UICR
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            };
            NRF_NVMC->ERASEUICR = NVMC_ERASEUICR_ERASEUICR_Erase;
    
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            };
    
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos; // enable read
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            }
            
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos; // Write Enable
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            }
            NRF_UICR->PSELRESET[0] = 17UL;
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            }
            NRF_UICR->PSELRESET[1] = 18UL; 
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            }
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos; // Read-only Enable
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
            {
            }
    
            NVIC_SystemReset(); // UICR changes require a reset to be effective
        }
    }
    
    

    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< <31 .

    https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuicr.html as reference for PSELRESET management

  • Are you building for the nRF52833 DK or a custom board?

    The pin reset is enabled by default in the nRF52833 DK board DTS file. Did you comment this, or only in the project overlay?

    You can also use the delete-node property to disable it in the overlay:

    /delete-node/ &uicr;

    Lorenz898989 said:
    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< <31

    You cannot "assign" 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 "write" bits to 1.

Related