RESET MCU WHEN HARDFAULT

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RESET MCU WHEN HARDFAULT

ソリューションへジャンプ
370件の閲覧回数
QuocHuyUT
Contributor I

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

ラベル(1)
0 件の賞賛
返信
1 解決策
321件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

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!
---------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
322件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

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!
---------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信