S-WdgIf_UserManuals


Safe Watchdog Interface
User Manual
Version:
1.9.4
Date:
21.05.2014
Document number:
D-MSP-M-70-006
TTTech Autom otive Gm bH
Schoenbrunner Str. 7, A-1040 Vienna, Austria, Tel. + 43 1 585 34 34-0, Fax +43 1 585 34 34-90, support@tttech-automotiv e.com
The data in this document may  not be altered or amended without special notif ication f rom TTTech Automotiv e GmbH. TTTech Automotiv e GmbH
undertakes no f urther obligation in relation to this document. The sof tware described in it can only  be used if  the customer is in possession of  a general
license agreement or single license.
Using and copy ing is only  allowed in concurrence with the specif ications stipulated in the contract. Under no circumstances may  any  part of  this
document be copied, reproduced, transmitted, stored in a retriev al sy stem, or translated into another language without written permission of  TTTech
Automotiv e GmbH.
The names and designations used in this document are trademarks or brands belonging to the respectiv e owners.
© 2011 - 2014 TTTech Automotiv e GmbH. All rights reserv ed.                                                                                 Subject to changes and
corrections.
TTTech Automotiv e GmbH Conf idential and Proprietary  Inf ormation


Safe Watchdog Interface
Page
2
Table of Contents
1 Introduction
3
2 Safe Watchdog Interface
3
2.1 Basic. ..
F..
u..
n..
c .t.i..
o ..
n ..
a .l.i.t..
y .
  ..
o .
f .
  .
t ..
h ..
e .
  ..
S .-...
W ..
d..
g.I.f...................................................................................... 3
2.2 Exte .
n ..
si ..
o..
n..
s .
  .
t ..
o .
  .
t ..
h ..
e .
  ..
A ..
U..
T...
O ..
S ..
A...
R ....
W ..
a .
t ..
c .
h..
d..
o..
g. .I..
n..
t .
e..
r .
f ..
a ..
c .
e................................................................ 4
2.3 Devi .
a .
t .
i ..
o ..
n ..
s  .f..
r .
o...
m. ..
t .
h..
e. ...
A ..
U ..
T ...
O ..
S ..
A ..
R. ...
W..
a..
t .
c..
h..
d..
o..
g. .I..
n.t..
e ..
r .
f .
a..
c..
e ............................................................ 5
2.4 Integ .
r ..
a .t.i..
o ..
n . ...
w .
i .
t ..
h .
  ..
F ..
u .
l .
l ..
y ...
A ..
U ..
T ...
O ..
S ..
A ..
R. ...
C .
o...
m..
p.l.i..
a..
n..
t ...
D .
r .i..
v ..
e .
r ..
s ........................................................... 5
2.5 Confi ..
g ..
u .r..
a .t.i..
o..
n. ..
P..
a..
r ..
a ...
m ..
e .
t ..
e .
r ..
s ..
f .
o..
r .
  .
t ..
h ..
e .
  ..
S .-...
W ..
d..
g.I.f.......................................................................... 5
2.6 Confi ..
g ..
u .r.i..
n..
g. .t..
h..
e . ..
S..
- ...
W ..
d ..
g .
I .
f .
  .
i ..
n .
  .
t ..
h ..
e .
  ..
E ..
C ..
U. ...
D .
e..
s..
c .
r .i..
p .t.i..
o ..
n . ..
F .i.l..
e .......................................................... 7
2.7 Prep .
r .
o..
c..
e ..
s ..
s .
o..
r ...
O ..
p .t.i..
o ..
n ..
s ......................................................................................................... 8
2.8 File  .
S .t.r..
u..
c .t..
u .r..
e ...................................................................................................................... 9
3 API Description
11
3.1 Typ .
e . ...
D .
e..
fi..
n.i..
ti..
o..
n..
s................................................................................................................ 11
3.2 S-W ..
d ..
g .I.f. ..
F ..
u ..
n ..
c .
t .
i ..
o ..
n ..
s ............................................................................................................ 12
3.3 Exp .
e..
c.t..
e ..
d. .I..
n.t..
e ..
r .
f .
a..
c..
e ..
s .......................................................................................................... 15
4 S-WdgIf Configuration
16
4.1 Link. ..
T.i...
m ..
e . ...
C .
o..
n..
fi..
g..
u..
r ..
a .
t .
i ..
o ..
n ................................................................................................... 16
4.2 S-W ..
d ..
g .I.f. ..
C..
o..
n.f.i..
g..
u..
r .
a..
ti..
o..
n. ...
G ..
e ..
n ..
e .r..
a .t..
o..
r ..................................................................................... 16
4.3 Erro .r. ...
M ..
e ..
s .
s..
a ..
g ..
e ..
s ................................................................................................................. 17
4.3.1    Basic  .
E .
r ..
r ..
o ..
r ..
s . ............................................................................................................................................... 17
4.3.2    Sem an..
t .i..
c . ..
E.r..
r ..
o..
r ..
s..
  ....................................................................................................................................... 17
