cancel
Showing results for 
Search instead for 
Did you mean: 

SVC call inside SysTick ISR - is that legal?

zsmith
Associate II
Posted on April 17, 2009 at 14:46

SVC call inside SysTick ISR - is that legal?

2 REPLIES 2
zsmith
Associate II
Posted on May 17, 2011 at 13:09

I am trying to do an SVC call to invoke my scheduler. It works fine unless I try to do the SVC call while inside a SysTick interrupt. The call to SVC happens without problem (SVC priority is set higher than SysTick) but when attempting to return from the SVC exception I get a HardFault. The processor doesn't seem to like the fact that SYSTICK is ACTive and SVCALL is ACTive because if I manually clear the SYSTICKACT bit in the System Handler Control and State Register (SHCSR) just before returning it returns fine.

Is it illegal to call SVC inside the SysTick ISR? Or is there a way to do this?

joseph239955
Associate II
Posted on May 17, 2011 at 13:09

Hi there, it is legal to use SVC inside SysTick ISR provided that the priority of SVC is higher than SysTick. You can debug the problem by :

1) Use a hard fault handler to identify the faulting location and reason (from fault status register). More information can be found here

http://www.st.com/mcu/forums-cat-6778-23.html

2) Reduce you SVC to minimum and see if it work. If it does, then putting thing back into SVC handler part by part and see which part cause the failure.

Hope this helps.