cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753I HardFault_Handler() __iar_packbits_init_single3

KGane.1
Associate III

I have simple application( LED toggling) built for STM32H753I-EVAl board using IAR EWARM Toolchain. I am using IAR I-Jet debugger to download and debug application.

When I download application, i am getting Fault exception

"the processor has escalated a configurable-priority exception to hardfault

am imprecise data access error has occurred"

Call Stack:

HardFault_Handler()

<Exception frame>

[__iar_packbits_init_single3 + 0x19]

<Unknown handler>

Seems the Reset_Handler in startup code calls SystemInit() and then __iar_program_start. The control never comes out the function to main().

What could cause fault exception toolchain specific functions.? Am I missing something in initialization? 

Observation: Sometimes the application is running successfully. The LED toggling is perfectly fine. Tried running application on two boards. Seeing fault exception on both boards but not always.

This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4
TDK
Super User

Stay objective, stop guessing. Examine SCB and determine cause of hard fault and trace it to the source.

Probably a memory mismanagement issue.

edit: for imprecise faults, verify solid power scheme, decoupling caps, clock setup and wait states.

If you feel a post has answered your question, please click "Accept as Solution".
KGane.1
Associate III

@TDK​ Thanks. Started looking into debugger log. Seems unhandled BusFault caused HardFault exception.

Sun Jan 16, 2022 19:20:21: Stopped by a vector catch: 

Sun Jan 16, 2022 19:20:21: BusFault fault escalated into HardFault 

Sun Jan 16, 2022 19:20:21: The BusFault handler is disabled 

Sun Jan 16, 2022 19:20:21: HardFault exception. 

Sun Jan 16, 2022 19:20:21: The processor has escalated a configurable-priority exception to HardFault. 

Sun Jan 16, 2022 19:20:21:  An imprecise data access error has occurred. 

Sun Jan 16, 2022 19:20:21:  

Sun Jan 16, 2022 19:20:21: Exception occured at: 0x800310e 

Sun Jan 16, 2022 19:20:21:  

Sun Jan 16, 2022 19:20:21: See the call stack for more information. 

What is confusing is why the failure is not consistent? Does it relate to timing issues in read/write of internal memory?

Not sure if you saw my edit. For imprecise error, verify clock and power settings, power rail, wait states.
If you feel a post has answered your question, please click "Accept as Solution".
KGane.1
Associate III

@TDK​ Thanks. It seems data corruption during binary download is causing the problem. Download verification is failing. Trying to run failed binary is causing Hardfault.