Skip to main content
VAlar.1
Associate
October 6, 2021
Solved

Nested the same Interrupt on STM32F446RC

Hello community,

It is possible that an interrupt will be nested over itsef?

I mean, I have one interrupt EXTI0_IRQHandler() and inside the interrupt I am waiting an event that requires the execution of the same interrupt.

I read the PM0214 and it is said that "Preemption When the processor is executing an exception handler, an exception can preempt the exception handler if its priority is higher than the priority of the exception being handled"

In my case, Could I change the prioriry of the IRQ dinamically so the new event will be processed as a new IRQ nested with the same IRQ??

Thank you very much for your help

This topic has been closed for replies.
TDK
TDKBest answer
October 6, 2021

An interrupt cannot preempt itself. It will get fired again after it completes if the relevant flags are still set.

"If you feel a post has answered your question, please click ""Accept as Solution""."

4 replies

Paul1
Senior III
October 6, 2021
  1. In IRQ clear the interrupt to allow second interrupt, then clear the second interrupt before exiting
  2. Find a different way
  • like in interrupt increment a counter, and outside interrupt idle in a loop till counter is high enough then zero it and continue
  • or better instead of zeroing counter do a decrement like Counter-=2 and repeat till under 2 then won't miss any events.

Paul

TDK
TDKBest answer
October 6, 2021

An interrupt cannot preempt itself. It will get fired again after it completes if the relevant flags are still set.

"If you feel a post has answered your question, please click ""Accept as Solution""."
S.Ma
Principal
October 6, 2021

What do you need to achieve in the hw ?

VAlar.1
VAlar.1Author
Associate
October 7, 2021

I think as TDK said that it is not possible to have the same interrupt nested inside itself.

I did a workaround to solve the situation.

Thank you all for your answers.