nRF52832

Hi,

I developed a custom board and I am able to toggle other IO pins but somehow pin 10, 9 wasn't working. After some research, I found that NFC must be disabled to make it work.
I did the following steps but still not able to make it work.
Can someone help me with it?

#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "nrf_gpio.h"

/**
 * @brief Function for application main entry.
 */
 #define IN1 10
 #define IN2 9
 #define nslp 11
int main(void)
{   CONFIG_NFCT_PINS_AS_GPIOS;
    nrf_gpio_cfg_output(IN1);
    nrf_gpio_cfg_output(IN2);
    nrf_gpio_cfg_output(nslp);




    while (true)
    {
     nrf_gpio_pin_set(nslp);
     nrf_gpio_pin_clear(IN2);
     nrf_gpio_pin_set(IN1);
     nrf_delay_ms(3000);
     nrf_gpio_pin_clear(nslp);
     nrf_gpio_pin_clear(IN1);
     nrf_gpio_pin_set(IN2);
     nrf_delay_ms(3000);
     
    }
}


Parents
  • Suggest remove the definition from "Debug" and instead apply to "Common" as the definition is then inherited by both Debug and Release build. Also remove from main().

    Search for CONFIG_NFCT_PINS_AS_GPIOS to ensure it is acted upon typically in system_nrf52.c:

        /* 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) && defined(NFCT_PRESENT)
            if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)){
                nvmc_config(NVMC_CONFIG_WEN_Wen);
                NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk;
                nvmc_wait();
                nvmc_config(NVMC_CONFIG_WEN_Ren);
                NVIC_SystemReset();
            }
        #endif
    

  • Hi  
    Can you elaborate it further?
    I am literally new to this platform.


    I also tested the same code on nRF52 DVK and i noticed it is not toggling there as well.
    Thanks

Reply Children
Related