Skip to main content
SSAID.1
Associate
July 25, 2022
Question

Hi, How to resolve Hardfault handler issue in stm32h723zg chip running with stm32ide?

  • July 25, 2022
  • 2 replies
  • 12626 views

I got this issue when i am executing FLASH TEST, inside that i am calling OPTIONAL BYTE CONFIG

0693W00000QM3wzQAD.pngwhen i am calling it in main.c it is working fine but when i am trying to debug second time it is enter into HardFault_handler(void) function. when i am trying to reset or restarting it is not resolved it is throwing same fault

NOTE:- Now it is not working for all others modules. 0693W00000QM3yHQAT.pngplease help me with this issue,thank you in Advance

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
July 25, 2022

Have a better Hard Fault Handler which can unpack and display details.

Is the RAM or cache changed by the command/configuration here.

Look at registers and expectations at fault.​

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
SSAID.1
SSAID.1Author
Associate
July 25, 2022

Hi Tesla DeLorean,

issue is when i am trying to debug different module in the same (stm32h723zg) nucleon board before hitting the break point it is Entering into Hardfault_ handler ()function.So, when i am trying to find solution. i got to know st community. Can you please help me how to find route cause and solution .

when i am observing SCB->CFSR register one flag(IMPRECISERR) is set with "1" ,AND one more register which is SCB->HFSR inside that FORCED set with "1".

Vmere.1
Associate III
July 25, 2022

So your code is not reaching main function.

Use the below registers to know which error you are facing. And try to see from there.

Mostly UFSR or CFSR. But use a debugger and find the fault. 0693W00000QM4EyQAL.png

SSAID.1
SSAID.1Author
Associate
July 26, 2022

0693W00000QM82IQAT.png hi Vmere.1

thank you for you support, but this what i am getting while debugging i am not able to find what is the exact issue.

Vmere.1
Associate III
July 26, 2022

I never faced this.

But there are some issues already with the same problem.

https://community.st.com/s/question/0D50X00009Xke1gSAB/hardfault-impreciserr

Imprecise error means, the system doesn't know where the error came from. So it should be little more difficult to find out. But if your code is small then you can find it out.

I found this link, I hope it should be helpful.

https://interrupt.memfault.com/blog/cortex-m-fault-debug#coprocessor-fault-example

Are you using some kind of rtos?