2022-04-06 03:23 AM
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)
[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.
Solved! Go to Solution.
2022-04-06 03:48 AM
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.
Likely got a LDRD or STRD against a pointer that isn't on a 32-bit boundary, and the compiler has optimized inappropriately.
2022-04-06 03:48 AM
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.
Likely got a LDRD or STRD against a pointer that isn't on a 32-bit boundary, and the compiler has optimized inappropriately.
2022-04-10 05:28 PM
When I checked, it seemed that a strange address was being called.
Thanks for your help