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

undefined reference nrfx_gpiote_in_init when trying to intiialize gpio

nrfx_gpiote_in_config_t in_config = NRFX_GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
in_config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrfx_gpiote_in_init(DRDY_PIN, &in_config, DRDY_Handler); 

APP_ERROR_CHECK(err_code);

nrfx_gpiote_in_event_enable(DRDY_PIN, true);

In the code above I get an error that nrdx_gpiote_in_init() and nrfx_gpiote_in_event_enable() are undefined.

In CMSIS configuration wizard -> nRF_Drivers i've enabled NRFX_GPIOTE_ENABLED and included nrfx_gpiote.h in my file. I've seen other discussions saying the legacy driver needs included as well, but when I include GPIO_TE under CMSIS configuration wizard I get a different error: multiple definition of `GPIOTE_IRQHandler'.

On further inspection it seems to be in conflict with the GPIOTE_IRQHandler(void) in simple_hal.c for the NRF540-dk eval board. How do I add my own pin for interrupt with the board hal still enabled? 

Related