2014-12-22 03:56 AM
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-systick2014-12-22 07:49 AM
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.2014-12-22 08:19 AM
The SysTick is the only interrupt I use
2014-12-22 08:49 AM
Ok, then the salient point would be it's not going to reenter (recurse), but run to completion, and then probably fire again immediately.
2014-12-23 02:45 AM
Thanks - I was wondering why it didn't just crash as memory was used up.