5 Abbreviations
19
6 References
20
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Introduction
Page
3
1
Introduction
The Safe Watchdog Interface  (S-WdgIf)  is  a  part  of  the  Safe  Watchdog  Manager
Stack
.
Note: This is a user manual and does not cover safety-related topics. For safety-related
projects  that  need  to  fulfill  ISO  26262  requirements,  refer  to  the  Safe  Watchdog
Interface Safety Manual
 [5] 20 .
Note: The <infix> placeholder used in this document stands for the infix part of the
names of the Watchdog driver functions to which the S-WdgIf interfaces. Depending on
the version of the used AUTOSAR environment, the S-WdgIf can consist of the
following:
In AUTOSAR 4.0 compatible environment, the S-WdgIf consists of the vendor ID and
device name strings, where vendo ID is the ID of the vendor of the Watchdog driver
and device name is the name of the configured Watchdog driver device .
In AUTOSAR 3.1 compatible environment, the S-WdgIf consists of the device name
string, where device name is the name of the configured Watchdog driver device 
2
Safe Watchdog Interface
2.1
Basic Functionality of the S-WdgIf
The S-WdgIf was developed according AUTOSAR version 4.0.1 [2] 20  and adapted for
the  AUTOSAR  3.1.4  environment  [1] 20 .  The  S-WdgIf  is  compatible  with  both
AUTOSAR versions, but not fully compliant. For the deviations, see section Deviations
from the AUTOSAR Watchdog Interface 
5 .
The S-WdgIf is  designed  to  be  integrated  into  an AUTOSAR 3.1.4  and  4.0.1  system.
However, it is not restricted to this AUTOSAR version. The software module can also be
integrated into other versions of AUTOSAR and  other  system  software  architectures  if
the  integration  related  requirements  listed  in  the  Safe  Watchdog  Interface  Safety
Manual
 [5] 20  are met.
The S-WdgIf provides a standard interface to all the configured watchdog devices. The
Safe  Watchdog  Manager  (S-WdgM)  accesses  each configured  watchdog  through  its
Device Index.
The  S-WdgIf  is  hardware-independent  and  abstracts  one  or  more  Safe  Watchdog
Driver  modules  for  the  S-WdgM.  The  S-WdgM  calls  the  S-WdgIf  with a  device  index
parameter  (DeviceIndex).  It  is  translated  by  the  S-WdgIf  into  a  S-Wdg  driver
instance. If necessary, additional driver parameters are provided.
Figure 1 shows the layered structure of the  S-WdgM.  The  attached  watchdog  devices
can be internal, external, or both.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary






Safe Watchdog Interface
Page
4
Applications 
Safe Watchdog  
Manager user API 
BSW’s 
System 
 
API 
Safe Watchdog 
Manager 
Safe 
Watchdog 
Safe Watchdog 
Manager 
Interface 
Stack 
Safe 
Safe 
Watchdog 
Watchdog 
Hardware 
Driver 2 
Driver 1 
dependent 
part 
Software  
Hardware 
External 
Internal 
Watchdog 
Watchdog 
device 
device 
 
