AnsweredAssumed Answered

STM32F101RD: Interrupt preemption not working

Question asked by J on Oct 3, 2014
Latest reply on Oct 15, 2014 by J
System info: 8MHz external clock, 24MHz interrupt system clock.
Interrupt preemption is not working for me no matter the combination of priorities and priority groupings.  My goal is to have a high speed timer interrupting every 0.1ms that doesn't get pushed round by other interrupts.  Other interrupts include button and switch handlers via EXTIx inputs, UART interrupts for multiple serial inputs, and a couple other slow speed timers.

I'm using priority grouping 1, which gives me two priority groups, 0 & 1.  I assume groups with lower priority are of higher preemption priority similar to interrupt priorities.  Is this a good assumption?

My high speed timer uses TIM7 and is assigned to priority group 0, sub-priority of 0.  This should be highest priority in the highest preemption priority group.  All the other interrupts are in preemption priority group 1 with sub-priorities from 1 to 4.  The TIM7 interrupt handler toggles a GPIO pin I can watch with an o-scope.

When I put this up on the o-scope and press buttons, I see TIM7 jitter around getting held off while the button handlers do their thing.  The TIM7 interrupt is clearly not preempting the button handlers.  Note, the button handlers do not disable the other interrupts via primask or basepri.

I feel I'm missing some fundemental setting here.  What do I have to do to get preemption to work?

I've tried using SysTick instead of TIM7 and that gets held off, too.  I don't see any means to assign SysTick to a priority group, unless the priority field for SysTick works the same as other interrupts.  Can SysTick be in a priority group or is it always in group 0?  None of the ARM documentation indicates one way or the other.

Any help would be greatly appreciated!  Thank you!