cancel
Showing results for 
Search instead for 
Did you mean: 

[H723] I want to know why it becomes a hard fault

june
Associate III

H723ZGT6 Nucleo-144

CubeMX 6.3.0

AN209, Summer 2017, V 5.0

An error occurred when writing a for loop process before SDRAM initialization.

I know the solution, but I don't know why this is happening.

(Add static or volatile or write a for loop after SDRAM initialization

Then the problem can be solved)

0693W00000Lx4MxQAJ.png[AN209, Summer 2017, V 5.0]

Using Cortex-M3/M4/M7 Fault Exceptions

I found this manual with details of hard faults.

About UNALIGNED

"There was an unaligned memory access," he said.

What is the relationship between SDRAM initialization and for loops?

Why do I get a hard fault error if I write a for loop before SDRAM initialization?

If anyone knows please let me know.

1 ACCEPTED SOLUTION

Accepted Solutions

Look at what's actually faulting.

Have a proper Hard Fault handler that can quickly/effectively report detail about the point of failure.

Look at the disassembly of the code prior to the fault.

L​ikely got a LDRD or STRD against a pointer that isn't on a 32-bit boundary, and the compiler has optimized inappropriately.

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

View solution in original post

2 REPLIES 2

Look at what's actually faulting.

Have a proper Hard Fault handler that can quickly/effectively report detail about the point of failure.

Look at the disassembly of the code prior to the fault.

L​ikely got a LDRD or STRD against a pointer that isn't on a 32-bit boundary, and the compiler has optimized inappropriately.

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

When I checked, it seemed that a strange address was being called.

Thanks for your help

0693W00000LxW76QAF.png