Watchdog does not trigger reset on s32k

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Watchdog does not trigger reset on s32k

Jump to solution
902 Views
zainali
Contributor II

Hi,

I am trying to setup watchdog for s32k144. For that i am using sdk. The sequence to setup is watchdog is defined below:

  • zainali_1-1652449326022.png
  • WDOG_DRV_Init(INST_WATCHDOG, &watchdog0_Config0); // To initialize the watchodog in main.
  • WDOG_DRV_Trigger(INST_WATCHDOG); // Trigger watchdog in main loop.

 

Now the problem is that if i comment "WDOG_DRV_Trigger(INST_WATCHDOG);" then the MCU does not restart. But if i do run code in debug mode and add breakpoint on "WDOG_DRV_Init" function then watchdog resets MCU.

 

Any idea what might be wrong with my configuration as my watchdog only perform reset when i am in debug mode plus i add breakpoint on "WDOG_DRV_Init".


Thanks

0 Kudos
Reply
1 Solution
896 Views
zainali
Contributor II

The issue was due to optimization level. For above test i was using optimization of -Os. Once i switched to -O0, it would work every time.

View solution in original post

0 Kudos
Reply
1 Reply
897 Views
zainali
Contributor II

The issue was due to optimization level. For above test i was using optimization of -Os. Once i switched to -O0, it would work every time.

0 Kudos
Reply