Xilinx Vitis Drivers API Documentation
wdttb Documentation

The Xilinx watchdog timer/timebase component supports the Xilinx legacy watchdog timer/timebase and window watchdog timer hardware. More detailed description of the driver operation for each function can be found in the xwdttb.c file.

The Xilinx watchdog timer/timebase driver supports both legacy and window features: Features in legacy watchdog timer:

  • Polled mode
  • enabling and disabling (if allowed by the hardware) the watchdog timer
  • restarting the watchdog.
  • reading the timebase.

Features in window watchdog timer:

  • Configurable close and open window periods.
  • Enabling and disabling Fail Counter (FC).
  • Enabling and disabling Program Sequence Monitor (PSM).
  • Enabling and disabling Second Sequence Timer (SST).
  • Setting interrupt assertion point in second window.
  • Controlling the write access to the complete address space.
  • Always enable.

The window watchdog timer always enable feature enables watchdog timer forever. It can only be disabled by applying the reset to the processor or core.

It is the responsibility of the application to provide an interrupt handler for the timebase and the watchdog and connect them to the interrupt system if interrupt driven mode is desired.

The legacy watchdog timer/timebase component ALWAYS generates an interrupt output when:

  • the watchdog expires the first time
  • the timebase rolls over and ALWAYS generates a reset output when the watchdog timer expires a second time. This is not configurable in any way from the software driver's perspective.

The window watchdog timer asserts an interrupt when

  • the watchdog reaches at the interrupt programmed point in second window and ALWAYS generates reset output
  • when single bad event occur if fail count disable,
  • if fail counter is 7 and bad event happens.

The Timebase is reset to 0 when the Watchdog Timer is enabled.

If the hardware interrupt signal is not connected, polled mode is the only option (using IsWdtExpired) for the legacy watchdog and GetIntrStatus option for the window watchdog. Reset output will occur for the second watchdog timeout regardless. Polled mode for the timebase rollover is just reading the contents of the register and seeing if the MSB has transitioned from 1 to 0.

The IsWdtExpired function is used for polling the watchdog timebase timer and it is also used to check if the watchdog was the cause of the last reset. In this situation, call Initialize then call IsWdtExpired. If the result is true watchdog timeout caused the last system reset. It is then acceptable to further initialize the component which will reset this bit.

The XWdtTb_GetIntrStatus is used for polling the window watchdog timer and it is used to check if interrupt programmed point has reached.

This driver is intended to be RTOS and processor independent. It works with physical addresses only. Any needs for dynamic memory management, threads or thread mutual exclusion, virtual memory, or cache control must be satisfied by the layer above this driver.

Ver   Who  Date     Changes

1.00a ecm 08/16/01 First release 1.00b jhl 02/21/02 Repartitioned driver for smaller files 1.00b rpm 04/26/02 Made LookupConfig public and added XWdtTb_Config 1.10b mta 03/23/07 Updated to new coding style 1.11a sdm 08/22/08 Removed support for static interrupt handlers from the MDD file 2.00a ktn 22/10/09 The driver is updated to use HAL processor APIs/macros. The following macros defined in xwdttb_l.h file have been removed - XWdtTb_mEnableWdt, XWdtTb_mDisbleWdt, XWdtTb_mRestartWdt, XWdtTb_mGetTimebaseReg and XWdtTb_mHasReset. Added the XWdtTb_ReadReg and XWdtTb_WriteReg macros. User should XWdtTb_ReadReg/XWdtTb_WriteReg to achieve the desired functionality of the macros that were removed. 3.0 adk 19/12/13 Updated as per the New Tcl API's 3.1 sk 11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425. 4.0 sha 12/17/15 Added Window WDT feature with basic mode. Changed XWdtTb_GetTbValue to inline function. Adherence to MISRA-C guidelines. 4.0 sha 01/29/16 Added XWdtTb_Event enum type. Updated XWdtTb_Config structure with Window WDT parameters. Updated XWdtTb core structure with config parameter and removed RegBaseAddress parameter.

                    Added following static inline functions:
                    XWdtTb_GetTbValue, XWdtTb_SetRegSpaceAccessMode,
                    XWdtTb_GetRegSpaceAccessMode, XWdtTb_GetLastEvent,
                    XWdtTb_GetFailCounter, XWdtTb_IsResetPending,
                    XWdtTb_GetIntrStatus, XWdtTb_IsWrongCfg.
                    Added following functions:
                    XWdtTb_AlwaysEnable, XWdtTb_ClearLastEvent,
                    XWdtTb_ClearResetPending, XWdtTb_IntrClear,
                    XWdtTb_SetByteCount, XWdtTb_GetByteCount,
                    XWdtTb_SetByteSegment, XWdtTb_GetByteSegment,
                    XWdtTb_EnableSst, XWdtTb_DisableSst, XWdtTb_EnablePsm,
                    XWdtTb_DisablePsm, XWdtTb_EnableFailCounter,
                    XWdtTb_DisableFailCounter, XWdtTb_EnableExtraProtection,
                    XWdtTb_DisableExtraProtection, XWdtTb_SetWindowCount,
4.0   sha  02/17/16 Removed 3.1 version and added CR# 867425 change in
                    4.0 version.
4.1   adk  23/12/16 Fix race conition in the tcl CR#966068
      ms   03/17/17 Added readme.txt file in examples folder for doxygen
4.2   ms   04/18/17 Modified tcl file to add suffix U for all macros
                    definitions of wdttb in xparameters.h
4.3   srm  01/27/18 Added XWdtTb_ProgramWDTWidth to pragram the WDT width
           01/30/18 Added doxygen tags
4.4   aru  11/15/18 Replaced "Xil_AssertVoid" as "Xil_AssertNonvoid"
                    in XWdtTb_ProgramWDTWidth().
4.4   sne  03/01/19 Fixed violations according to MISRAC-2012 standards
                    modified the code for below violations,
                    No brackets to then/else,
                    Literal value requires a U suffix,Function return
                    type inconsistent,Logical conjunctions need brackets,
                    Declared the pointer param as Pointer to const,
                    Procedure has more than one exit point.
4.4   sne  03/04/19 Added support for Versal ( Generic Watchdog and
                    Window Watchdog timer).
                    Added following functions:
                    XWdtTb_IsGenericWdtFWExpired, XWdtTb_SetSSTWindow
4.5   nsk  08/07/19 Updated testapp tcl to generate polled mode
                    example, when Wdttb interrupt pin is not connected
                    CR# 1035919.
4.5   nsk  08/07/19 Fixed the warnings while generating test app
4.5   sne  06/25/19 Fixed Coverity warning.
4.5   sne  09/27/19 Updated Tcl file for WWDT & AXI Timebase WDT IP.
              Updated driver to support for WWDT and AXI Timebase WDT.
              While accessing AXI Timebase WDT appending "C" to base
              address for getting AXI Watchdog offsets.
5.0     sne  12/30/19 Updated example files with "Successfully ran"string.CR#1050724
5.0     sne  01/31/20 Removed compare value registers write while configuring Generic
              watchdog window timer.CR#1052544
5.0     sne  02/27/20 Reorganize the driver source and Fixed doxygen warnings.
              Added XWdtTb_ConfigureWDTMode function.
5.1     sne  05/04/20 Fixed violations according to MISRAC-2012 standards.