I am using LSM9DS1 IMU, nRF52840 with SDK v16.0.0. I configured the IMU to raise an interrupt when the FIFO buffer be full by writing to register INT2_CTRL the value '0b00011000', I read the register to check if the configuration was written correctly and it was. Pin INT2_A/G of IMU is connected to P0.11.
Below, the GPIOTE configurations.
#define INT_PIN 11 /* GPIO congifuration */ nrfx_gpiote_in_config_t int_pin_config = { .sense = NRF_GPIOTE_POLARITY_HITOLO, .pull = NRF_GPIO_PIN_PULLUP, .is_watcher = false, .hi_accuracy = true, .skip_gpio_setup = false, }; nrfx_err_t err_code = nrfx_gpiote_in_init(INT_PIN, &int_pin_config, gpio_handler); //Initialize GPIO interrupt nrfx_gpiote_in_event_enable(INT_PIN, true);
Below, the GPIOTE event handler.
void gpio_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action){ if(action == NRF_GPIOTE_POLARITY_HITOLO){ tx_buff[0] = OUT_X_L_G; //Read data when the interrup occurs lsm9ds1_read_data(tx_buff, TX_BUFF_SIZE, rx_buff, RX_BUFF_SIZE); } }
I set a checkpoint in the handler but it never enters. When I check the FIFO_SRC register, FTH and OVRN bits are set to 1 so I am assuming that the interrup in actually raised.
Any ideas of why it does not enter in the handler?
PS: I have tried all possible combinations of sense and pull in the configurarion and the result is the same.