Using nRF52832, I've got some firmware that uses NFC pins (9 & 10) without problem, using CONFIG_NFCT_PINS_AS_GPIOS.
I'm now trying to replicate this using nRF52833, and I'm failing.
I used ble_app_blinky as a starting point (for PCA10056), and just put this in main():
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)){
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk;
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();
}
for (int pin = 0; pin < 32; ++pin)
{
nrf_gpio_pin_dir_set(pin, NRF_GPIO_PIN_DIR_OUTPUT);
}
while (1)
{
for (int pin = 0; pin < 32; ++pin)
{
nrf_gpio_pin_set(pin);
}
nrf_delay_ms(1000);
for (int pin = 0; pin < 32; ++pin)
{
nrf_gpio_pin_clear(pin);
}
nrf_delay_ms(1000);
}
Note the first bit was added after, just to make sure the NFC pins are reprogrammed.
However, pin 9 & 10 still don't get toggled by this code.
Checking the value of NRF_UICR->NFCPINS, it's 0xFFFFFFFE, so I don't understand what's wrong... Thanks!