cancel
Showing results for 
Search instead for 
Did you mean: 

Nested the same Interrupt on STM32F446RC

VAlar.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

4 REPLIES 4
Paul1
Lead
  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
Guru

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

What do you need to achieve in the hw ?

VAlar.1
Associate II

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.