在网上查了很多资料,AT926x系类的ARM内置看门狗基本上很少用,都推荐使用外部看门狗,我尝试了好多天使用内置的看门狗来监控自己的应用程序,但都没有找到切入点,十分不甘心,向大家学习。
先把我的尝试简单介绍一下:
Kernel\Watchdog目录下有个watchdog.c的文件
1、喂狗函数:OEMRefreshWatchDog()
2、引用了一个指针函数extern void (* pfnOEMRefreshWatchDog) (void); ///< function pointer used by the kernel to call the function to refresh watchdog,我全文所搜pfnOEMRefreshWatchDog并没有发现在哪里定义
3、看门狗初始化函数:OEMInitWatchDogTimer()
// the watchdog thread run with access to all processes so that it can set the watchdog event
SWITCHKEY (dwTick, 0xffffffff);
do {
// refresh hardware watchdog if exist
pfnOEMRefreshWatchDog ();
// default timeout is either hardware watchdog period, or infinite when there is no
// hardware watchdog
dwTimeout = dwOEMWatchDogPeriod? dwOEMWatchDogPeriod : INFINITE;
Hi,
I have a syatem which has a hardware watchdog.
I have few queries on the API exposed by windows CE 5.0 for watchdogs.
1) Do the API's like CreateWatchdogTimer, StartWatchdogTimer create
software watchdogs?
2) If a create function to refresh my hardware watchdog and hook it up
to the pfnOEMRefreshWatchDog function pointer then willthe API
mentioned in point 1 manipulate my hardware dog??
3) Also there are no functions wh?hich start or shutdown the hardware
watchdog, do I need to write a driver for it and then create API's
above it?
回复:
1) yes, you could use them even if you have no HW watchdog
2) tipically the HW watchdog is refreshed every dwWatchDogPeriod
milliseconds using pfnRefreshWatchDog (pfnOEMRefreshWatchDog is a wrong name
reported in the docs).if you call CreateWatchdogTimer with the
WDOG_RESET_DEVICE
flag and you do not refresh it, the kernel will not call pfnRefreshWatchDog
and the HW watchdog will reset your device
3)There are no functions which start the hardware watchdog: you have to
write some code in the OAL to configure it not to elapse before
dwWatchDogPeriod then assign the pfnRefreshWatchDog function and the kernel
will refresh it: if this shoul not happen it means that the OS is freezed and
the HW watchdog must be triggered: you do not need to write any driver
Luca Calligariswww.eurotech.it
Hi,
I have a syatem which has a hardware watchdog.
I have few queries on the API exposed by windows CE 5.0 for watchdogs.
1) Do the API's like CreateWatchdogTimer, StartWatchdogTimer create
software watchdogs?
2) If a create function to refresh my hardware watchdog and hook it up
to the pfnOEMRefreshWatchDog function pointer then willthe API
mentioned in point 1 manipulate my hardware dog??
3) Also there are no functions wh?hich start or shutdown the hardware
watchdog, do I need to write a driver for it and then create API's
above it?
回复:
1) yes, you could use them even if you have no HW watchdog
2) tipically the HW watchdog is refreshed every dwWatchDogPeriod
milliseconds using pfnRefreshWatchDog (pfnOEMRefreshWatchDog is a wrong name
reported in the docs).if you call CreateWatchdogTimer with the
WDOG_RESET_DEVICE
flag and you do not refresh it, the kernel will not call pfnRefreshWatchDog
and the HW watchdog will reset your device
3)There are no functions which start the hardware watchdog: you have to
write some code in the OAL to configure it not to elapse before
dwWatchDogPeriod then assign the pfnRefreshWatchDog function and the kernel
will refresh it: if this shoul not happen it means that the OS is freezed and
the HW watchdog must be triggered: you do not need to write any driver
Luca Calligariswww.eurotech.it