Autosar Wdg总结

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

 

 Wdg_ChannelSetTriggerCondition函数根据u16Timeout值,计算出了 Wdg_Timeout 值, timeout值还包含了 uElapsedTime

Wdg_ChannelSetMode函数将Wdg_Timeout给减去了一个uElapsedTime
 
我认为 Wdg_ChannelSetTriggerCondition() 函数要在 Wdg_ChannelSetMode() 函数之前执行。

 所以,我推测,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.保护全局数组

 

 

posted @ 2021-09-22 16:23  昆山皮皮虾  阅读(1411)  评论(0编辑  收藏  举报