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

another question about reset pin enable

Hi

Try to enable reset pin on a 52810 custom board

After defining CONFIG_GPIO_AS_PINRESET in project I ended with UICR registers set to 0 both PSELRESET[0] and PSELRESET[1]

Digging into the code i found this sequence after #if defined (CONFIG_GPIO_AS_PINRESET)/#endif in system_nrf52810.c

/* When developing on an nrf52832, make sure NFC pins are mapped as GPIO. */
#if defined (DEVELOP_IN_NRF52832)
if (((*((uint32_t *)0x10001200) & (1 << 0)) != 0) || ((*((uint32_t *)0x10001204) & (1 << 0)) != 0)){
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
*((uint32_t *)0x10001200) = 0;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
*((uint32_t *)0x10001204) = 0;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NVIC_SystemReset();
}
#endif

Which turns back to 0 PSELRESET registers and obviously reset pin doesnt work.

True, defining DEVELOP_IN_NRF52832, doesnt make sense for a custom board with 52810, but still cannot understand why the piece of code clears PSELRESET registers.

The comment  /* When developing on an nrf52832, make sure NFC pins are mapped as GPIO. */ makes me think to an error because the UICR configuration for NFC pins is located at offset 20c while PSELRESET are located at offset 200.

Is this an error or do i miss something?

Related