2019-03-15 01:14 AM
Hello,
A project created in truestudio generates a HardFault_Handler.
There are 2 PCBs I made. PCB A and PCB B are the same circuit and components. I have confirmed that the operation is correct while writing the code in PCB A.
However, there was a problem with PCB B. My program is Fatfs + USB HOST MSC.
It repeats until it becomes f_open with while statement.
If (f_mount == FR_OK) to f_mount seems to be no problem. However, f_open fails to pass, and the process goes to HardFault_Handler.
How do I debug HardFault_Handler?
Solved! Go to Solution.
2019-03-15 08:15 AM
You can use the Atollic Truestudio Fault Analyzer available while debugging, it should give to you the information required.
2019-03-15 02:23 AM
Use one of the many fault handler examples posted and try to pin down exactly where the fault is occurring in your code. You want to look at the assembler in the context of the registers and at what memory access was being attempted. In non GNU/GCC implementations I would look at stack and heap sizes.
2019-03-15 02:47 AM
> However, there was a problem with PCB B.
Most probably a symptom of a bug in your firmware.
> How do I debug HardFault_Handler?
Check the SCB register settings for fault reasons.
And try more than once. Stack issues often show inconsistent symptoms, interrupts are often the final straw that break the camel's (stack's) back.
2019-03-15 08:15 AM
You can use the Atollic Truestudio Fault Analyzer available while debugging, it should give to you the information required.