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!!!!");
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
Thanks
I am not seeing this file.
Is this file in my project or in the KDS directory ?
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
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.
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
Segger j-link.
I do not have a sample program, but any program with the wdog enabled will work.