RESET pin as GPIO

Hi

I want to use P0.18 gpio as output pin and not as reset for nordic.

I am using ncs v2.0.0.

I have added 

CONFIG_GPIO_AS_PINRESET=n in prj.conf
and when i read UICR PSELRESET[0] PSELRESET[1], it says no pin is set as reset pin
But still I am unable to set that pinout to low. 
I have following lines of code to set it low
    nrf_gpio_cfg_output(18);
    nrf_gpio_pin_clear(18);


and when I grnd that pin, the system resets. Doesnt this mean, P0.18 is still a reset pin?
How do I make it a gpio.
Parents
  • Update on above.
    After I program the hex using visual studio flash, if I give nrfjprog --eraseuicr the reset pin works.

    But what confuses me is, why did below registers say no pin set as reset and still needed eraseuicr to make reset pin as gpio work?

    nrfjprog --memrd 0x10001014 --n 4

    nrfjprog --memrd 0x10001018 --n 4


  • Hi,

    Good to se you resolved it with an UICR reset. However, there are a few points worth. mentioning. On nRF52840, the regsiter addresses for enabling pin reset is 0x10001200 and 0x10001204, so those are the addresses you need to check (see UICR).

    Also, to properly solve this, we should understand why pin reset is enabled in the first place. There are two typical reasons:

    1. Pin reset is enabled in any of the binaries that are programmed to the device. So for instance, you have a bootloaer or similar, make sure to add CONFIG_GPIO_AS_PINRESET=n to the board configuration or to also the bootloader project(s).
    2. By default, pin reset is enabled when programming via west on the command line or from vs code. From command line, add "--softreset" to the program command. And from VS Code, change the settings by searching like this (open Preferences -> Settings, search for "soft reset" and check the checkbox):

Reply Children
No Data
Related