Fig. 1: Layered structure of the Safe Watchdog M anager 
2.2
Extensions to the AUTOSAR Watchdog Interface
The S-WdgIf implements and extends the  AUTOSAR  Watchdog  Interface  module.  It
implements the following two interfaces to the Watchdog Driver:
AUTOSAR-compatible interface
o Wdg_<infix>_SetTriggerCondition()
o Wdg_<infix>_SetMode()
TTTech-compatible interface
o Wdg_<infix>_SetTriggerWindow()
o Wdg_<infix>_SetMode()
Switching  between the  two  interfaces  with the  watchdog  driver  is  done  by  setting  the
parameter  
6
WdgIfUseAutosarDrvApi
 in  a  correspoding  way.  For  details,  see
section Integration  with  Fully  AUTOSAR  Compliant  Drivers 5  and  the  description  of
parameter  
6
WdgIfUseAutosarDrvApi
 in  section  Configuration  Parameters  for
the S-WdgIf 5 .
Function  WdgIf_GetTickCounter()  is  an  additional  extension  to  AUTOSAR,
providing
 access
 to
 the
 corresponding
 S-Wdg
 function
Wdg_<infix>_GetTickCounter(),  if  supported  by  the  hardware  and  if  the
configuration  parameter  
7
WdgIfInternalTickCounterRef
 is  set  in  a
correspoding
 way.
 For
 details,
 see
 the
 description
 of
 parameter
7
WdgIfInternalTickCounterRef
 in section Configuration Parameters  for  the
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Safe Watchdog Interface
Page
5
S-WdgIf 5 .
2.3
Deviations from the AUTOSAR Watchdog Interface
For safety reasons, the S-WdgIf module should not depend on external modules. This is
why  the  AUTOSAR  module  Development  Error  Tracer  (DET)  is  called  in  the
presence
 of
 development
 errors
 only
 if
 the
 preprocessor
 switch
8
WDGIF_DEV_ERROR_DETECT
  is set to STD_ON.
The  S-WdgIf  calls  function  
15
Appl_Det_ReportError()
 in  order  to  report
detected DET errors instead of calling function  
15
Det_ReportError()
 specified in
AUTOSAR. For details, see section Expected Interfaces 15 .
2.4
Integration with Fully AUTOSAR Compliant Drivers
In order to integrate the S-WdgIf with a fully AUTOSAR-compliant  watchdog  driver  set
the  configuration  parameter
6
 WdgIfUseAutosarDrvApi
 to  STD_ON.  This  will
result in the following:
The AUTOSAR Wdg_<infix>_SetMode() is called out of WdgIf_SetMode().
The
 Wdg_<infix>_SetTriggerCondition()
 is
 called
 out
 of
WdgIf_SetTriggerCondition().
The
 Wdg_<infix>_SetTriggerCondition()
 is
 called
 out
 of
WdgIf_SetTriggerWindow()  as  well,  however,  the  parameter  WindowStart  is
not passed.
Note:
 If
 the
 S-WdgM
 is
 the
 caller
 of
 the
 S-WdgIf
 (i.e.,
 function
WdgIf_SetTriggerWindow()  is  used  to  service  the  watchdog  device),  then  the
parameter WindowStart (WdgMTriggerWindowStart) has  no  effect,  because  it
cannot be passed to an AUTOSAR-compliant driver. It is then good practice to set it to
0, because this would be the functional meaning of its absence.
For more information about the configuration parameter WdgIfUseAutosarDrvApi
6 , see section Configuration Parameters for the S-WdgIf 5 .
2.5
Configuration Parameters for the S-WdgIf
Parameter Name
WdgIfDeviceIndex
Path
WdgIf/WdgIfDevice/WdgIfDeviceIndex
Group
Watchdog device
Type
Integer
Range
0...65535
Compatibility
AUTOSAR
Description
Represents  the  Watchdog  Device  ID  so  that  it  can  be
referenced by the S-WdgM.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Safe Watchdog Interface
Page
6
Parameter Name
WdgIfDriverRef
Path
WdgIf/WdgIfDevice/WdgIfDriverRef
Group
Watchdog device
Type
Reference
Range
n.a.
Compatibility
AUTOSAR
Description
Reference to the Watchdog driver of this Watchdog Device.
Parameter Name
WdgIfDevErrorDetect
Parameter Name
WDGIF_DEV_ERROR_DETECT
(Embedded Code)
Path
WdgIf/WdgIfGeneral/WdgIfDevErrorDetect
Group
Preprocessor
Type
Boolean
Range
false/true
Compatibility
AUTOSAR
Description
Pre-processor  switch  for  enabling  the  development  error
reporting.
Parameter Name
WdgIfVersionInfoApi
Parameter Name
WDGIF_VERSION_INFO_API
(Embedded Code)
Path
WdgIf/WdgIfGeneral/WdgIfVersionInfoApi
Group
Preprocessor
Type
Boolean
Range
false/true
Compatibility
AUTOSAR
Description
Pre-processor switch to enable/disable the service returning
the version information.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Safe Watchdog Interface
Page
7
Parameter Name
WdgIfUseAutosarDrvApi
Parameter Name
WDGIF_USE_AUTOSAR_DRV_API
(Embedded Code)
Path
WdgIf/WdgIfGeneral/WdgIfUseAutosarDrvApi
Group
Preprocessor
Type
Boolean
Range
false/true
Compatibility
TTTech
Description
Pre-processor  switch  to  enable/disable  the  use  of  fully
AUTOSAR-compliant driver API functions.
Parameter Name
WdgIfInternalTickCounterRef
Parameter Name
WDGIF_INTERNAL_TICK_COUNTER
(Embedded Code)
Path
WdgIf/WdgIfGeneral/WdgIfInternalTickCounterRef
Group
Preprocessor
Type
Reference
Range
n.a.
Compatibility
TTTech
Description
If  this  parameter  references  a  driver  which  implements  an
internal
 tick
 counter
 then
 the
 function
 
