Autosar Wdg总结
1. 个人认为要想理解Autosar WDG代码,需要特别注意如下两个全局静态变量的改变:

Wdg_ChannelSetTriggerCondition函数根据u16Timeout值,计算出了 Wdg_Timeout 值, timeout值还包含了 uElapsedTime
所以,我推测,Wdg的函数使用顺序如下绿色箭头标记。

2. Wdg_Wdog_Init函数

3.读写寄存器


4. Wdg_SetMode函数里需要重新计算timeout frame
依据如下:

而且S32K 的Mcal中,该函数也确实做到了要求:

5. Mcal里面的trigger wdg实际就是refresh wdg的意思,刷新看门狗。
6. Watchdog stack overview

7. Multi-core watchdog stack overview

8. Watchdog Manager overview

9. WDGIF_SLOW_MODE
In this mode, the watchdog driver is set up for a long timeout period (slow triggering).
10. WdgIf_SetMode
This function provides access to the mode switching services of the underlying watchdog drivers. The function is mapped to the service Wdg_SetMode().
11. Wdog_Ip_Init()返回WDOG_IP_STATUS_ERROR
代表操作失败。可能原因有:WDOG configuration updates are not allowed; If window mode enabled and window value greater than or equal to the timeout value.
12.保护全局数组


浙公网安备 33010602011771号