cancel
Showing results for 
Search instead for 
Did you mean: 

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

SSAID.1
Associate II

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

10 REPLIES 10

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

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".

0693W00000QM4ADQA1.pngAfter line number 64 it is enter into Hardfault_Handle() state.

Vmere.1
Senior

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

Imprecise suggests a WRITE

Is the stack at a RAM address, or did the OB change the memory mapping such that the compiled/linked code had different expectations?

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

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.

0693W00000QM84EQAT.pngAfter 183 line it is entering into Hardfault _handler. even i am not sure what exactly issue is.

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?

Hi Vmere.1

when i am doing flash optional byte shared RAM configuration testing. when i am debugging it is working fine for first time when i am stopped and started second time debugging i am facing this issue, before entering into main() function it is hitting with Hardfault_handler(), aftter that i am trying with other modules it is hitting same thing , So i am not sure where the issue and what is the solution for that.