Consecutive PendSV IRQ Handler Delays Other Interrupt Handler

Good day @rtel

We have done further testing, and believe that we have narrowed down the problem.

To test if the problem was caused by interrupt nesting, we set all interrupt priorities to 0x0F (same priority as SysTick and PendSV). However, this worsened the interrupt delays:

It is worth noting that the problem is not specific to the GPT2 ISR, as I may have implied in my first post (above delay is in SysTick handler, for example).

We noticed that the SysTick and PendSV ISR’s don’t call __DSB() in their last line (other ISR’s do).
To test if this was related, we added __DSB() in the last line of the PendSV ISR. This caused the PendSV ISR to be delayed every time it was called:

Consequently, our hypothesis is that the __DSB() call is what is slowing down our interrupt handlers, intermittently. This could be caused by ARM’s non-sequential memory accesses.

Do you agree with our hypothesis?
Do you have advice for us?

Kind regards
D_TTSA