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.

AM335x PSP WDT Driver User Guide

From Texas Instruments Wiki
Jump to: navigation, search
TIBanner.png
AM335x PSP WDT Driver User Guide
Linux PSP

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 32 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.

IP features[edit]

2 instances: 1 System watchdog timer (used in Linux) and 1 Security watchdog timer

  • 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

Driver[edit]

AM335x has a 32-bit watchdog timer which can be used to reset the hardware in case of a software fault. Once the /dev/watchdog is opened, it will reboot the system unless a user space daemon resets the timer at regular intervals within a certain timeout period. If watchdog device node is closed before timeout also reboot won't happen. The WDT driver is registered as a misc device. Default timeout of this driver is 60 seconds


Wdt.png


















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 am335x_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 (wdt) 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.


E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article AM335x PSP WDT Driver User Guide here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article AM335x PSP WDT Driver User Guide here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article AM335x PSP WDT Driver User Guide here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article AM335x PSP WDT Driver User Guide here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article AM335x PSP WDT Driver User Guide here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article AM335x PSP WDT Driver User Guide here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article AM335x PSP WDT Driver User Guide here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article AM335x PSP WDT Driver User Guide here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article AM335x PSP WDT Driver User Guide here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity