2023-09-01 07:56 AM - edited 2023-09-01 08:00 AM
Hi all.
I develop controller for PMSM motor and got a problem as below:
Some time MCU jump to hardfault handler. In debug, I see that it cause from random point (different from time to time), some time it cause from very basic function (such as sinf(), cosf(), delay..), as below
disassembly at <signal handler called>() at 0xffffffe9 as below:
"ffffffe9: Failed to execute MI command:
-data-disassemble -s 4294967273 -e 4294967413 -- 3
Error message from debugger back end:
Cannot access memory at address 0xffffffe8"
I also think it may cause from hardware because inverter may generate lot of noise. But whenmeasure noise in power, clock of MCU, it is clean: as below
When hardfault about to occur, the debug connection on cube monitor corrupt many time
So, where I can check for this issue?
Thanks
Solved! Go to Solution.
2023-09-04 02:22 AM
Hello @dinhlx,
Could you check the fault analyzer window?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-09-04 02:22 AM
Hello @dinhlx,
Could you check the fault analyzer window?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-09-04 06:11 AM
Hello,
Since you're running a motor, with random points of hardfault, are you sure you're not facing any EMC issues?
2023-09-11 06:01 AM
Thank F.Belaid for reply.
I will check and revert to you when have result.
2023-09-11 06:04 AM
thank SofLit. I also worry about EMI/EMC, so I measure voltage to check and result as mention above. Voltage very clean. with this voltage, can I conclude that isn't EMC issue?
2023-09-11 06:12 AM - edited 2023-09-11 06:32 AM
Hello,
I'm not an expert of EMC/EMI topics but from what you have described and the randomness behavior, it looks like an EMI/EMC or HW issue. If you disconnect the motor, does the HF happen again?
For your power supply it can be some spikes not seen by a simple run.. Use scope triggers to detect them..
Check your grounds.. your connections your shielding, isolation etc..
You can also refer to this application note.
2023-09-11 06:22 AM
For a custom board make sure the VCAP pins and capacitors are correct and placed close to the MCU. Check the voltage.
Double check FLASH configuration, especially wait-states.
Faults probably coming from interrupt / callback code. Make sure you're not overwriting the stack via auto/local variables or arrays out-of-bounds.
The 0xFFFFFFE9 is a magic call-gate address used by the MCU to unstack context related to interrupts/handlers. Not going to see code there.