2009-04-17 05:46 AM
SVC call inside SysTick ISR - is that legal?
2011-05-17 04:09 AM
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?2011-05-17 04:09 AM
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.