K20 WDog Stopped on KDS Attach

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

K20 WDog Stopped on KDS Attach

2,802 次查看
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!!!!");

标签 (1)
0 项奖励
回复
6 回复数

2,535 次查看
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 项奖励
回复

2,536 次查看
leifzars
Contributor IV

Thanks

I am not seeing this file.

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

0 项奖励
回复

2,536 次查看
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 项奖励
回复

2,536 次查看
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 项奖励
回复

2,536 次查看
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 项奖励
回复

2,536 次查看
leifzars
Contributor IV

Segger j-link.

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

0 项奖励
回复