We are using MKV56 in one of our projects where we control current through MOSFET's with PWM. Some of the mkv56 (15 out of 100) are triggering hardfault at higher currents (220 Amps and above).
Similar observation when we use s32k144 also.
Below are some observations:
1. Some times hardfault triggers with PC address from SRAM ITC in MKV56
2. With increase in temperature of the board current cutoff where hardfault triggers increases. After some point hardfault doesn't even trigger.
3. With small change in code , like removing incrementing of variable also makes hardfault triggering go away. Very random behaviour w.r.t small code change (unused code change also causes hardfault triggering to disappear).
4. Adding one or two lines of code to debug exact reason for hardfault makes the hardfault source to change and location from where hardfault triggers also changes.
Attached clock config, linker files for reference
Hi @anup_gandra,
Thank you so much for your interest in our products and for using our community.
The main causes of a hard fault in this part are due to writing to a read-only register or that not meeting the voltage and current operating requirements. Could you please start by ruling out these two possible causes?
Hope it helps you. Please let me know if you have more questions about it.
Have a nice day!
Best regards,
Leonardo