Skip to main content
federico.massimi
Associate III
November 8, 2022
Question

Doubt about interrupt priority

  • November 8, 2022
  • 1 reply
  • 565 views

Hi, I have a doubt about interrupt priority.

Let's say we have two ISRs for two interrupts: interrupt A and interrupt B, where A has a higher priority than B.

If the ISR of B is running and an interrupt A arrives, then the ISR B is interrupted, that of A is executed, and then the ISR of B is resumed.

But if the ISR of A, the interrupt with the highest priority, is running and an interrupt B arrives, what happens? Is interrupt B ignored and continuing to execute ISR of A, or the B ISR is queued and executed after A ISR and then continuing with the normal program?

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    November 8, 2022

    Interrupts at the same preemption level get serviced in priority order (numerically lowest first) as the current one tail-chains out of its handler. ie it only pushes context once, services, or reservices, all until all sources are cleared.

    For one interrupt to interrupt another, it needs to have a numerically lower preemption level and the NVIC grouping (bit mix) needs to be configured appropriately.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..