Hard Fault Handler

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Hard Fault Handler

1,578 次查看
TEMCEFF
Contributor IV

I just disable the systic interrupt in systic handler. code is given below:

void SysTick_Handler(void)
{
NVIC_DisableIRQ(SysTick_IRQn);

}

after executing the above instruction processor goes to  hard fault handler.

But like the same thing I have done it for timer interrupt as given below.

void TIMER0_IRQHandler()
{
NVIC_DisableIRQ(TIMER0_IRQn);

it didn't go to hard fault handler.

What is the reason for this? is anyone experienced this type of issue.

Regards,

Muralidhar.

标签 (4)
0 项奖励
回复
1 回复

1,464 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello Avinash G 

 

Most of the NVIC_IRQ functions only support Interruptions. The Systick is a system exception, so the Systick is not allowed in the function NVIC_DisableIRQ(SysTick_IRQn).

In order to disable the exception, you need to set the TICKINT bit in the SYST_CSR register to 0.

pastedImage_2.png

 

if you want to disable all IRQ and system exception (apart from NMI and hardfault), you can use "__disable_irq()" and reenable all IRQ and system exception using "__enable_irq()"

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

0 项奖励
回复