WdgIf_InternalTickCounter() is compiled and can
be  used  by  the  S-WdgM.  Otherwise  the  API  is  not
compiled. Note:  If a driver is selected, then it  must  support
the
 internal
 tick
 counter,
 and
 its
 parameter
WdgInternalTickCounter must be set to TRUE.
2.6
Configuring the S-WdgIf in the ECU Description File
Apart from the preprocessor options the user must add a WdgIfDevice  container  to
the  S-WdgIf  module  in  the  ECU  description  file.  This  container  has  two  attributes:
WdgIfDeviceIndex  shall  be  set  to  zero,  and  WdgIfDriverRef 6  points  must
be selected so that it points to the Watchdog driver being used.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Safe Watchdog Interface
Page
8
2.7
Preprocessor Options
Option
Description
WDGIF_DEV_ERROR_DETECT
Enables  or  disables  calls  to  DET  in  case  of
development
 errors.
 Corresponds
 to
 ECU
description option 
6
WdgIfDevErrorDetect
.
STD_ON: Development errors are checked and
reported to DET
STD_OFF: Development errors are checked but
not reported to DET
WDGIF_VERSION_INFO_API
Enables the version info API for  compiling  (can be
disabled in order to save resources).  Corresponds
to
 ECU
 description
 option
 
8
WdgIfVersionInfoApi
.
STD_ON: The S-WdgIf API for version information
is provided.
STD_OFF: The S-WdgIf API for version
information is not provided.
WDGIF_INTERNAL_TICK_COUNTER
Enables  or  disables  the  usage  of  an  internal  tick
counter  in  the  S-WdgIf.  Corresponds  to  ECU
description
 option
 
8
WdgIfInternalTickCounterRef
.
 If
 a
driver  is  referenced  the  usage  of  an  internal  tick
counter is enabled, otherwise disabled.
WDGIF_USE_AUTOSAR_DRV_API
Enables  or  disables  the  use  of  fully  AUTOSAR-
compliant driver API functions.
STD_ON:
 AUTOSAR-compliant
 driver
 API
functions  are  used.  Note:  The  parameter
WindowStart
(WdgMTriggerWindowStart) of the  S-WdgM
configuration is then ignored. Therefore, it is good
practice to set it to 0.
STD_OFF:  TTTech driver API functions are used.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary



Safe Watchdog Interface
Page
9
2.8
File Structure
Figure 2 gives an overview of the file structure of the S-WdgIf.
 
