Hard Fault Handler

cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault Handler

285 Views
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.

Labels (4)
0 Kudos
1 Reply

171 Views
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 Kudos