cancel
Showing results for 
Search instead for 
Did you mean: 

SysTick interrupt priority does not work?

Posted on December 27, 2010 at 19:36

SysTick interrupt priority does not work?

4 REPLIES 4
Posted on May 17, 2011 at 14:19

Unfortunatelly, when DMA interrupt is active the gating period sometimes changes from exact 100.00 ms about 0.3 us less (probably DMA handler duration). I/O toggling was measured by a precise counter instrument.

99.9997 ms? or 100.0003 ms? Your description suggest the former. Tail chaining may result is reduced latency as it transitions from the DMA to ticker IRQ.

What's the frequency of your CPU and DMA bandwidth?

300 ns, that's 7-21 instructions at 72 MHz. The M3 pushes/pops 8 32-bit register on interrupt.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 17, 2011 at 14:19

Thanks for response.

I am sorry for the mistake.

The difference in 100 ms periods is 0.3 MILIsecond - really similar to the duration of DMA IRQ handler as I wrote.

Of course, one period is longer and next one is shorter.

However, I need a precision better then 1E-4 every period.

The counter error (1 LSB variation) makes only 2E-5 for full scale counter value about 50000.

I use STM32F103RBT running on 72 MHz. When DMA IRQ handler is empty, MAX-MIN difference in the 100 periods is 13 ns only i.e. 1 instruction.

It seems for me that SysTick IRQ priority is NOT higher than the DMA one.

Posted on May 17, 2011 at 14:19

I'm not sure that NVIC_Init is suitable for System Handler interrupts, with the older library I used NVIC_SystemHandlerPriorityConfig() for SysTick, for the newer library the following may be more appropriate.

  /* 2 bits for pre-emption priority and 2 bits for subpriority */

  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);

  /* Set SysTick Interrupt priority to 0 (highest) */

  NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0,0));

  /* Set DMA1/1 Interupt priority to 3 (lowest) */

  NVIC_SetPriority(DMA1_Channel1_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),3,0));

SysTick_IRQn is negative.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 17, 2011 at 14:19

  /* Set SysTick Interrupt priority to 0 (highest) */

 

  NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0,0));

It works by this way.

Thank you very much, Clive1, for the advise.

Ivan