AUTOSAR看门狗篇 -看门狗驱动(Wdg)

本文介绍了AUTOSAR中的看门狗驱动,包括内部和外部驱动的区别,以及Wdg模块的功能和操作模式。内部看门狗驱动直接访问硬件,而外部驱动需要通过其他MCAL或BSW模块。Wdg模块提供了初始化、设置模式和触发条件的接口,并支持窗口看门狗的概念。重点讨论了不同模式和触发条件的设置及其对系统的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


1.简介
本文档介绍AUTOSAR基础软件中的看门狗驱动模块(WdgDriver,Wdg)。Wdg模块提供初始化,改变运行模式和设置触发条件(超时)的服务。
功能性的要求和功能范围对于内部看门狗驱动和外部看门狗驱动是一样的,因此API在语义上是完全一致的。

内部看门狗驱动属于微控制器抽象层(Microcontroller Abstraction Layer,MCAL),而外部看门狗驱动属于板载设备抽象层(Onboard Device Abstraction Layer)。因此,外部看门狗驱动需要其他(MCAL中的)驱动才可以访问微控制器硬件。

内部(片内)看门狗的Wdg模块可直接访问微控制器硬件,位于微控制器抽象层中;外部看门狗的Wdg模块需要使用其他模块(如,SPI)才可以访问外部看门狗设备。这种Wdg模块是位于板载设备抽象层中。外部看门狗驱动器的Wdg模块应具有独立于微控制器平台的源代码。

为了能理解本文后续介绍,这里定义了如下三个概念:

  • Off-Mode ,代表看门狗硬件禁止/关闭。为了关闭整个ECU和不让依旧运行的外部看门狗发生周期复位,需要改定义。但是在功能安全现有要求的系统中是不允许此状态的,在这种情况下,Wdg模块必须配置为避免进入此模式。
  • Slow-Mode,代表看门狗硬件使用较长时间的超时周期。该模式可用在系统启动/初始化阶段。如看门狗硬件配置为toggle模式(对触发的时间点没有限制),且超时周期为20毫秒。
  • Fast-Mode,代表看门狗使用短时间的超时周期。该模式可用于ECU正常运行过程中。如看门狗硬件配置为窗口模式(必须在超时周期内的某个最小/最大边界内触发看门狗),
### Autosar Watchdog Implementation in Application Layer In the context of AUTOSAR (Automotive Open System Architecture), ensuring system reliability and safety is paramount, especially through mechanisms like a watchdog timer. The real-time operating environment plays an essential role by providing necessary resources to higher layers while abstracting lower-level details[^1]. For implementing or configuring a watchdog within the application layer: The watchdog functionality typically resides at lower levels; however, applications can interact with it via standardized interfaces provided by AUTOSAR modules such as RTE (Run-Time Environment). Developers configure these interactions during development using configuration tools that generate code adhering to specified parameters. Application-layer interaction involves calling specific API functions defined under BSW (Basic Software Module) services for managing watchdog behavior without directly manipulating hardware registers. This abstraction ensures portability across different ECU platforms while maintaining compliance with automotive standards. For practical implementation: ```c // Example C function demonstrating how an application might trigger a watchdog reset request. void App_TriggerWatchdogReset(void){ // Call service routine from Basic Software Modules to signal a need for resetting the watchdog counter. Wdg_Mngt_RequestReset(WDG_ID); } ``` Configuration aspects are handled outside source files through ARXML descriptions which define timing constraints, monitoring conditions, etc., thus separating concerns between coding logic and system setup requirements. --related questions-- 1. How does one set up timing parameters for watchdog management in AUTOSAR? 2. What are common pitfalls when integrating watchdog features into existing embedded systems following AUTOSAR guidelines? 3. Can you explain more about the separation achieved by runtime environments concerning watchdog implementations? 4. In what scenarios would direct manipulation of watchdog timers be preferred over utilizing AUTOSAR's abstractions?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汽车电子开发攻城狮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值