2017-10-09 06:41 AM
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.
2017-10-09 09:10 AM
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.
2017-10-10 11:06 AM
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?
2017-10-10 12:33 PM
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.