2022-11-08 11:20 AM
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?
2022-11-08 11:37 AM
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.