cancel
Showing results for 
Search instead for 
Did you mean: 

Hard fault occur stm32 imprecise data access violation true studio.

parth kothiya
Senior

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. 0690X000009k4wWQAQ.bmp0690X000009k4wRQAQ.bmp

7 REPLIES 7

Inspect the faulting code. There is likely a write instruction a few instructions earlier that is failing, thus the "imprecise" tag.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

See this document: Cortex M3/M4,M7 Faults tutorial

parth kothiya
Senior

problem solved i change interrupt priority high and low not same priority of both interrupt

NMish.1
Associate II

how can i change the priority in stm32cube ide?

In the .ioc (device configuration) view > System Core > NVIC. There are also tbas for the individual periperals.

hth

KnarfB

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?

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.

 

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..