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

err_code 8 on nrfx_gpiote_in_init(19, &in_config, in_pin_handler);

Hello all,

I am using sdk 16, trying to make a simple interrupt from pin 19.. I keep getting error code :- on this line nrfx_gpiote_in_init(19, &in_config, in_pin_handler);

While searching online people said that I may be initializing gpiote somewhere else, but it not possible as i commented out all my code except nrf log init and gpio init. Please can some one help.. I basicaly used the Ble App_blinky example , took out all the Button and led stuff and added the below code to it.. Without below code it works as expected. 

my main code:

int main(void)
{
// Initialize.
log_init();
// timer_init();
gpio_init();
// power_management_init();
// ble_stack_init();
//scan_init();
//gatt_init();
//db_discovery_init();
// nrf_gpio_cfg_input(19,NRF_GPIO_PIN_PULLDOWN);
// Start execution.
NRF_LOG_INFO("Blinky CENTRAL example started.");

//scan_start();

// Enter main loop.
for (;;)
{

// idle_state_handle();

}
}

void in_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
NRF_LOG_INFO("Input pin Interrupt");
}

static void gpio_init(void)
{
ret_code_t err_code;
nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
in_config.pull = NRF_GPIO_PIN_PULLUP;
nrfx_gpiote_in_uninit(19);
err_code = nrfx_gpiote_in_init(19, &in_config, in_pin_handler);
NRF_LOG_INFO("Input errort %d",err_code);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_event_enable(19, true);
}

Related