After reading this article you will understand :
- Layered watchdog stack in Autosar
- Basic functionality of each module of WDG stack.
1. Layered Watchdog Stack :
|Fig.1 AUTOSAR Watchdog Stack|
Fig.1 Shows watchdog stack in AUTOSAR. Watchdog stack divided into 3 layers.
Service Layer : Watchdog Manager (WdgM)
ECU abstraction layer : Watchdog Interface (WdgIf)
MCAL Layer : Watchdog Driver. (WDG)
Software components will use service port provided by watchdog manager and communicate with WdgM by client server interface through RTE.
WdgM connected to WdgIf and WdgIf connected to WDG, this is how Watchdog stack control flow happens. Lets see functionality of each module in briefly.
2. Functionalities :
2.1 Watchdog Manager :
Watchdog manager, present at service layer of AUTOSAR stack. Watchdog manager is near to RTE.
For software components to use Watchdog services. it can be done by communicating with watchdog manager only.
Functionalities of watchdog manager :
1. Supervising the software, using supervision function.
2. If result of supervision of SW is OK then update triggering condition by calling WdgIf_SetTriggerCondition function.
If supervision of SW is wrong then WdgM will not update triggering condition and this will leads to reset of SW due to Watchdog reset.
3. To provide functionalities to Software components by using service ports.
2.2 Watchdog Interface :
Watchdog interface present at ECU abstraction layer. Job of watchdog interface layer is to pass commands/data/call flow from watchdog manager to underlying watchdog driver.
There could be multiple watchdog driver present in system (internal or external).
Job of WdgIf is to route the request from WdgM to respective WDG driver unit.
2.3 Watchdog Driver :
Watchdog driver resides in MCAL layer of AUTOSAR. This module is responsible for direct hardware access.
Watchdog driver can be internal or external. Internal Watchdog is present inside controller. External watchdog is external to microcontroller, i.e. separate chip's watchdog is used (SBC). SBC watchdog can be controlled using SPI/I2C driver. as shown in figure 1.
Main function of watchdog driver is to kick/trigger the HW watchdog unit based on triggering condition set by WdgM module.
WDG driver modules job is to configure HW watchdog by writing values into HW resistors i.e. initialization of WDG and changing the mode of watchdog(fast/slow/off).
WDG driver provides functionality to window watchdog.
For more details of each module please read below blogs :