cancel
Showing results for 
Search instead for 
Did you mean: 

MC SDK 5.4.4 Random hardfaults

MFran.4
Senior

Hello!

I have the same random hardfault problem but I'm using IAR on a custom board with STSPIN32F0A. I previously developed an application on a demoboard (STEVAL3201) without "Software Error" coming up in the MC UI.

I'm using a new, clean project. I adjusted pins and values and I got the motor running. Unfortunately, sometimes (more often on startup but even while running) the MCU goes in hardfault. With or without debugger attached, with or without UI connected, the hardfaults happen. I used a led for signaling.

I thought I found the solution here:

https://community.st.com/s/question/0D50X0000B07Hm8SQE/always-have-hard-faults-on-mcsdk-540

but I don't know if it applies to my project in IAR. The linker file is in the attachment.

Hardfaults are triggered from random functions, mainly called from ISRs but it's casual (i investigated with the debugger and a breakpoint in the hardfault function).

Any pointers?

Thank you!

EDIT: I observed that the hardfault is more likely to occur when the motor struggles to start.

In the previous project (Steval SPIN3201) the motor always started with hall sensors, no matter what. It could start istantaneously or after 2-5 clunky commutations but it would start. This time when I don't have instant start, it crashes.

Again, it also crashes in other moments. Sometimes even before trying to move the rotor.

1 REPLY 1
Laurent Ca...
Lead II

Dear @Community member​ 

I move your question to #[STM32 Motor Control]​ topic where are managed questions related to STM32 MCSDK.

Best regards

Laurent Ca...