Hello, I want my MCU will auto reset when Hardfault for avoid stuck. My mcu is #MCXC144vft ide is @MCUXpresso , any solutions for this? Thanks so much
Solved! Go to Solution.
Hello @QuocHuyUT ,
Thanks for your post. You can customize the HardFault_Handler() function in the SDK's startup_mcxc144.c file.
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().
Hope it can help you.
BRs,
Celeste
---------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
---------------------------------------------------------------------------------------------------------------------
Hello @QuocHuyUT ,
Thanks for your post. You can customize the HardFault_Handler() function in the SDK's startup_mcxc144.c file.
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().
Hope it can help you.
BRs,
Celeste
---------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
---------------------------------------------------------------------------------------------------------------------