[nRF52840] MPU FAULT: ISR taking too long ?

Hi,

I've got a GPIO interrupt callback that collects an ADC reading. All is fine until there.

But when interrupts become numerous (~3/5k triggers / sec), a MPU FAULT appears.

After some tests, I'm assuming it comes from the adc_read() (from Zephyr, <drivers/adc.h>) that takes too long inside the ISR callback and delayed next ISRs accumulate until it breaks. Testing by inserting only a delay inside ISR callback produce the same result.

Is there another way than postponing this task to consumer function ? Or, at least, could I know how much callback calls are waiting from the ISR so I could adapt temporarily avoid calling ADC (sort of mitigation process).

Thanks !

Related