K20 WDog Stopped on KDS Attach

cancel
Showing results for 
Search instead for 
Did you mean: 

K20 WDog Stopped on KDS Attach

392 Views
leifzars
Contributor IV

On attach the wdog is disabled, is this a bug?

Bellow only print out when I attach kds to a running target. It prints out indefinitely. But if I run a debug session, it never is called.

//in main loop

  if (!(WDOG_STCTRLH & WDOG_STCTRLH_WDOGEN_MASK))

       LOG_INFO("WDOG is DEAD!!!!");

Labels (1)
0 Kudos
6 Replies

125 Views
santiago_gonzal
NXP Employee
NXP Employee

Have a look at the file init_kinetis.tcl. When you attach to a target it runs, disabling your WDOG.

You can delete or comment the lines of the code that are disabling the WDOG if you want to change that functionality.

Regards,

Santiago

0 Kudos

125 Views
leifzars
Contributor IV

Thanks

I am not seeing this file.

Is this file in my project or in the KDS directory ?

0 Kudos

125 Views
santiago_gonzal
NXP Employee
NXP Employee

Sorry, my fault. This is used in CodeWarrior projects, but not in KDS projects.

Maybe what is going on is that you didn't enable the watchdog to run while debugging. There is one bit in the configuration register to allow the WDOG to keep running while debugger is connected to MCU. Check the Reference Manual and let me know if that solves the problem.

Regards,

Santiago

0 Kudos

125 Views
leifzars
Contributor IV

Yes this is correct, wdog is disabled during debugging. But I believe this does not change the WDOG_STCTRLH_WDOGEN_MASK bit. Further more its intent is to prevent a wdog reset while execution is paused, not turn off the wdog completely.

0 Kudos

125 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Leif:

I have seen some programming interfaces that disable the watchdog when connecting.

What programming tool are you using?

If you can share your project to reproduce this that would help us to determine the root cause.

Regards!

Jorge Gonzalez

0 Kudos

125 Views
leifzars
Contributor IV

Segger j-link.

I do not have a sample program, but any program with the wdog enabled will work.

0 Kudos