This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unable to disable P0.21 as pin reset (while using DFU bootloader)

Yes I've already looked at the following two examples:

https://devzone.nordicsemi.com/question/185381/disabling-pin-21-of-nrf52832/

https://devzone.nordicsemi.com/question/93492/nrf52832-p021reset-pin/

I tried using the following commands and was able verify that the registers were 0xFFFFFFFF:

nrfjprog --eraseuicr --family nrf52 Erasing UICR flash area. Applying system reset.

nrfjprog --memrd 0x10001200 --family nrf52 0x10001200: FFFFFFFF |....|

nrfjprog --memrd 0x10001204 --family nrf52 0x10001204: FFFFFFFF |....|

Once I perform a reset and read the same values again, they are still 0xFFFFFFFF.

When I reprogram my board these are the following steps:

1. nrfjprog -f nrf52 --eraseall

2. Program a hex file that contains a bootloader, bootloader settings, application, and soft device

3. nrfjprog -f nrf52 --reset

I run the same nrfjprog commands to read the memory again the values are back to 0x00000015. I've already commented out the CONFIG_GPIO_AS_PINRESET flags in my Makefile and I've searched for that exact text in my entire project and it isn't defined anywhere else. I'm really running out of ideas because we're using this pin as the MOSI pin for SPI and obviously nothing is working because the pin just stays high forever.

EDIT: So I've literally just commented out the code in the system_nrf52.c that deals with setting the PSELRESET registers and the value is still 0x00000015. How is that even possible?

EDIT2: I stopped programming the bootloader + bootloader settings and just programmed the soft device and application. Now when I read the PSELRESET registers, they read 0xFFFFFFFF. So I'm assuming something is being overwritten when I program the bootloader.

EDIT3: So I figured it out. When I originally compiled my bootloader, the Makefile provided by Nordic has the CONFIG_GPIO_AS_PINRESET flag defined so the bootloader was constantly overwriting the UICR register. I recompiled the bootloader with this flag deleted and now the pin functions as a reset!

Parents Reply Children
No Data
Related