Fig. 2: File structure of the S-WdgIf
The  implementation  of  the  S-WdgIf  module  is  in  the  file  WdgIf.c.  File  WdgIf.c
provides  an interface  to  the  upper  layer,  the  S-WdgM,  and  includes  the  header  file  
WdgIf.h.  The  header  files  WdgIf_Types.h  and  Std_Types.h  are  included
indirectly through the WdgIf.h.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Safe Watchdog Interface
Page 10
File
Description
WdgIf_Types.h
S-WdgIf  and  common  Safe  Watchdog  Stack  type
definitions
WdgIf_Cfg.h
Pre-compile time definitions
MemMap.h
Is included directly in the  module  implementation files
to organize code, data and constants in the memory.
Appl_Det.h
Appl_Det.h is included instead of Det.h, because
the  reporting  of  development  errors  is  not  done  by
directly calling  the  DET service  Det_ReportError
15
()
,  but  by  calling  the  user-defined  service  
Appl_Det_ReportError() 15 .
Note:  This  service  could  just  be  a  direct  call  to  the
external  module  DET,  but  could  also  perform  more
complex operations such as switching the  OS  context
before calling DET.
WdgIf_Lcfg.c and 
These files contain the generated configuration.
WdgIf_Lcfg.h
WdgIf_Cfg_Features.h
Is generated and contains all preprocessor options for
the S-WdgIf module.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Safe Watchdog Interface
Page 11
3
API Description
This section describes the types, functions and interfaces that are imported or provided
by the S-WdgIf software layer.
3.1
Type Definitions
This section describes the types of the parameters passed to the API functions of the
S-WdgIf.
Name
WdgIf_InterfaceFunctionsType
Type
Structure
Elements
Std_ReturnType (*
Pointer to the platform-specific SetMode
Wdg_SetMode) (uint8,
function
WdgIf_ModeType)
void (*
Pointer to the platform-specific 
Wdg_SetTriggerWindow)
SetTriggerWindow function
(uint8, uint16, uint16)
Description
Provides pointers to the platform-specific APIs
Name
WdgIf_InterfaceFunctionsPerWdgDeviceType
Type
Structure
Elements
const
Pointers to the platform-specific
WdgIf_InterfaceFunctions
functions
Type* WdgFunctions
const uint8 WdgInstance
Index of the physical watchdog instance
within this platform
Description
Connects platform-dependent functions to a physical watchdog in
order to allow several watchdogs of the same platform to work
simultaneously (e.g., external watchdogs).
Name
WdgIf_InterfaceType
Type
Structure
Elements
const uint8 NumOfWdgs
Number of watchdogs supported in the
S-WdgIf
const
Reference to the functions and physical
WdgIf_InterfaceFunctionsPerW
watchdog indices
dgDeviceType*
WdgFunctionsPerDevice
#if
Function pointer to the 
(WDGIF_INTERNAL_TICK_COUNTER
GetTickCounter driver function if the
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


API Description
Page 12
== STD_ON)
internal tick counter is switched on
uint32 (*Wdg_GetTickCounter)
(void)
#endif
Description
Main S-WdgIf configuration structure.
Name
WdgIf_ModeType
Type
Enumeration
Range
WDGIF_OFF_MODE: Watchdog disabled
WDGIF_SLOW_MODE: Long timeout period (slow
triggering)
WDGIF_FAST_MODE: Short timeout period (fast
triggering)
Description
Mode of the Watchdog
3.2
S-WdgIf Functions
Syntax
Std_ReturnType WdgIf_SetMode
(uint8 DeviceIndex, WdgIf_ModeType Mode)
Service ID
0x01
[hex]
Sync/Async
Synchronous
Reentrant?
No
Parameters
DeviceIndex: Identifies the watchdog instance.
(in)
Mode: One of the following statically configured modes:
o WDGIF_OFF_MODE: Watchdog disabled
o WDGIF_SLOW_MODE: Long timeout period (slow triggering)
o WDGIF_FAST_MODE: Short timeout period (fast triggering)
Parameters
none
(in/out)
Parameters
none
(out)
Return value 
E_OK: API finished successfully.
E_NOT_OK: An error occurred during execution.
Description
This function maps the SetMode service to the corresponding
physical watchdog implementation according to the parameter 
DeviceIndex.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


