2019-10-05 06:03 AM
my application code running some time inside mcu then suddenly hard fault occur so i debug my application found hard fault occur inside mcu how to solve this.
2019-10-05 06:33 AM
Inspect the faulting code. There is likely a write instruction a few instructions earlier that is failing, thus the "imprecise" tag.
2019-10-05 04:06 PM
See this document: Cortex M3/M4,M7 Faults tutorial
2019-10-07 06:50 AM
problem solved i change interrupt priority high and low not same priority of both interrupt
2021-12-04 03:15 AM
how can i change the priority in stm32cube ide?
2021-12-04 10:16 AM
In the .ioc (device configuration) view > System Core > NVIC. There are also tbas for the individual periperals.
hth
KnarfB
2024-01-25 02:58 PM
I know I'm several years late, but could you elaborate on this solution? I am running an RTOS and I am getting the same error. I have enabled various ISR's (UART, ETH, GPIO, DAC etc) and they currently all have the same priority. What would you change based on this knowledge?
2024-01-25 03:09 PM - edited 2024-01-25 03:10 PM
Could be something entirely different.
Just diagnose WHY your situation is faulting rather than blindly shot-gunning.
Look at what's faulting, more likely to be bad pointer or misaligned write, or an insufficiently large stack.
Dump some useful / actionable data about what the system is objecting too.
https://github.com/cturvey/RandomNinjaChef/blob/main/KeilHardFault.c
NVIC has priorities and preemption levels and you can split how the bits are allocated.