cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303x Discovery SysTick Interrupt Disabled During Execution?

gbigden
Associate III
Posted on December 22, 2014 at 12:56

I am using SysTick_Handler() to execute a piece of code every few milliseconds. When I am in this function doing stuff, is the interrupt disabled? In other words, if I set the int to 10mS and I take 11mS to execute the code, what happens?

#stm32f3-discovery-systick
4 REPLIES 4
Posted on December 22, 2014 at 16:49

It would depend on your priority and preemption levels set in the NVIC. The interrupt itself will run to completion, and if another SysTick is pending it will likely immediately re-enter. Everything at the same preemption level will also wait until you exit, and the tail-chaining will determine the next handler to enter based on it's priority level.

One could measure the time in the interrupt by toggling a GPIO upon entry/exit, or getting a time stamp from a free running counter, or DWT_CYCCNT for example.

If your processing takes longer than the allotted time, you're going to saturate the processor, and no foreground code is going to run.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gbigden
Associate III
Posted on December 22, 2014 at 17:19

The SysTick is the only interrupt I use

Posted on December 22, 2014 at 17:49

Ok, then the salient point would be it's not going to reenter (recurse), but run to completion, and then probably fire again immediately.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gbigden
Associate III
Posted on December 23, 2014 at 11:45

Thanks - I was wondering why it didn't just crash as memory was used up.