API Description
Page 13
Syntax
Std_ReturnType WdgIf_SetTriggerCondition
(uint8 DeviceIndex, uint16 Timeout)
Service ID[hex]
0x02
Sync/Async
Synchronous
Reentrant?
No
Parameters (in)
DeviceIndex: Identifies the watchdog instance.
Timeout: Timeout value in milliseconds for setting the trigger
counter.
Parameters
none
(in/out)
Parameters
none
(out)
Return value 
E_OK: API finished successfully.
E_NOT_OK: An error occurred during execution.
Description
This function maps the SetTriggerCondition service to
the corresponding physical watchdog implementation according
to the parameter DeviceIndex.
Syntax
Std_ReturnType WdgIf_SetTriggerWindow
(uint8 DeviceIndex, uint16 WindowStart,
uint16 Timeout)
Service ID[hex]
0x04
Sync/Async
Synchronous
Reentrant?
No
Parameters (in)
DeviceIndex: Identifies the watchdog instance.
WindowStart: Minimum time until next watchdog service is
allowed in milliseconds.
Timeout: Timeout value in milliseconds for setting the trigger
counter.
Parameters
none
(in/out)
Parameters
none
(out)
Return value 
E_OK: API finished successfully.
E_NOT_OK: An error occurred during execution.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


API Description
Page 14
Description
This function maps the SetTriggerWindow service to the
corresponding physical watchdog implementation according to
the parameter DeviceIndex.
Syntax
void WdgIf_GetVersionInfo
(Std_VersionInfoType* VersionInfoPtr)
Service ID[hex] 0x03
Sync/Async
Synchronous
Reentrant?
No
Parameters (in) VersionInfoPtr: Pointer to where to store the version
information of this module.
Parameters
none
(in/out)
Parameters
none
(out)
Return value 
void
Description
This function is implemented as a macro and returns the version
information about this module.  This function is only enabled if the
preprocessor switch WDGIF_VERSION_INFO_API 8  is
STD_ON.
Syntax
uint32 WdgIf_GetTickCounter (void)
Service ID[hex]
none
Sync/Async
Synchronous
Reentrant?
No
Parameters (in)
TickCounter: Pointer to where to store the tick counter
value provided by the driver.
Parameters
none
(in/out)
Parameters
none
(out)
Return value 
The current hardware tick counter of type uint32.
Description
This function returns the current hardware tick counter.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


API Description
Page 15
3.3
Expected Interfaces
This section describes the expected interfaces to external modules used by the S-WdgIf
and their activation conditions.
Function
Description
Appl_Det_ReportError()
If the preprocessor option 
8
WDGIF_DEV_ERROR_DETECT
 is set to
STD_ON, the S-WdgIf references the function 
Appl_Det_ReportError() of the DET
API
.
Note: If the pre-compiler option
WDGIF_DEV_ERROR_DETECT is set to
STD_OFF,  the S-WdgIf is self-contained and
does not call any functions from external
modules.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


API Description
Page 16
4
S-WdgIf Configuration
This section describes the configuration of the S-WdgIf.
4.1
Link Time Configuration
The link time configuration for the S-WdgIf is configured in the ECU description file, e.g.,
by a tool such as DaVinci Configurator Pro . Basically, link time configuration
contains all information needed for mapping each underlying watchdog driver to a
device index. The configuration can be generated by the S-WdgIf configuration
generator
, described in section The S-WdgIf Configuration Generator 16 .
4.2
S-WdgIf Configuration Generator
The S-WdgIf generator is a Microsoft Windows console application that can be
launched from a command prompt window by entering the command
Wdg_If_Cfg_Gen.exe. The S-WdgIf generator reads the S-WdgIf module
information
 from the AUTOSAR ECU description file (*.arxml) and generates
