How to configure reset pin as GPIO input

Hello!

I have used most of the GPIO pins on the nRF52DK, and most of them work. But I cannot get pin 21 to behave. I want to use it as an input. I have configured it as input and for testing I am making it print something to the console when it is triggered. This test code works for other pins, like 31 and 29, but I cannot get it to work with pin 21. It is configured with GPIO_0 as input device, on pin 21, and with flags GPIO_INPUT | GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH. This way, when I configure it on other pins, when I press the button the console prints a message. But not when I use pin 21.

I assume this has something to do with this pin being used for reset as default, and I see that in the documentation it says it should work as a normal GPIO. How do you remove this default configuration and set it up to work like the other GPIO ports? Does it have something to do with changing the register?

I have tried to disable "GPIO as pin reset" in the kconfig and pressed save, that didn't change anything. I also tried what was said in this post: https://devzone.nordicsemi.com/f/nordic-q-a/76706/nrf52805-reset-as-a-gpio about doing full erase before flashing with nrfjprog -e with no luck. So now I don't what to try next.

Thank you for assistance!

Mvh Filip.

Related