[Error] Unexpected Spurious interrupt index 5 on ISR call

Hello,

I’m configuring three different EXT IRs on my STM32L476RG chip on Pins PA_9 (USB), PB_4 (ADC Data ready 1) and PC_6 (ADC Data ready 2).

During my procedure I’m enabling and disabling/enabling the interrupt by resetting/creating an InterruptIn object on the heap via

...
_rdy_ir.reset();
_rdy_ir = std::make_unique<mbed::InterruptIn>(_rdy_pin, mode);
_rdy_ir->fall(readyCallback); // RDY goes low every time a conversion is ready
...

From time to time I’m running into a hard fault which is produced when an interrupt is called (see gpio_irq_api.c):

++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x8007009
Error Value: 0x0
For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=NUCLEO_L476RG
-- MbedOS Error Info --
Unexpected Spurious interrupt index 5

Does anyone know how this error is appearing. I mean the InterruptIn object should be properly reset when the destructor is called.

Thank you.

Edit: I also tried to just set the interrupt once and disable/ the interrupt via _rdy_ir->disable_irq()/enable_irq( ) → same error

Hello,

I never saw that

just for faster orientation in the source code:

  • the error is from here
  • index 5 is descripted here

Did you try some different pins?

BR, Jan

Hi Jan,

just for faster orientation in the source code:

  • the error is from here
  • index 5 is descripted here

Yes, right!

The pins are determined by the board I’m using.

I really wonder what causes the channel @ irq_index to be undefined. Seems to be a bug to me.

Maybe as a hint: There are around 500 interrupts/sec on the ADC interrupt pins. But I’m shutting the ADC down before disabling interrupts. I will try to keep interrupts enabled (there should be no interrupts if shut down) and see if I’m still having the fatal crash.