2022-01-16 07:06 PM
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.
2022-01-16 07:23 PM
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.
2022-01-16 07:51 PM
@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?
2022-01-16 08:36 PM
2022-01-17 12:54 PM
@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.