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

Butttonless DFU issue with CONFIG_NFCT_PINS_AS_GPIOS

I am using nrf52832 for button less DFU. DFU is working fine when  CONFIG_NFCT_PINS_AS_GPIOS is not added in applicaton. When added seems like code is getting reset at bootloader level. Is any connection with CONFIG_NFCT_PINS_AS_GPIOS ? Please suggest.

Thanks

Parents Reply
  • Below is the code inside, Not sure UICR_NFCPINS_PROTECT_Msk, UICR_NFCPINS_PROTECT_Pos ,


    /* Configure NFCT pins as GPIOs if NFCT is not to be used in your code. If CONFIG_NFCT_PINS_AS_GPIOS is not defined,
    two GPIOs (see Product Specification to see which ones) will be reserved for NFC and will not be available as
    normal GPIOs. */
    #if defined (CONFIG_NFCT_PINS_AS_GPIOS)
    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();
    }
    #endif

Children
Related