Hello @QuocHuyUT ,
Thanks for your post. You can customize the HardFault_Handler() function in the SDK's startup_mcxc144.c file.
Celeste_Liu_1-1751876023664.png
Add some code to detect the source of the Hard Fault (please refer to Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse and McuLib/src/McuHardFault.c at master · ErichStyger/McuLib · GitHub.), and then add the system reset trigger function NVIC_SystemReset().
Celeste_Liu_0-1751875288880.png
Hope it can help you.
BRs,
Celeste
---------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
---------------------------------------------------------------------------------------------------------------------