cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault in FOC AC6 Example for Nucleo F466RE

Teddy Chobtrong
Associate II
Posted on October 09, 2017 at 15:41

I have successful compiled the FOC AC6 STM32F4xx_UserProject corresponding to my 40V BLDC motor with Hall sensors. However, I always get a Hard Fault during 'MCboot' as shown in the attachment.

I am quite new for motor controlling. Please help me to figure it out how to solve this error. Thank you for your support.

3 REPLIES 3
Posted on October 09, 2017 at 18:10

Review what is actually faulting. Look at the code the processor objects too.

Check for errant pointers. Check for missing interrupt handlers. If using .CPP or C++ be aware of name mangling, check vector table for correct linkage.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 10, 2017 at 18:06

I always get the forced hardfault here (as shown in the picture), SPD_Init try to initialize CSPD object (SpeednPosFdbk class).

All code is written in C. How could I check errant pointers?

0690X00000608YKQAY.png
Posted on October 10, 2017 at 19:33

Asserts that check the pointers are within RAM prior to use, NUL checked, etc.

For the stack you should review the size allocated, and look at how much is used (how deep) during execution.

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