NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
TI811X PSP WDT Driver User Guide
Introduction[edit]
Software stability is a major issue on any platform. Anyone who uses software has probably experienced problems that crash the computer or program in question. This is also true of embedded programs, and in most cases there is no user around to reset the computer when things go wrong. That job is occupied by the watchdog timer. The watchdog timer is a 16 bit counter that resets the processor when it rolls over to zero. The processor can reset the counter or turn it off, but, correctly used, it will reset the processor in case of a code crash. To avoid getting reset, the program must reset the timer every so often.
Details[edit]
* Free running 32-bit upward counter.
* Programmable divider clock source (2n with n=[0:7])
* On the fly read/write register (while counting)
* Reset upon occurrence of a timer overflow condition
Configuration[edit]
To enable/disable watchdog support, start the Linux Kernel Configuration tool:
$ make menuconfig
Select Device Drivers from the main menu.
... ... Power management options ---> [ ] Networking support ---> Device Drivers ---> ...
Select Watchdog Timer Support as shown here:
... ... < > Hardware Monitoring Support ---> < > Generic Thermal sysfs driver ---> [*] Watchdog Timer Support ---> ...
Select OMAP Watchdog as shown here:
--- Watchdog Timer Support [ ] Disable watchdog shutdown on close < > Software watchdog ---> <*> OMAP Watchdog ...
Note: Watchdog timer is enabled by default in the ti811x_evm_defconfig
Sample Applications[edit]
This chapter describes the watchdog sample application provided along with the package. The source for this sample application is available in the Examples directory of the Release Package folder.
1) Change the relative path of the kernel directory in the 'Makefile' as per your directory structure :
# Kernel base directory name with path KERNEL_DIR= <insert relative path to the kernel>
2) Compile the application using the 'make' command to obtain the executable :
$ make
3) Run the executable application (saWatchdog) on the EVM :
The application sets the watchdog reset time to 10 seconds by default (this can be changed in the source file as per the user's convenience). To test the watchdog's functionality, run the following two test cases on the EVM and check if the results are as expected.
$ ./saWatchdog <a value less than the watchdog reset time> (eg. $./saWatchdog 5)
$ ./saWatchdog <a value greater than the watchdog reset time> (eg. $./saWatchdog 12)
The application will keep writing values before the timeout in the first case, thus not restarting the system and keeping it going.
The application will get late in writing a value before the timeout in the second case, hence restarting the system.