cancel
Showing results for 
Search instead for 
Did you mean: 

Need advice on resolving hard fault error while running SPI communication between 2 F767ZI Nucleo boards?

SSRIN.1
Associate III

I have written a routine to exchange a struct of struct data between2 Nucleo F767ZI Boards via SPI. To check the data integrity of transmission, I am using the CRC unit. Before implementing the CRC unit, Never faced any issues, data exchange happened flawlessly. But After a few successful transmission, my slave Nucleo board goes into hard fault. This is my first time facing a hard fault error and I am kind of stuck on how to proceed.

I am actually adding Master and Slave file for your reference.

I really appreciate good guidance on how to proceed further.

Thank You !

2 REPLIES 2
TDK
Guru

> I am kind of stuck on how to proceed.

Examine the SCB registers to determine the source of the hard fault and go from there.

It seems like you have quite a scheme which completes when you receive something other than HAL_OK. You really should always get HAL_OK and if not, it suggests there's an error in your program logic or master/slave synchronization somewhere.

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

Have an effective Hard Fault Handler (not a while loop) that outputs actionable data about the state and context of the micro-controller.

Use the .MAP and listing files to inspect the instruction(s) around the fault in the context of the registers reported.

Once you understand WHAT the MCU has an issue with you can work that backward and into your top level code.

Perhaps stack or structure corruption, accessing arrays out-of-bounds, errant pointers or alignment issues.

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