2023-10-21 10:43 PM
hi
I use stm32f4 micro but an external interrupt pin
when i increase frequency of the external signal connected to interrupt pin, the micro jump to hardfault
why? how I can detect the solution?
2023-10-21 11:04 PM
At what frequency of the external signal it goes to hardware fault? Below this frequency which function you are calling when interrupt happens?
2023-10-21 11:24 PM
the interrupt routine is free and i commented all the code in it.
the frequency above 3khz will be Hard Fault.
how i can see the problem detail in hard fault?
2023-10-21 11:33 PM
The sequence is step1: HAL_GPIO_EXTI_IRQHandler function is called and after that some issue happened and the hardfault handler is called. Can you show your code? In the interrupt handler can you toggle a port based on the external input signal, so both shall match for debugging purpose.
2023-10-22 12:08 AM
2023-10-22 10:02 AM
Maybe something in get_sample() is causing an issue?
Have you tried commenting out adc_read_value[adc_read_index]=get_sample(); to see if it still goes to hardfault?
2023-10-22 10:25 AM
i remove all of the interrupt routine but it crashes.
only when i remove external interrupt it will be ok
why?
2023-10-22 01:14 PM
>>why?
These things don't need to be guessing games. Go identify what's actually faulting and work backward from there.
If you don't service interrupts in handlers, they'll keep entering.
Have a Hard Fault Handler that does something more useful that while(1), I've posted examples on multiple occasions on.
https://github.com/cturvey/RandomNinjaChef/blob/main/KeilHardFault.c
2023-10-23 12:42 AM
this data is displayed on stm32cubeide
what i should with this data?
2023-10-23 01:10 AM
What data?