Skip to main content
parth kothiya
Associate III
October 5, 2019
Question

Hard fault occur stm32 imprecise data access violation true studio.

  • October 5, 2019
  • 4 replies
  • 6269 views

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

4 replies

Tesla DeLorean
Guru
October 5, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Pavel A.
Super User
October 5, 2019
parth kothiya
Associate III
October 7, 2019

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

Visitor II
January 25, 2024

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
January 25, 2024

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 VenmoUp vote any posts that you find helpful, it shows what's working..
NMish.1
Associate II
December 4, 2021

how can i change the priority in stm32cube ide?

KnarfB
Super User
December 4, 2021

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

hth

KnarfB