Hi.
I've configured an I2C device to gather data and if finished it will trigger an interrupt line which I connected to the an GPIO interrupt of the NRF52.
I'm using i2c_burst_read(...) from within that GPIO interrupt but always get the following error:
<err> i2c_nrfx_twim: Error on I2C line occurred for message 0
With polling the GPIO line and then reading the data out of the I2C device everything works fine. Is there a restriction accessing I2C functions within an interrupt? How would be the solution to this? I was thinking of using an event which i set in the GPIO interrupt and in a thread I read out the data with I2C functions. But would't that be way slower that just reading a few registers within the ISR?
I configured the GPIO interrupt using:
gpio_pin_configure_dt(&int1, GPIO_INPUT); gpio_pin_interrupt_configure_dt(&int1, GPIO_INT_EDGE_TO_ACTIVE); gpio_init_callback(&irq1, int1_callback, BIT(int1.pin)); gpio_add_callback(int1.port, &irq1);