configuration structures for the S-WdgIf. 
Note: Alternatively, you can use the DaVinci Configurator from Vector Informatik
GmbH.
To  use  the  S-Wdg  generator,  enter  the  following  command  in    a  command  prompt
window:
Wdg_If_Cfg_Gen.exe [options] <ECU-DESC-FILE> <OUTPUT-DIR>
<BSWMD_DIR>
[options]
Description
--version
Show the application version number and exits.
-h/--help
Shows this help message and exits.
Parameter
Description
<ECU-DESC-FILE>
The ECU description file (*.arxml). It is generated by
a development tool (e.g.,from the DaVinci tool chain).
<OUTPUT-DIR>
The destination folder for the generated output. You
must specify this parameter.
<BSWMD_DIR>
The directory in which the Configuration Generator
recursively searches for the BSWMD file(s) that
describe the used Watchdog drivers.
The respective configuration for the S-WdgIf is exported to two files:
WdgIf_Lcfg.c
WdgIf_Lcfg.h
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


S-WdgIf Configuration
Page 17
4.3
Error Messages
The generator will show an error message in the command prompt window and quit if
something goes wrong during configuration generation. 
4.3.1
Basic Errors
Error
Error Message
No.
1
Bad call syntax.
2
Cannot open ECU description file `%s`.
3
Cannot convert float parameter `%s/%s` to an Watchdog ticks.
4
Cannot convert `%s` to a numerical value.
5
Fatal error.
6
Method `%s` must be implementd by subclass of `%s`.
7
Missing WdgM data.
4.3.2
Semantic Errors
Error
Error Message
No.
1007
Missing non-zero value for `RTICLK_khz`.
1008
Non-supported platform `%s`.
1009
%s platform: Bad WDGIF_SLOW_MODE configuration: 
InitialTimeout_ms = %d > %d = SlowModeMax_ms.
1010
%s platform: Bad WDGIF_SLOW_MODE configuration: 
InitialWindowStart_ms = %d > %d = SlowModeMax_ms.
1011
%s platform: Bad WDGIF_FAST_MODE configuration: 
InitialTimeout_ms = %d > %d = FastModeMax_ms.
1012
%s platform: Bad WDGIF_FAST_MODE configuration: 
InitialWindowStart_ms = %d > %d = FastModeMax_ms.
1013
%s platform: Bad WDGIF_FAST_MODE configuration: 
InitialWindowStart_ms = %d >= %d = InitialTimeout_ms.
1014
WDGIF_OFF_MODE not supported for %s.
1022
`Wdg/WdgSettingsConfig/WdgRtiKhz` must be a non-zero value.
1023
`Wdg/WdgSettingsConfig/WdgFpiKhz` must be a non-zero value.
1024
Missing or unsupported driver. (Also verify the ECU description 
file's AUTOSAR XML namespace).
1030
`/Wdg/WdgSettingsConfig/fSIRCkhz` must be a non-zero value.
1032
Cannot generate code for unknown driver `%s`. 
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


S-WdgIf Configuration
Page 18
Verify module having `DEFINITION-REF` ending with `.../Wdg`.
1033
Watchdog IF references unknown driver `%s`. 
Verify module reference having a `DEFINITION-REF` ending with 
`...WdgIf/WdgIfDevice/WdgIfDriverRef.
1041
No device found for Watchdog `%s`. Verify elements defined 
by `..WdgIf/WdgIfDevice`.
1042
Device for `%s` platform has no device index. 
Verify elements defined by `.../WdgIfDeviceIndex`.
1046
Error trying to identify the Watchdog's platform
1047
Error trying to generate Wdg_MemMap.h.
1067
No default `WdgDefaultMode` defined.
1074
The specified ticks per second value for the used WdgMmode
(%d Hz) and the RTI clock frequency (%d Hz) must satisfy
the following condition: 0 < ticks_per_second <= rti_hz / 2.
1077
The `MPC5643L_MC33904` platform requires `WdgInitialTimeout`
= 12 [ms].
1078
The `MPC5643L_MC33904` platform requires `WdgWindowStart`
= 6 [ms].
1079
One of the WdgMTrigger elements associated with WdgMWatchdog
`%s` has a WdgMTriggerConditionValue value which does not 
match the WdgInitialTimeout (%d ms) defined for the `%s` driver.
1080
One of the WdgMTrigger elements associated with WdgMWatchdog
`%s` has a WdgMTriggerWindowStart value which does not 
match the `WdgWindowStart` (%d ms) defined for the `%s` driver.
1087
There are more than 1 watchdogs with an internal tick counter
(%s)
1088
`%s` has an active internal tick counter but the Watchdog
Interface 
does not reference it via `WdgIfInternalTickCounterRef`.
1089
The driver (`%s`) referenced by the Watchdog Interface via 
`WdgIfInternalTickCounterRef` has no active internal tick
counter.
1117
`/Wdg/WdgSettingsConfig/SysClkKhz` must be a non-zero value.
1118
MPC56xx: using an internal tick counter requires configuring
`STMdebugModeControl`.
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


S-WdgIf Configuration
Page 19
5
Abbreviations
Abbreviation 
Description
API
Application Programming Interface
AUTOSAR
AUTOSAR  (AUTomotive  Open  System  ARchitecture)  is  a
worldwide  development  partnership  of  car  manufacturers,
suppliers  and  other  companies  from  the
 electronics,
semiconductor and software industry.
DEM
Diagnostic Event Manager
DET
Development Error Tracer 
ECU
Electronic Control Unit
MCU
Microcontroller Unit 
S-Wdg
Safe Watchdog Driver (implementation by TTTech)
S-WdgIf
Safe Watchdog Interface (implementation by TTTech)
S-WdgM
Safe Watchdog Manager (implementation by TTTech)
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary


Abbreviations
Page 20
6
References
[1]
AUTOSAR, Specification of Watchdog Interface. V. 2.2.2, Rel. 3.1, Rev. 1
[2]
AUTOSAR, Specification of Watchdog Interface. V. 2.3.0, Rel. 4.0, Rev. 1
[3]
TTTech Automotive GmbH, Safe Watchdog Manager, Safety Manual, V. 2.0.2
[4]
TTTech Automotive GmbH, Safe Watchdog Manager, User Manual, V. 1.8.0
[5]
TTTech Automotive GmbH, Safe Watchdog Interface, Safety Manual, V. 1.8.0
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary

Index
Safe Watchdog Interface
Page 21
Index
- M -
MemMap.h     10
- A -
- P -
Abbreviations     19
API Description     11
Preprocessor Options     8
Appl_Det.h     10
Appl_Det_ReportError     10
- S -
Appl_Det_ReportError()     15
- B -
Safe Watchdog Interface     3
Std_Types.h     9
S-WdgIf Configuration     16
Basic Functionality of the S-WdgIf     3
S-WdgIf Configuration Generator     16
S-WdgIf Functions     12
- C -
- T -
Configuration Parameters for the S-WdgIf     5
Type Definitions     11
- D -
- W -
Det_ReportError     10
Det_ReportError()     15
WdgIf.c.     9
Deviations from the AUTOSAR Watchdog Interface    
WdgIf.h     9
5
WdgIf_Cfg.h     10
WdgIf_Cfg_Features.h     10, 11
- E -
WDGIF_DEV_ERROR_DETECT     6, 8, 15
WdgIf_GetTickCounter     5
ECU Description Configuration     7
WdgIf_GetTickCounter()     14
Error messages    
WdgIf_GetVersionInfo()     14
basic errors     17
WdgIf_InterfaceFunctionsPerWdgDeviceType     11
semantic errors     17
WdgIf_InterfaceType     11
Expected Interfaces     15
WDGIF_INTERNAL_TICK_COUNTER     7, 8
WdgIf_InternalTickCounter()     7
- F -
WdgIf_Lcfg.c     10
WdgIf_Lcfg.h     10
WdgIf_ModeType     12
File Structure     9
WdgIf_SetMode()     12
- I -
WdgIf_SetTriggerCondition()     13
WdgIf_SetTriggerWindow()     13
WdgIf_Types.h     10
Introduction     3
WDGIF_USE_AUTOSAR_DRV_API     7, 8
WDGIF_VERSION_INFO_API     6, 8
- L -
WdgIfDevErrorDetect     6, 8
WdgIfDriverRef     6, 7
Link Time Configuration     16
WdgIfInternalTickCounterRef     7, 8
WdgIfVersionInfoApi     6, 8
Safe Watchdog Interface 1.9.4
© 2011 - 2014 TTTech Automotive GmbH
Document number: D-MSP-M-70-006
TTTech Automotive Confidential and Proprietary

Document Outline


Last modified October 12, 2025: Initial commit (1fadfc4)