2017-12-09 03:37 AM
Hello,
I am using STM32f4 discovery board. On this board, I am using 2 timer interrupt(TIM2 & TIM3) and 1 external interrupt(External interrupt for reading data from the external board).TIM2 is generating an interrupt after 1 second and TIM2 after 125 microseconds.
When I run my code enable all interrupts. it gets stuck in the hard fault handler.
I have tried by changing the interrupt time and priority both.When I enable only two interrupts, my code is working properly.
enable only tim2 and external interrupt...it is working.enable only tim3 and external interrupt ...it is working.enable only tim2 and tim3 ...it is working.What can be the cause of Hard fault handler?
Thanks in advance.
Regards,
Mohit Rai2017-12-09 04:11 AM
Got the solution. My external interrupt handler processing time was more. I have written a number of line in the handler. due to this reason, my code my not working when I was enabling all the interrupt.
Problem solved.
2017-12-09 04:15 AM
Having the handler identify the faulting instruction will also help.
https://community.st.com/0D50X00009Xke40SAB
My guess would have been a division by zero, or insufficient stack depth
2017-12-09 12:42 PM
Hello,
Thank you for your response.
In cortex M4, for divide by zero.I have to configure Configuration and Control Register (CCR).
and I have not configured this register. this problem may be due to insufficient stack depth.I will check my code.
Regards,
Mohit Rai