This is a rather an 'expert' question but we have a similar issue and I have trouble understanding the concept of interrupt-priority with respect to the execution of ISR in and embedded DSP system.
Let's say we have two - ISR1 and ISR2 - interrupts occuring after each other like shown below:
I'd like to compare two scenarios with respect to the interrupt priority and thread-safety of the system. Assume, we have no semaphore, mutex, etc. and gcc as a compiler
So, what happens if:
a)
- NVIC priority of IRQ1 is higher than IRQ2
- ISR1 contains a critical memset function, ISR2 contains uncritical sections only
b)
- NVIC priority of IRQ1 is lower than IRQ2
- ISR1 contains a critical memset function, ISR2 contains uncritical sections only
My expectation would be:
a) Nothing happens, ISR2 is exectuted once ISR1 is finished
b) Memset is interrupted (uo-oh), system throws an exception.
Am I correct with that?