-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard fault handler error #66
Comments
99% of the time hardfault is caused by uninitialised pointer or an error in pointer maths. I'd guess somewhere in the code the branching of the condition tree bypasses pointer calculations under certain conditions and this causes the error. |
The easiest way to find this is to replicate it with the debugger plugged in under CUBEIDE, and then you can see the chain that led to the hardfault in the left hand debug menu. This is not something that happens normally, there are a few places it can happen that I have experienced - if you are using different peripherals for communication without them set up totally correctly is one, and there is also possibility that your settings result in divide by zero if you have not initialised variables properly. Another may be that you have implemented field weakening current higher than the allowed current. Again, recreate it on CUBEIDE and look at the function call stack to find what caused it. The F405 can be run without the RTOS but you would then need to ensure the defaults and parameters are all set as #defines. I think this is acheivable by just putting a while(1) ahead of the RTOS init. The HFI should swap to observer at higher speeds. I think it is hard coded as being 4V of back EMF. I could parametise this, the intended use case was ebike where the typical battery is 40-80V so it swaps at ~5-10% speed. The current use during HFI will always be higher, since the current is being injected... the heat may well be due to higher iron losses from the 10kHz AC current injected. If you intend long term operation in the near zero speed region, HFI is probably not a good option regardless of the implementation.... get an encoder... |
Hello David
I use the latest firmware to run at F405 , but I found that it occasionally or frequently enters : hard fault error. This error is difficult to locate. Do you have a solution for this part?
And another question, how to use HFI or how to use HFI in low speed and switch to observer in high speed?
When I turn on HFI, the motor can spin, but sometimes it rotated in CW, sometimes CCW, and the current is very high, the motor is very hot. I set hfi type 2, SL_sensor 3 .
The above two questions:
1 : hard fault error, when start motor fast rotation potentiometer or RCPWM , and When put some load .
2: current is very high when use HFI function and the motor is very hot.
Than you .
The text was updated successfully, but these errors were encountered: