Skip to main content
parth kothiya
Associate III
Oct 5, 2019 1:03 PM UTC
Question

Hard fault occur stm32 imprecise data access violation true studio.

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

This topic has been closed for replies.

7 replies

Tesla DeLorean
Guru
Oct 5, 2019 1:33 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Oct 5, 2019 11:06 PM UTC
parth kothiya
Associate III
Oct 7, 2019 1:50 PM UTC

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

Visitor II
Jan 25, 2024 10:58 PM UTC

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?

Tesla DeLorean
Guru
Jan 25, 2024 11:09 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
NMish.1
Associate II
Dec 4, 2021 11:15 AM UTC

how can i change the priority in stm32cube ide?

KnarfB
Super User
Dec 4, 2021 6:16 PM UTC

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

hth

KnarfB