DEENESPTFRRUARHIKOZHNL

ECU State Manager (EcuM)

ModulEcuM (ECU State Manager)
BSW-Modul-ID10
Standard-Header#include "EcuM.h"
SWS-SpezifikationAUTOSAR_SWS_ECUStateManager.pdf
ClusterSystem Services

模块指南人工智能生成

与 BswM 协同控制 ECU 的启动、关断、休眠阶段及唤醒源。
AI 生成 未审核 模型: claude-opus-5-5 · 推理强度: high · 温度: 不可控 · 提示词: c4073030eea4 来源 未决问题(1)
因果锚点:R20-11 自 R20-11 起有效 为此规范版本重新合成。
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

与 BswM 协同控制 ECU 的启动、关断、休眠阶段及唤醒源。

ECU State Manager 控制 Classic ECU 的生命周期。它初始化基础软件直至 OS 启动,引导 ECU 进入关断目标 SLEEP、RESET 或 OFF,并管理唤醒源及其校验 [SWS_EcuM_04136]。硬件相关步骤由集成代码通过 callout 承担。EcuM 仲裁用户的 RUN 和 POST_RUN 请求,但状态转换由 BswM 决定并通过 EcuM_SetState 反馈 [SWS_EcuM_04116]。最重要的边界条件是在 SLEEP 阶段绝不能丢失任何唤醒事件。

ECU State Manager(EcuM)在 Classic Platform 中负责 ECU 的启动、关断和休眠阶段。EcuM_Init 执行包含初始化块 0 和 1 的 StartPreOS 序列。在此过程中,EcuM 选择并检查 Post-Build 配置,最终调用 StartOS。随后 EcuM_StartupTwo 启动 SchM 和 BswM [SWS_EcuM_02684] [SWS_EcuM_02906] [SWS_EcuM_02932]。底层硬件步骤由集成代码作为 callout 提供,例如 EcuM_AL_DriverInitZero [SWS_EcuM_02905]。

phasen start Power On / Reset STARTUP STARTUP (StartPreOS, StartPostOS) start->STARTUP UP UP (RUN / POST_RUN, optional) STARTUP->UP EcuM_StartupTwo, BswM 接管 SHUTDOWN SHUTDOWN (OffPreOS, OffPostOS) UP->SHUTDOWN 目标 RESET 或 OFF SLEEP SLEEP (GoSleep、Halt 或 Poll) UP->SLEEP Ziel SLEEP, EcuM_GoDownHaltPoll OFF OFF SHUTDOWN->OFF EcuM_AL_SwitchOff RESET RESET SHUTDOWN->RESET EcuM_AL_Reset SLEEP->STARTUP Hardware-Reset / Power-Cycle SLEEP->UP Weckereignis: WakeupRestart RESET->STARTUP Neustart

状态图:ECU 依次经历 STARTUP、UP、SHUTDOWN 和 SLEEP。从 SLEEP 经由 WakeupRestart 返回 UP。来源:RS ModeManagement 第15页、[SWS_EcuM_91005]、[SWS_EcuM_02963]

EcuM 自身并不决定状态转换。它收集已配置用户的 RUN 和 POST_RUN 请求,并将结果报告给 BswM。它通过 EcuM_SetState 接收 BswM 的状态转换,并将其转发给 RTE [SWS_EcuM_04144] [SWS_EcuM_04117] [SWS_EcuM_04116] SWS EcuM 第103页。EcuM_SelectShutdownTarget 仅将目标 SLEEP、RESET 或 OFF 保存以备后用 [SWS_EcuM_02585]。在关断时,OffPreOS 反初始化 BswM 和 SchM,检查唤醒事件并终止 OS。关断钩子随后调用 EcuM_Shutdown,该函数以 EcuM_AL_Reset 或 EcuM_AL_SwitchOff 结束 [SWS_EcuM_03021] [SWS_EcuM_04074] [SWS_EcuM_04075]。

SLEEP 阶段以 EcuM_GoDownHaltPoll 开始。首先,GoSleep 激活休眠模式的唤醒源。随后要么执行带 RAM 哈希检查的 Halt,要么执行通过 EcuM_SleepActivity 和 EcuM_CheckWakeup 轮询的循环。最后通过 EcuM_AL_DriverRestart [SWS_EcuM_91002] [SWS_EcuM_02389] [SWS_EcuM_02863] [SWS_EcuM_03020] [SWS_EcuM_02963] 进行 WakeupRestart。在此阶段绝不能丢失任何唤醒事件 [SWS_EcuM_02188]。

唤醒源是 EcuM_WakeupSourceType 中的单个位,且各自处于 NONE、PENDING、VALIDATED 或 EXPIRED 状态之一 [SWS_EcuM_04040] [SWS_EcuM_04091]。驱动程序使用 EcuM_SetWakeupEvent 报告事件。若配置了校验,EcuM 将启动超时。只有在超时到期前发生 EcuM_ValidateWakeupEvent 才会进入 VALIDATED;若配置了通道关联,届时还会通知 ComM。否则该源将变为 EXPIRED [SWS_EcuM_02709] [SWS_EcuM_02645] [SWS_EcuM_04082]。

validierung a Treiber erkennt Weckereignis: EcuM_SetWakeupEvent(sources) b 源是否属于 所选的睡眠模式? a->b x Ereignis ignorieren b->x 不 c Validierung konfiguriert? (EcuMValidationTimeout) b->c 是 e Bits in Pending-Variable setzen, quellenspezifischen Timeout starten c->e 是 h Timeout stoppen, Validated-Bits setzen, BswM_EcuM_CurrentWakeup(VALIDATED), ComM_EcuM_WakeUpIndication / PNCWakeUpIndication (falls Kanal/PNC konfiguriert) c->h nein: impliziter EcuM_ValidateWakeupEvent f EcuM_MainFunction: EcuM_CheckValidation(wakeupSource) e->f g EcuM_ValidateWakeupEvent eingetroffen? f->g g->h 是 i Timeout abgelaufen? g->i 不 i->f 不 j Expired-Bit setzen, BswM_EcuM_CurrentWakeup(EXPIRED), EcuM_StopWakeupSources() i->j 是

活动图:唤醒事件立即得到校验,或者保持 PENDING,直到确认到达或超时到期。来源:SWS EcuM 第63页、[SWS_EcuM_02566]、[SWS_EcuM_04082]

在发生错误时,若配置不一致或 RAM 校验失败,EcuM 会调用 callout EcuM_ErrorHook [SWS_EcuM_04033] [SWS_EcuM_91003]。它向 DET 报告开发错误,如重复请求或未知唤醒源 [SWS_EcuM_03024] [SWS_EcuM_02867]。

ECU State Manager 的角色与系统边界

ECU State Manager(EcuM)在 Classic Platform 中规定了 ECU 生命周期的框架。它初始化基础软件直至操作系统启动。随后,它以受控方式引导 ECU 进入关断目标 SLEEP、RESET 或 OFF 之一 [SWS_EcuM_04136]。它的状态由 EcuM_StateType 确定:STARTUP、RUN、POST_RUN、SHUTDOWN 和 SLEEP [SWS_EcuM_91005]。它通过模式声明组 EcuM_Mode 向 SW-C 报告这些状态,该组的初始模式为 STARTUP [SWS_EcuM_04107] [SWS_EcuM_04132]。

phasen start Power On / Reset STARTUP STARTUP (StartPreOS, StartPostOS) start->STARTUP UP UP (RUN / POST_RUN, optional) STARTUP->UP EcuM_StartupTwo, BswM 接管 SHUTDOWN SHUTDOWN (OffPreOS, OffPostOS) UP->SHUTDOWN 目标 RESET 或 OFF SLEEP SLEEP (GoSleep、Halt 或 Poll) UP->SLEEP Ziel SLEEP, EcuM_GoDownHaltPoll OFF OFF SHUTDOWN->OFF EcuM_AL_SwitchOff RESET RESET SHUTDOWN->RESET EcuM_AL_Reset SLEEP->STARTUP Hardware-Reset / Power-Cycle SLEEP->UP Weckereignis: WakeupRestart RESET->STARTUP Neustart

状态图:ECU 依次经历 STARTUP、UP、SHUTDOWN 和 SLEEP。从 SLEEP 经由 WakeupRestart 返回 UP,在硬件复位或上电周期后在 STARTUP 中重新启动。来源:RS ModeManagement 第15页、[SWS_EcuM_91005]、[SWS_EcuM_02963]、[SWS_EcuM_04001]

状态转换并非由 EcuM 自身决定。它没有自己的状态机,仅对请求进行仲裁,并将转换交由 BSW Mode Manager(BswM)处理 SWS EcuM 第103页。它将硬件相关和项目特定的步骤外包给集成代码的 callout,这些 callout 通过 EcuM_Externals.h 提供。示例包括 EcuM_AL_DriverInitZero 和 EcuM_AL_SwitchOff [SWS_EcuM_02905] [SWS_EcuM_02920]。相邻模块的接口列在导入函数表中,例如 BswM_EcuM_CurrentWakeup、Can_Init 和 Det_ReportError [SWS_EcuM_02858] [SWS_EcuM_02859]。

kontext EcuM EcuM SWC SW-C (通过 RTE 端口) EcuM->SWC currentMode (EcuM_Mode) BswM BswM EcuM->BswM BswM_Init / BswM_Deinit, BswM_EcuM_CurrentWakeup, RequestedState, CurrentState IC Integration Code (Callouts in EcuM_Externals.h) EcuM->IC EcuM_AL_DriverInit*, EcuM_AL_DriverRestart, EcuM_AL_Reset, EcuM_AL_SwitchOff, EcuM_*WakeupSources Os Os EcuM->Os StartOS, ShutdownOS, GetResource Mcu Mcu EcuM->Mcu Mcu_GetResetReason, Mcu_SetMode SchM SchM EcuM->SchM SchM_Init / Start / Deinit ComM ComM EcuM->ComM ComM_EcuM_WakeUpIndication, ComM_EcuM_PNCWakeUpIndication Det Det EcuM->Det Det_ReportError SWC->EcuM RequestRUN / ReleaseRUN, SelectShutdownTarget, AlarmClock, BootTarget BswM->EcuM EcuM_SetState, EcuM_SelectShutdownTarget, EcuM_GoDownHaltPoll Os->EcuM EcuM_Shutdown (Shutdown-Hook) Drv 带唤醒源的驱动程序 (例如 CanTrcv、Icu、Gpt) Drv->EcuM EcuM_SetWakeupEvent, EcuM_ValidateWakeupEvent

上下文图:EcuM 位于 SW-C、BswM、集成代码、OS、MCAL 驱动程序与 ComM 之间。BswM 决定状态转换,硬件步骤由集成代码执行。来源:SWS EcuM 第34页、[SWS_EcuM_02858]、[SWS_EcuM_04135]

启动:StartPreOS、StartPostOS 与配置数据

在 EcuM_Init 之前,EcuM 仅要求进行最小程度的 MCU 初始化:已设置堆栈且 C 变量已初始化 SWS EcuM 第39页。EcuM_Init 执行 StartPreOS 序列且不返回,因为它会调用 StartOS [SWS_EcuM_02811] [SWS_EcuM_02684]。在此过程中,将初始化 OS 启动所需的所有模块 [SWS_EcuM_02603]。

Init Block 0(EcuM_AL_DriverInitZero)为加载 Post-Build 数据做准备。因此,它仅允许使用在预编译或链接时配置的模块 [SWS_EcuM_02905]。随后 EcuM_DeterminePbConfiguration 提供指向 EcuM_ConfigType 的指针。该结构体引用所有其他 BSW 模块的配置 [SWS_EcuM_02906] [SWS_EcuM_02801]。它包含变体标识符和哈希值。在初始化第一个 Post-Build 可配置模块之前,EcuM 针对所有此类模块对照 ECUM_CONFIGCONSISTENCY_HASH 校验该哈希值 [SWS_EcuM_02794] [SWS_EcuM_02798] [SWS_EcuM_02796]。

Init Block 1(EcuM_AL_DriverInitOne)在上电复位后初始化驱动程序,其中包括 MCU [SWS_EcuM_02907] SWS EcuM 第146页。两个块中的顺序由 EcuMDriverInitListZero 和 EcuMDriverInitListOne 确定。每个初始化函数均从其对应的 EcuMModuleService 容器获取参数 [SWS_EcuM_02559] [SWS_EcuM_02730]。EcuM 将 Mcu 驱动程序的复位原因转换为唤醒源并予以记录。若无法确定原因,则设置 ECUM_WKSOURCE_RESET [SWS_EcuM_02623] [SWS_EcuM_02601]。若置位了 EcuMResetLoopDetection,EcuM 会在每次启动时调用 callout EcuM_LoopDetection [SWS_EcuM_04137]。

启动流程:StartPreOS 和 StartPostOSBootloaderEcuMIntegration CodeMcuOsSchMBswMUse Case: StartPreOS (EcuM_Init)EcuM_Init()EcuM_AL_DriverInitZero()EcuM_DeterminePbConfiguration()const EcuM_ConfigType*检查配置数据的一致性optKonfigurationsdaten inkonsistentEcuM_ErrorHook(ECUM_E_CONFIGURATION_DATA_INCONSISTENT)EcuM_AL_DriverInitOne()Mcu_GetResetReason()将复位原因映射至唤醒源StartOS(ECUM_DEFAULT_APP_MODE)Use Case: StartPostOS (EcuM_StartupTwo)EcuM_StartupTwo()(在 StartOS 之后的任务中)SchM_Init / SchM_Start / SchM_StartTimingBswM_Init()

时序图:EcuM_Init 依次经历 Init Block 0、配置的选择与检查、Init Block 1 以及复位评估,直到 StartOS。随后 EcuM_StartupTwo 启动 SchM 和 BswM。来源:SWS EcuM 第38页、SWS EcuM 第78页、[SWS_EcuM_02684]、[SWS_EcuM_02932]

OS 启动后,紧接着由 StartOS 启动的任务调用 EcuM_StartupTwo [SWS_EcuM_02806]。该函数执行 StartPostOS:它初始化并启动 SchM,并调用 BswM_Init [SWS_EcuM_02932] SWS EcuM 第42页。进一步的初始化由 BswM 通过生成的函数 EcuM_AL_DriverInitBswM_<x> [SWS_EcuM_04114] 承担。

在多核 ECU 上,每个核运行一个 EcuM 实例,主 EcuM 启动其余核。Init Block 0 和 1 在每个核上运行,但仅在相应核上初始化其 MCAL 模块。SchM、OS 和所有核本地 BswM 均在每个核上启动 [SWS_EcuM_04145] [SWS_EcuM_04093] [SWS_EcuM_04014] SWS EcuM 第71页。

RUN 和 POST_RUN:用户请求与同 BswM 的仲裁

若 EcuMModeHandling 处于激活状态,用户可以请求并重新释放 RUN 和 POST_RUN [SWS_EcuM_04115] [SWS_EcuM_04130]。为此使用 EcuM_RequestRUN、EcuM_ReleaseRUN、EcuM_RequestPOST_RUN 和 EcuM_ReleasePOST_RUN。所有这四个函数都需要类型为 EcuM_UserType 的已配置用户标识符 [SWS_EcuM_04124] [SWS_EcuM_04127] [SWS_EcuM_04128] [SWS_EcuM_04129]。EcuM 按用户跟踪请求,且单个用户无法对其进行嵌套。它在不同变量中分别维护 RUN 和 POST_RUN 请求 [SWS_EcuM_04126] [SWS_EcuM_04125] SWS EcuM 第116页。SW-C 通过端口 StateRequest_{UserName} 访问这些服务 [SWS_EcuM_04135]。

EcuM 使用 BswM_EcuM_RequestedState(ECUM_STATE_APP_RUN, ECUM_RUNSTATUS_REQUESTED) 向 BswM 报告首次 RUN 或 POST_RUN 请求。在最后一次释放 RUN 或 POST_RUN 时,它报告相应状态及 ECUM_RUNSTATUS_RELEASED [SWS_EcuM_04144] [SWS_EcuM_04117] [SWS_EcuM_04119]。BswM 评估其规则并使用 EcuM_SetState 设置新状态。EcuM 随后向 RTE 指示匹配的模式,并在收到其反馈后报告 BswM_EcuM_CurrentState [SWS_EcuM_04122] [SWS_EcuM_04116] [SWS_EcuM_04143]。模式管理指南展示了相应的 BswM 规则,例如一旦释放 RUN 就切换到 POST_RUN Mode-Management-Guide 第34页。

RUN/POST_RUN 在 EcuM 和 BswM 之间的仲裁SW-C (EcuM-Nutzer)RTEEcuMBswMUse Case: AnforderungEcuM_RequestRUN(user)通过端口 StateRequest_{UserName}E_OK首个 RUN 或 POST_RUN 请求BswM_EcuM_RequestedState(ECUM_STATE_APP_RUN, ECUM_RUNSTATUS_REQUESTED)规则评估决定状态迁移EcuM_SetState(state)Rte_Switch_currentMode_currentMode(mode)通过确认端口反馈BswM_EcuM_CurrentState(state)Use Case: 发布EcuM_ReleaseRUN(user)letzte RUN-Anforderung freigegebenBswM_EcuM_RequestedState(ECUM_STATE_APP_RUN, ECUM_RUNSTATUS_RELEASED)EcuM_SetState(state)例如切换至 POST_RUN

时序图:EcuM 仲裁用户的请求并将结果报告给 BswM。BswM 通过 EcuM_SetState 返回状态,EcuM 将其传递给 RTE。来源:[SWS_EcuM_04144]、[SWS_EcuM_04117]、[SWS_EcuM_04116]、[SWS_EcuM_04143]

关断目标以及通过 OffPreOS 和 OffPostOS 进行关断

EcuM_SelectShutdownTarget 仅将目标和模式保存用于随后的 SHUTDOWN 或 SLEEP 阶段,自身不触发任何操作 [SWS_EcuM_02822] [SWS_EcuM_00624] [SWS_EcuM_02585]。模式参数在目标为 SLEEP 时选择已配置的休眠模式,在目标为 RESET 时选择复位模式。当目标为 OFF 时该参数被忽略 [SWS_EcuM_02979] [SWS_EcuM_02185]。复位模式至少包括 Mcu_PerformReset、WdgM_PerformReset 以及切换 I/O 引脚 [SWS_EcuM_04005] [SWS_EcuM_04044]。关断原因通过 EcuM_SelectShutdownCause 记录 [SWS_EcuM_04007] [SWS_EcuM_04050]。EcuM_GetLastShutdownTarget 返回最近从中唤醒或启动的目标。该值在下一次关断前保持不变 [SWS_EcuM_02156]。

SHUTDOWN 阶段以 OFF 或 RESET 结束 [SWS_EcuM_03022]。何时设置该目标通常由 BswM 决定 SWS EcuM 第66页。在 OffPreOS 中反初始化 BswM 和 SchM 并检查唤醒事件。若有待处理事件,则将 RESET 设为目标。最后一个动作是 ShutdownOS [SWS_EcuM_03021] [SWS_EcuM_02952] SWS EcuM 第49页。

随后关断钩子调用 EcuM_Shutdown,该函数不返回。在 EcuM_OnGoOffTwo 之后,对于目标 RESET 执行 EcuM_AL_Reset,对于目标 OFF 执行 EcuM_AL_SwitchOff [SWS_EcuM_02953] [SWS_EcuM_02917] [SWS_EcuM_04074] [SWS_EcuM_04075]。解读:对于 RESET 和 OFF,BswM 大概率也是通过 EcuM_GoDownHaltPoll 触发该阶段,因为其返回值描述根据关断目标进行了区分 [SWS_EcuM_91002]。 问题 Q-29bca5a7c6e82c98 (未决)

通过 OffPreOS 和 OffPostOS 关闭BswMEcuMSchMOsIntegration CodeEcuM_SelectShutdownTarget(target, mode)E_OKEcuM_GoDownHaltPoll(UserID)理解:在 RESET/OFF 时也是触发条件Use Case: OffPreOSBswM_Deinit()SchM_Deinit()检查唤醒事件(挂起或已校验,取决于 EcuMIgnoreWakeupEvValOffPreOS)optWeckereignisse anstehendShutdown-Ziel RESET setzen(EcuMDefaultResetModeRef)ShutdownOS()Use Case: OffPostOSEcuM_Shutdown()来自关闭钩子函数EcuM_OnGoOffTwo()altShutdown-Ziel RESETEcuM_AL_Reset(EcuM_ResetType)Shutdown-Ziel OFFEcuM_AL_SwitchOff()

时序图:OffPreOS 反初始化 BswM 和 SchM,检查唤醒事件并终止 OS。随后 OffPostOS 根据关断目标分支到复位或关断。来源:SWS EcuM 第49页、SWS EcuM 第49页、[SWS_EcuM_02953]、[SWS_EcuM_91002]

SLEEP 阶段:GoSleep、Halt 或 Poll 以及 WakeupRestart

若选择 SLEEP 作为目标,EcuM_GoDownHaltPoll 将启动 SLEEP 阶段。调用者必须预先设置匹配的目标 [SWS_EcuM_91002] SWS EcuM 第54页。在 GoSleep 中,EcuM 通过 EcuM_EnableWakeupSources 激活目标休眠模式下 EcuMWakeupSourceMask 中的所有唤醒源。在多核 ECU 上,它还会额外占用核专属资源 RES_AUTOSAR_ECUM。与关断不同,OS 保持活动状态 [SWS_EcuM_02389] [SWS_EcuM_03010] [SWS_EcuM_02951]。绝不能丢失任何唤醒事件。若在 GoSleep 期间已发生唤醒事件,则跳过 Halt 和 Poll [SWS_EcuM_02188]。

使微控制器停止的休眠模式经历 Halt 序列。在此之前 EcuM 调用 EcuM_GenerateRamHash,之后调用 EcuM_CheckRamHash [SWS_EcuM_02960] [SWS_EcuM_02863]。相反,采用降低时钟频率的休眠模式则使用 Poll 序列。该序列在阻塞循环中调用 EcuM_SleepActivity 和 EcuM_CheckWakeup,直到事件被报告为 pending 或已校验 [SWS_EcuM_02962] [SWS_EcuM_03020]。在 R20-11 中,EcuM_CheckWakeup 仍为一个 callout。自 R21-11 起,该 callout 才被称为 EcuM_CheckWakeupHook [SWS_EcuM_02929] SWS EcuM 第145页。

唤醒事件将进入 WakeupRestart 序列 [SWS_EcuM_02963] SWS EcuM 第56页:

  1. MCU 返回正常模式。
  2. EcuM_DisableWakeupSources 停用当前待处理的唤醒源;所有其他唤醒源保持就绪 [SWS_EcuM_02922]。
  3. EcuM_AL_DriverRestart 重新初始化受影响的驱动程序 [SWS_EcuM_02923]。
  4. 调度器被重新释放。

相反,若在休眠期间发生硬件复位或上电周期,ECU 将在 STARTUP 中重新开始 [SWS_EcuM_04001]。

SLEEP 阶段:GoSleep、Halt 或 Poll、WakeupRestartBswMEcuMIntegration CodeOsMcuWeckquelle (Treiber)EcuM_SelectShutdownTarget(SLEEP, Schlafmodus)EcuM_GoDownHaltPoll(UserID)Use Case: GoSleepEcuM_EnableWakeupSources(睡眠模式的 EcuMWakeupSourceMask)BswM_EcuM_CurrentWakeup(sources, ECUM_WKSTATUS_NONE)GetResource(RES_AUTOSAR_ECUM_<core#>)alt睡眠模式停止微控制器(Halt)EcuM_GenerateRamHash()Mcu_SetMode(Schlafmodus)HALT 直至唤醒中断EcuM_CheckRamHash()降频时钟的睡眠模式(Poll)Mcu_SetMode(Schlafmodus)loop无事件挂起或已校验EcuM_SleepActivity()EcuM_CheckWakeup(wakeupSource)<Module>_CheckWakeup()EcuM_SetWakeupEvent(sources)falls Weckereignis erkanntUse Case: WakeupRestartMcu_SetMode(EcuMNormalMcuModeRef)EcuM_GetPendingWakeupEvents()EcuM_DisableWakeupSources(pending)EcuM_AL_DriverRestart()ReleaseResource(RES_AUTOSAR_ECUM_<core#>)

时序图:GoSleep 准备唤醒源,Halt 或 Poll 实现休眠,WakeupRestart 返回 UP 状态。来源:SWS EcuM 第52页、SWS EcuM 第85页、SWS EcuM 第87页、SWS EcuM 第58页

可选地,EcuM 维护一个时钟,用于计算电池接通以来的秒数 [SWS_EcuM_04069]。每个用户最多可设置一个唤醒闹钟。主闹钟始终对应最早的用户闹钟 [SWS_EcuM_04070] [SWS_EcuM_04072]。EcuM_SetAbsWakeupAlarm 以 ECUM_E_EARLIER_ACTIVE 拒绝更晚的时间点,以 ECUM_E_PAST 拒绝已经过去的时间点 [SWS_EcuM_04059] [SWS_EcuM_04060]。离开 SLEEP 时,EcuM 丢弃所有闹钟 [SWS_EcuM_04009]。

唤醒源:状态、校验与查询

EcuM 将最多 32 个唤醒源作为类型为 EcuM_WakeupSourceType 的位掩码进行管理。预定义了 5 个位,包括 ECUM_WKSOURCE_POWER 和 ECUM_WKSOURCE_RESET。其他源通过 EcuMWakeupSourceId 分配位 5 至 31 [SWS_EcuM_04040] [SWS_EcuM_02165] [SWS_EcuM_02166] SWS EcuM 第63页。每个源处于 NONE、PENDING、VALIDATED 或 EXPIRED 状态之一 [SWS_EcuM_04091] [SWS_EcuM_04041]。EcuM 将每次状态转换作为模式请求报告给 BswM [SWS_EcuM_04003]。

weckzustaende start Power On NONE ECUM_WKSTATUS_NONE entry: BswM_EcuM_CurrentWakeup(sources, NONE) start->NONE PENDING ECUM_WKSTATUS_PENDING entry: BswM_EcuM_CurrentWakeup(sources, PENDING) entry: EcuM_StartWakeupSources() do: Validierungssequenz NONE->PENDING EcuM_SetWakeupEvent [带校验] VALIDATED ECUM_WKSTATUS_VALIDATED entry: BswM_EcuM_CurrentWakeup(sources, VALIDATED) entry: ComM_EcuM_WakeUpIndication() NONE->VALIDATED EcuM_SetWakeupEvent [不带校验] PENDING->NONE EcuM_ClearWakeupEvent PENDING->VALIDATED EcuM_ValidateWakeupEvent EXPIRED ECUM_WKSTATUS_EXPIRED entry: BswM_EcuM_CurrentWakeup(sources, EXPIRED) entry: EcuM_StopWakeupSources() PENDING->EXPIRED Validierungs-Timeout (EcuM_MainFunction) VALIDATED->NONE EcuM_ClearWakeupEvent EXPIRED->NONE EcuM_ClearWakeupEvent

状态图:唤醒源从 NONE 经由 PENDING 变为 VALIDATED 或 EXPIRED。每次状态转换均报告给 BswM,且 EcuM_ClearWakeupEvent 将唤醒源重置为 NONE。来源:SWS EcuM 第60页、[SWS_EcuM_04091]、[SWS_EcuM_02683]

驱动程序使用 EcuM_SetWakeupEvent 恰好报告一次检测到的事件 SWS EcuM 第71页。该函数也可以从中断上下文以及无 OS 上下文中调用。它通过“或”操作将传递的位设置到 Pending 变量中。它会忽略不属于所选休眠模式的源 [SWS_EcuM_02826] [SWS_EcuM_02171] [SWS_EcuM_01117] [SWS_EcuM_04138]。

若事件必须被校验,EcuM 会根据 EcuMValidationTimeout 启动源特定的超时。若再次报告同一源,超时不会重新启动 [SWS_EcuM_02975] [SWS_EcuM_02565] [SWS_EcuM_02709] [SWS_EcuM_02712]。若未为源配置校验,EcuM_SetWakeupEvent 的效果同时等同于 EcuM_ValidateWakeupEvent。5 个预定义的源从不进行校验 [SWS_EcuM_02566] [SWS_EcuM_02625]。

校验本身在 EcuM_MainFunction 中运行,该函数为此调用 callout EcuM_CheckValidation [SWS_EcuM_02539] [SWS_EcuM_02925] SWS EcuM 第64页。EcuM_ValidateWakeupEvent 具有以下效果 [SWS_EcuM_02710] [SWS_EcuM_04078] [SWS_EcuM_04079] [SWS_EcuM_02645] [SWS_EcuM_04140]:

  • 它停止超时并将各位置位在 Validated 变量中。
  • 它向 BswM 报告 ECUM_WKSTATUS_VALIDATED。
  • 若配置了通道或 PNC,它分别调用 ComM_EcuM_WakeUpIndication 或 ComM_EcuM_PNCWakeUpIndication。

若超时到期,主函数设置 Expired 位并报告 ECUM_WKSTATUS_EXPIRED [SWS_EcuM_04081] [SWS_EcuM_04082]。在 RUN 状态下,校验仅对通信通道起作用 [SWS_EcuM_02790] [SWS_EcuM_02791]。

validierung a Treiber erkennt Weckereignis: EcuM_SetWakeupEvent(sources) b 源是否属于 所选的睡眠模式? a->b x Ereignis ignorieren b->x 不 c Validierung konfiguriert? (EcuMValidationTimeout) b->c 是 e Bits in Pending-Variable setzen, quellenspezifischen Timeout starten c->e 是 h Timeout stoppen, Validated-Bits setzen, BswM_EcuM_CurrentWakeup(VALIDATED), ComM_EcuM_WakeUpIndication / PNCWakeUpIndication (falls Kanal/PNC konfiguriert) c->h nein: impliziter EcuM_ValidateWakeupEvent f EcuM_MainFunction: EcuM_CheckValidation(wakeupSource) e->f g EcuM_ValidateWakeupEvent eingetroffen? f->g g->h 是 i Timeout abgelaufen? g->i 不 i->f 不 j Expired-Bit setzen, BswM_EcuM_CurrentWakeup(EXPIRED), EcuM_StopWakeupSources() i->j 是

活动图:对于无需校验的源,事件立即可被校验。对于其余源,事件保持 PENDING,直到 EcuM_ValidateWakeupEvent 到达或超时到期且源变为 EXPIRED。来源:SWS EcuM 第63页、SWS EcuM 第78页、[SWS_EcuM_02566]、[SWS_EcuM_04082]

当前状态由 EcuM_GetPendingWakeupEvents、EcuM_GetValidatedWakeupEvents 和 EcuM_GetExpiredWakeupEvents 查询。EcuM_ClearWakeupEvent 从所有三个变量中清除传入的位 [SWS_EcuM_01156] [SWS_EcuM_02533] [SWS_EcuM_04076] [SWS_EcuM_02683]。

某些唤醒源具有集成电源,因此其唤醒效果类似于上电复位。对于这些源,EcuM_StartCheckWakeup 启动 CheckWakeupTimer,以防止过早关断。EcuM_SetWakeupEvent 或 EcuM_EndCheckWakeup 再次终止该定时器 [SWS_EcuM_04096] [SWS_EcuM_04098] [SWS_EcuM_02927] SWS EcuM 第70页。

发生错误时的行为

不可恢复的错误由 EcuM 通过 callout EcuM_ErrorHook 连同对应的错误代码进行报告 [SWS_EcuM_04033] [SWS_EcuM_02904]。在 R20-11 中为此存在两个代码 [SWS_EcuM_91003] [SWS_EcuM_02987]:

  • Post-Build 数据不一致时为 ECUM_E_CONFIGURATION_DATA_INCONSISTENT。
  • 唤醒后 RAM 检查失败时为 ECUM_E_RAM_CHECK_FAILED。

若 OS 调用失败,EcuM 保持请求的状态并同样调用 ErrorHook [SWS_EcuM_04139]。独立的代码 ECUM_E_OS_CALL_FAILED 以及该钩子不返回的提示仅包含在规范的后续版本中 SWS EcuM 第102页。EcuM 忽略初始化期间的错误,例如初始化函数的返回值 [SWS_EcuM_02980]。

在激活开发错误检测时,所有函数都会检查其参数和运行条件。为此提供了 ECUM_E_UNINIT、ECUM_E_SERVICE_DISABLED、ECUM_E_PARAM_POINTER 和 ECUM_E_INVALID_PAR [SWS_EcuM_03009]。EcuM 向 DET 报告的其他情况包括:

若关断期间发生唤醒事件,EcuM 会完成关断并立即重新启动 [SWS_EcuM_02756]。若 ECU 在 EcuM_AL_SwitchOff 中无法自行断电,则复位是一种恰当的反应 [SWS_EcuM_02920] SWS EcuM 第141页。

进一步详细证据

本指南基于针对模块 EcuM(Classic Platform,R20-11)的规范节选在 AI 辅助下编写而成。以链接的需求为准;标记为解读的表述不具有规范性依据。

ECU State Manager (EcuM)

Controls ECU lifecycle states: Startup, Run, PostRun, Sleep, and Shutdown.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

函数 EcuM_GoDownHaltPoll [SWS_EcuM_91002] 📄 PDF

Std_ReturnType EcuM_GoDownHaltPoll (EcuM_UserType UserID);

Instructs the ECU State Manager module to go into a sleep mode, Reset or OFF depending on the previously selected shutdown target.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 71091e858c55 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步且可重入的函数 EcuM_GoDownHaltPoll 指示 ECU State Manager 模块根据先前选择的关机目标转换到 Sleep 模式、复位或 OFF 状态 [SWS_EcuM_91002]。它可通过头文件 EcuM.h 获取,其服务 ID 为 0x2c [SWS_EcuM_91002]。

参数与调用权限

作为唯一的输入参数,传入类型为 EcuM_UserType 的 UserID。它用于标识调用用户。调用受到严格限制:仅预先配置的用户才允许执行此函数 [SWS_EcuM_91002]。

返回值与执行行为

返回行为主要取决于所设定的关机目标的类型 [SWS_EcuM_91002]:

  • E_NOT_OK:请求未被接受 [SWS_EcuM_91002]。
  • E_OK:若目标为 SLEEP,函数在退出睡眠状态后成功返回该状态 [SWS_EcuM_91002]。
  • 不返回:若选择 RESET 或 OFF 作为关机目标,函数调用将不再返回给调用者 [SWS_EcuM_91002]。

限制与错误处理

尽管该函数在形式上被声明为可重入,但其按规范执行的前提是预先确定有效的关机目标 [SWS_EcuM_91002]。接口规范中未列出特定的 DET 或 DEM 错误码;失败或请求被拒绝会直接通过返回值 E_NOT_OK 指示 [SWS_EcuM_91002]。

本使用说明是基于 AUTOSAR 规范自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EcuM_Init [SWS_EcuM_02811] 📄 PDF

void EcuM_Init (void);

Initializes the ECU state manager and carries out the startup procedure. The function will never return (it calls StartOS)

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0b36a0aa946f 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步服务函数 EcuM_Init 初始化 ECU State Manager 并启动 ECU 的有序启动流程([SWS_EcuM_02811])。它通过带有服务 ID 0x01 的头文件 EcuM.h 声明,不接受任何参数,且不返回任何返回值([SWS_EcuM_02811])。形式上归类为可重入,但在调用后 EcuM_Init 绝不返回给调用者,因为它通过调用 StartOS 将执行移交给操作系统([SWS_EcuM_02811])。

在其执行过程中,该函数按照严格指定的顺序处理已定义的 StartPreOS 序列及其活动([SWS_EcuM_02411],[SWS_EcuM_02684])。此阶段的一个重要组成部分是配置一致性检查:模块在 EcuM_Init 内部检查相应的结构字段是否与 ECUM_CONFIGCONSISTENCY_HASH 的值相同([SWS_EcuM_02798])。

此外,EcuM_Init 控制多核系统上的驱动程序初始化([SWS_EcuM_04145])。该函数在每个单独的核上调用标注 EcuM_AL_DriverInitZero 以及 EcuM_AL_DriverInitOne([SWS_EcuM_04145])。对于标注实现的要求是,确保在各自活动的核上仅初始化实际在该核上执行的 MCAL 模块([SWS_EcuM_04145])。

此使用说明基于 AUTOSAR Classic R20-11 规范自动生成。

实现者指南即将推出(复杂度 I2)

函数 EcuM_StartupTwo [SWS_EcuM_02838] 📄 PDF

void EcuM_StartupTwo (void);

This function implements the STARTUP II state.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 537ce9e5d889 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步且不可重入的函数 EcuM_StartupTwo 实现 ECU State Manager 的状态 STARTUP II [SWS_EcuM_02838]。该接口通过头文件 EcuM.h 声明,并具有服务 ID 0x1a [SWS_EcuM_02838]。根据函数签名 void EcuM_StartupTwo(void),该调用既不接收输入参数,也不接收输入/输出或输出参数,且不向调用方返回返回值 [SWS_EcuM_02838]。

若 ECU 管理器模块被函数 EcuM_StartupTwo 激活,它将执行 StartPostOS 序列的操作 [SWS_EcuM_02932]。

在集成方面,对调用上下文和并发性有基本规定:该函数必须强制从作为 StartOS 的直接结果而启动的 Task 中调用 [SWS_EcuM_02806]。这要求对 EcuM_StartupTwo 的调用要么从 Autostart-Task 中发起,要么从显式启动的 Task 中发起 [SWS_EcuM_02806]。由于该函数被指定为不可重入,因此不得发生并发或多次调用 [SWS_EcuM_02838]。

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_Shutdown [SWS_EcuM_02812] 📄 PDF

void EcuM_Shutdown (void);

Typically called from the shutdown hook, this function takes over execution control and will carry out GO OFF II activities.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 06f5a6c81474 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步服务函数 EcuM_Shutdown(服务 ID 0x02)通过头文件 EcuM.h 提供,并负责执行控制以开展“GO OFF II”阶段的活动 [SWS_EcuM_02812]。它用于最终终止关闭过程 [SWS_EcuM_02953]。

调用上下文与语义

通常情况下,该函数从关机钩子(Shutdown-Hook)中调用 [SWS_EcuM_02812]。根据需求,该钩子有明确义务调用 EcuM_Shutdown 以结束关闭过程 [SWS_EcuM_02953]。

并发性与控制流

在规范中,EcuM_Shutdown 被声明为可重入 [SWS_EcuM_02812]。然而,对于程序流程有着严格的要求,即 EcuM_Shutdown 不得返回给调用方 [SWS_EcuM_02953]。处理完毕后,函数最终关闭 ECU 或作为替代触发复位 [SWS_EcuM_02953]。

本使用说明基于 AUTOSAR 规范 R20-11 自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_SetState [SWS_EcuM_04122] 📄 PDF

void EcuM_SetState (EcuM_StateType state);

Function called by BswM to notify about State Switch.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6ccfd6ea170b 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

同步函数 EcuM_SetState 供 BswM 用于向 EcuM 通知状态切换 [SWS_EcuM_04122]。作为输入参数传入类型为 EcuM_StateType 的 state,该参数指定了由 BswM 指定的状态 [SWS_EcuM_04122]。该函数没有返回值 [SWS_EcuM_04122]。

工作原理与协同交互

调用时,该函数将 EcuM 的内部状态设置为参数 state 的值 [SWS_EcuM_04123]。如果 BswM 以这种方式设置了 EcuM 的状态,EcuM 会向 RTE 指示相应的模式 [SWS_EcuM_04116]。

错误处理

若传入的参数 state 的值无效,EcuM_SetState 不会更改 EcuM 状态 [SWS_EcuM_04123]。若启用了开发错误报告(Development Error Reporting),该函数在发生此类错误时还会向 DET 模块报告错误 ECUM_E_STATE_PAR_OUT_OF_RANGE [SWS_EcuM_04123]。

并发性与接口

执行是同步且可重入的 [SWS_EcuM_04122]。该服务通过头文件 EcuM.h 进行声明 [SWS_EcuM_04122]。

此使用说明基于 AUTOSAR Classic R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_RequestRUN [SWS_EcuM_04124] 📄 PDF

Std_ReturnType EcuM_RequestRUN (EcuM_UserType user);

Places a request for the RUN state. Requests can be placed by every user made known to the state manager at configuration time.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: edb1d4cba6be 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

同步且可重入的函数 EcuM_RequestRUN 用于向 ECU State Manager 请求 RUN 状态 [SWS_EcuM_04124]。请求实体的标识作为类型为 EcuM_UserType 的参数通过 user 传入;仅在配置期就已向状态管理器声明的用户才具备权限 [SWS_EcuM_04124]。若 EcuM 接受了该请求,函数返回 E_OK,否则返回 E_NOT_OK [SWS_EcuM_04124]。该服务通过头文件 EcuM.h 进行声明 [SWS_EcuM_04124]。

错误处理与限制

请求不得嵌套:单个用户在同一时间最多只能持有一个活动的 RUN 请求 [SWS_EcuM_04125]。若 EcuM_RequestRUN 检测到同一用户的重复调用,则在启用开发错误检测时向 DET 报告错误码 ECUM_E_MULTIPLE_RUN_REQUESTS [SWS_EcuM_03024],[SWS_EcuM_04125]。

相互作用

每个使用 EcuM_RequestRUN 成功设置的状态请求,在活动结束后都必须重新释放。为此提供了互补的、同样是同步且可重入的服务 EcuM_ReleaseRUN,并向其传入相同的用户 ID [SWS_EcuM_04127]。

本使用说明基于 AUTOSAR 规范 R20-11 自动生成。

实现者指南即将推出(复杂度 I2)

函数 EcuM_ReleaseRUN [SWS_EcuM_04127] 📄 PDF

Std_ReturnType EcuM_ReleaseRUN (EcuM_UserType user);

Releases a RUN request previously done with a call to EcuM_RequestRUN. The service is intended for implementing AUTOSAR ports.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f2acc7b3a714 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

同步函数 EcuM_ReleaseRUN(服务 ID 0x04)用于释放先前通过 EcuM_RequestRUN 注册的 RUN 状态请求 [SWS_EcuM_04127]。该接口通过头文件 EcuM.h 提供,主要用于 AUTOSAR 端口的实现 [SWS_EcuM_04127]。作为输入参数,该函数需要类型为 EcuM_UserType 的用户标识符 user,该标识符在模块内唯一定义了执行释放的实体 [SWS_EcuM_04127]。

类型为 Std_ReturnType 的返回值通过 E_OK 指示释放请求已成功被模块接受 [SWS_EcuM_04127]。若无法处理该释放,该服务将返回错误值 E_NOT_OK [SWS_EcuM_04127]。

错误处理与并发

规范中未列出具体的错误码、开发错误(DET)或生产错误(DEM);请求的拒绝仅通过返回 E_NOT_OK 体现 [SWS_EcuM_04127]。可以假定(理解:),当针对给定的用户 ID 不存在活动请求或传递了无效参数值时,推测会返回 E_NOT_OK。 问题 Q-cbe9031cffe1be81 (未决)

该函数被声明为可重入,因此允许在并发执行上下文中被调用 [SWS_EcuM_04127]。作为功能性顺序条件,该调用强制要求相应用户先前已通过 EcuM_RequestRUN 请求了该状态 [SWS_EcuM_04127]。

相互作用

模块 EcuM 提供此服务,以便通过已定义的端口终止 RUN 状态的保持 [SWS_EcuM_04127]。对于 RTE 配置以及与本地 RTE 运行时行为的交互,规范定义了包含多个可并发执行的可运行实体(Runnable Entity)的 EcuStateManager 内部行为 [SWS_EcuM_03018]。

该文本由 AI 基于 AUTOSAR 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_RequestPOST_RUN [SWS_EcuM_04128] 📄 PDF

Std_ReturnType EcuM_RequestPOST_RUN (EcuM_UserType user);

Places a request for the POST RUN state. Requests can be placed by every user made known to the state manager at configuration time. Requests for RUN and POST RUN must be tracked independently (in other words: two independent variables). The service is intended for implementing AUTOSAR ports.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 8517014c50a6 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

同步函数 EcuM_RequestPOST_RUN 用于向 ECU State Manager([SWS_EcuM_04128])请求 POST RUN 状态。调用者通过参数 user 进行身份识别,其中每个请求实体必须在配置期就已向状态管理器声明([SWS_EcuM_04128])。该服务在头文件 EcuM.h 中声明,用于 AUTOSAR 端口的实现,并在成功接受时确认返回 E_OK,在拒绝时确认返回 E_NOT_OK([SWS_EcuM_04128])。

错误处理

若启用了开发错误检测,同一用户再次调用会导致 EcuM_RequestPOST_RUN 向 DET 报告错误 ECUM_E_MULTIPLE_RUN_REQUESTS([SWS_EcuM_03025])。解释:在此类多次请求或用户 ID 无效的情况下,该服务可能会以 E_NOT_OK 作为响应([SWS_EcuM_04128])。 问题 Q-b5bbd7d5b53e76ba (未决)

并发性与交互

该函数被设计为可重入的([SWS_EcuM_04128])。在模块内部,RUN 和 POST RUN 的请求必须通过两个独立的变量严格彼此独立地进行跟踪([SWS_EcuM_04128])。通过此服务注册的每个请求都会保持 POST-RUN 状态处于活动状态,直到通过互补调用 EcuM_ReleasePOST_RUN 显式将其撤销([SWS_EcuM_04129])。

本段文本由系统自动生成。所有技术内容均基于 AUTOSAR 规范。

实现者指南即将推出(复杂度 I2)

函数 EcuM_ReleasePOST_RUN [SWS_EcuM_04129] 📄 PDF

Std_ReturnType EcuM_ReleasePOST_RUN (EcuM_UserType user);

Releases a POST RUN request previously done with a call to EcuM_RequestPOST_RUN. The service is intended for implementing AUTOSAR ports.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5beb0fd73cda 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

同步且可重入的函数 EcuM_ReleasePOST_RUN([SWS_EcuM_04129])用于释放先前通过 EcuM_RequestPOST_RUN 设置的 POST-RUN 请求。通过类型为 EcuM_UserType 的输入参数 user 传递重新释放 POST-RUN 状态的实体标识。该接口通过头文件 EcuM.h 可用,并主要设计用于实现 AUTOSAR 端口([SWS_EcuM_04129])。

返回值与错误处理

该函数返回状态 Std_ReturnType([SWS_EcuM_04129]):

  • E_OK:释放请求已成功被 ECU State Manager 接受。
  • E_NOT_OK:释放请求被拒绝。理解:若对于指定的未注册有活动请求的用户,或传递了无效的用户标识符,推测会出现带有 E_NOT_OK 的拒绝。 问题 Q-67bd8594612defca (未决)

并发性与交互

该服务被指定为可重入([SWS_EcuM_04129]),因此允许多个实体同时调用。该函数是模块 EcuM 内部行为的一部分([SWS_EcuM_03018])。该调用在逻辑上前置要求实体先前已请求过 POST RUN 阶段([SWS_EcuM_04129])。理解:通常情况下,一旦软件组件在关机前的后续运行活动完成,推测便会通过 RTE 端口调用该函数。 问题 Q-81f71656d4debb4a (未决)

本使用说明是基于 AUTOSAR 规范版本 R20-11 自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EcuM_SelectShutdownTarget [SWS_EcuM_02822] 📄 PDF

Std_ReturnType EcuM_SelectShutdownTarget (EcuM_ShutdownTargetType shutdownTarget, EcuM_ShutdownModeType shutdownMode);

EcuM_SelectShutdownTarget selects the shutdown target. EcuM_SelectShutdownTarget is part of the ECU Manager Module port interface.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: a39197138cfb 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步服务函数 EcuM_SelectShutdownTarget 用于选择 ECU 的关闭目标,通过头文件 EcuM.h 以及作为 ECU 管理器模块端口接口的一部分提供 [SWS_EcuM_02822]。通过该调用,内部关闭目标被设置为所传递参数 shutdownTarget 的值 [SWS_EcuM_00624]。

该函数需要两个输入参数 [SWS_EcuM_02822]:

  • shutdownTarget:确定所选定的关闭目标 [SWS_EcuM_02822]。
  • shutdownMode:包含休眠模式的标识符(当目标为 ECUM_SHUTDOWN_TARGET_SLEEP 时)或复位机制的标识符(当目标为 ECUM_SHUTDOWN_TARGET_RESET 时),均符合配置 [SWS_EcuM_02822]。

该调用不会触发即时的设置或执行活动(Setup),而仅保存这些值以供稍后在阶段 SHUTDOWN 或 SLEEP 中使用 [SWS_EcuM_02585]。

在并发性方面,该函数被指定为可重入 [SWS_EcuM_02822]。在 ECU State Manager 的 RTE 内部行为中,对应的可运行实体(Runnable Entity)SelectShutdownTarget 被声明为 canbeInvokedConcurrently = TRUE [SWS_EcuM_03018],因此允许并行调用。

类型为 Std_ReturnType 的返回值通过 E_OK 指示新的关闭目标已成功设置,通过 E_NOT_OK 指示接收失败 [SWS_EcuM_02822]。规范在此处未提及 E_NOT_OK 的具体错误原因或 DET 报告;推测无效或未配置的目标与模式组合会导致拒绝。 问题 Q-e916f3a6ac0bf47e (未决)

该文本由 AI 生成,并基于 Release R20-11 的规范。

实现者指南即将推出(复杂度 I2)

函数 EcuM_SelectShutdownCause [SWS_EcuM_04050] 📄 PDF

Std_ReturnType EcuM_SelectShutdownCause (EcuM_ShutdownCauseType target);

EcuM_SelectShutdownCause elects the cause for a shutdown. EcuM_SelectShutdownCause is part of the ECU Manager Module port interface.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 518672a867f6 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EcuM_SelectShutdownCause 用于选择 ECU 关闭原因,并通过头文件 EcuM.h 可用 [SWS_EcuM_04050]。

使用与语义:

  • 参数:类型为 EcuM_ShutdownCauseType 的输入参数 target 传递所选的关闭原因 [SWS_EcuM_04050]。
  • 返回值:类型为 Std_ReturnType 的返回值通过 E_OK 指示新原因设置成功,通过 E_NOT_OK 指示设置失败 [SWS_EcuM_04050]。
  • 执行:该服务在 Service-ID 0x1b 下同步运行,并被指定为可重入 [SWS_EcuM_04050]。

并发性与交互:

该函数是 ECU Manager 模块端口接口(Port-Interface)的一部分 [SWS_EcuM_04050]。对于本地 RTE 的配置,在内部行为 EcuStateManager 中定义了符号为 EcuM_SelectShutdownCause 的可运行实体(Runnable Entity)SelectShutdownCause,其中分配了属性 canbeInvokedConcurrently = TRUE [SWS_EcuM_03018]。

错误处理:

规范范围内未列出具体的 DET 或 DEM 消息;设置原因时的错误状态仅通过返回值 E_NOT_OK 指示 [SWS_EcuM_04050]。

此使用说明自动生成,并基于 AUTOSAR Classic Release R20-11 的规范要求。

实现者指南即将推出(复杂度 I1)

函数 EcuM_ClearWakeupEvent [SWS_EcuM_02828] 📄 PDF

void EcuM_ClearWakeupEvent (EcuM_WakeupSourceType sources);

Clears wakeup events.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 8efe1e7a60e8 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步服务函数 EcuM_ClearWakeupEvent(服务 ID 0x16)用于重置唤醒事件,并通过头文件 EcuM.h 提供 [SWS_EcuM_02828]。它接受类型为 EcuM_WakeupSourceType 的位掩码 sources 作为参数,并且没有返回值 [SWS_EcuM_02828]。

在调用时,在 sources 中作为位置位的所有待处理事件将从模块的三个内部变量中清除 [SWS_EcuM_02683]:

  • 从待处理唤醒事件(pending wakeup events)的内部变量中,
  • 从已验证唤醒事件(validated events)的内部变量中,以及
  • 从已过期唤醒事件(expired events)的内部变量中 [SWS_EcuM_02683]。

关于调用上下文,可以灵活地从中断上下文、常规 OS 上下文以及无 OS 上下文中调用 EcuM_ClearWakeupEvent [SWS_EcuM_02807]。然而,与此同时,该函数被强制指定为不可重入(Non-Reentrant)且不可中断(Non-Interruptible)[SWS_EcuM_02828]。解读:由于该函数在不同上下文中被允许但在不可中断,集成商或调用者推测必须在组织上确保不发生同时或相互中断的调用。 问题 Q-71a4b1b218505a1c (未决)

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

函数 EcuM_AbortWakeupAlarm [SWS_EcuM_04061] 📄 PDF

Std_ReturnType EcuM_AbortWakeupAlarm (EcuM_UserType user);

Ecum_AbortWakeupAlarm aborts the wakeup alarm previously set by this user. EcuM_Abort WakeupAlarm is part of the ECU Manager Module port interface.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: a619899b3b6a 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EcuM_AbortWakeupAlarm 用于中止先前由用户设置的唤醒警报 [SWS_EcuM_04061]。该接口通过头文件 EcuM.h 提供,并构成 ECU Manager 模块端口接口的组成部分 [SWS_EcuM_04061]。

参数与返回值

并发性与交互

该函数具有 Service-ID 0x24,并被指定为可重入 [SWS_EcuM_04061]。因此,可以针对不同用户并发进行调用。ECU Manager 的内部行为定义了用于配置本地 RTE 的可执行实体 [SWS_EcuM_03018];作为模块端口接口的一部分,调用通常可能由软件组件通过 RTE 发起。 问题 Q-2c8f004d9f00bbd3 (未决)

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_GetCurrentTime [SWS_EcuM_04062] 📄 PDF

Std_ReturnType EcuM_GetCurrentTime (EcuM_TimeType* time);

EcuM_GetCurrentTime returns the current value of the EcuM clock (i.e. the time since battery connect). EcuM_GetCurrentTime is part of the ECU Manager Module port interface.

函数 EcuM_GetWakeupTime [SWS_EcuM_04063] 📄 PDF

Std_ReturnType EcuM_GetWakeupTime (EcuM_TimeType* time);

EcuM_GetWakeupTime returns the current value of the master alarm clock (the minimum absolute time of all user alarm clocks). EcuM_GetWakeupTime is part of the ECU Manager Module port interface.

函数 EcuM_SetClock [SWS_EcuM_04064] 📄 PDF

Std_ReturnType EcuM_SetClock (EcuM_UserType user, EcuM_TimeType time);

EcuM_SetClock sets the EcuM clock time to the provided value. This API is useful for testing the alarm services; Alarms that take days to expire can be tested. EcuM_SetClock is part of the ECU Manager Module port interface.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: a5821c5da6f5 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据 [SWS_EcuM_04064],同步且可重入的函数 EcuM_SetClock 用于将 ECU State Manager 的内部时间设置为指定值。作为 ECU Manager 端口接口(Port-Interface)的一部分,该函数可以通过头文件 EcuM.h 包含并调用 [SWS_EcuM_04064]。

该接口的主要应用目的是测试警报服务:在测试模式下,通过有针对性地设置时间,可以验证常规执行需要数天时间的警报 [SWS_EcuM_04064]。在此传递两个输入参数:

  • user(类型 EcuM_UserType):想要设置时间的调用方或用户的标识符。
  • time(类型 EcuM_TimeType):自连接电池(Battery Connect)以来的绝对时间(以秒为单位)。

作为返回值,该服务返回状态 Std_ReturnType,执行成功时为 E_OK,出错时为 E_NOT_OK [SWS_EcuM_04064]。该接口未指定具体的错误原因或 DET 消息;推测传入未授权的用户标识符或无效的时间值会导致返回 E_NOT_OK。 问题 Q-248768580c0309e8 (未决)

就内部模块行为和 RTE 配置而言,该函数集成在 EcuStateManager 的可运行实体(Runnable Entities)结构中 [SWS_EcuM_03018]。

本文由 AI 生成,用于技术指导。

实现者指南即将推出(复杂度 I1)

函数 EcuM_SelectBootTarget [SWS_EcuM_02835] 📄 PDF

Std_ReturnType EcuM_SelectBootTarget (EcuM_BootTargetType target);

EcuM_SelectBootTarget selects a boot target. EcuM_SelectBootTarget is part of the ECU Manager Module port interface.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3afaf8f6214a 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步函数 EcuM_SelectBootTarget 用于为 ECU 选择 Boot-Target,它是 ECU Manager 端口接口的一部分,并通过头文件 EcuM.h 提供 [SWS_EcuM_02835]。所需的目标通过类型为 EcuM_BootTargetType 的输入参数 target 传递 [SWS_EcuM_02835]。

作为返回值,如果新的 Boot-Target 被 EcuM 接受,该函数将指示 E_OK,否则指示 E_NOT_OK [SWS_EcuM_02835]。实现必须以与引导加载程序兼容的方式保存所选目标 [SWS_EcuM_02247]。当前设置的值可以通过补充服务 EcuM_GetBootTarget 查询 [SWS_EcuM_02836]。

该函数被指定为可重入的 [SWS_EcuM_02835];作为 RTE 配置内部行为的一部分,Runnable Entity SelectBootTarget 被声明为 canbeInvokedConcurrently = TRUE [SWS_EcuM_03018]。限制性规定是,该服务仅专供与诊断或引导管理相关的软件组件(SW-C)使用,并且可能取决于具体使用的引导加载程序 [SWS_EcuM_03000]。

此文本由 AI 生成,并基于 AUTOSAR 规范的要求。

实现者指南即将推出(复杂度 I1)

函数 EcuM_GetBootTarget [SWS_EcuM_02836] 📄 PDF

Std_ReturnType EcuM_GetBootTarget (EcuM_BootTargetType* target);

EcuM_GetBootTarget returns the current boot target - see EcuM_SelectBootTarget. EcuM_Get BootTarget is part of the ECU Manager Module port interface.

函数 EcuM_ValidateWakeupEvent [SWS_EcuM_02829] 📄 PDF

void EcuM_ValidateWakeupEvent (EcuM_WakeupSourceType sources);

After wakeup, the ECU State Manager will stop the process during the WAKEUP VALIDATION state/sequence to wait for validation of the wakeup event.This API service is used to indicate to the ECU Manager module that the wakeup events indicated in the sources parameter have been validated.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f79b59c62af4 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

EcuM_ValidateWakeupEvent 是一项同步服务(服务 ID 0x14),用于向 ECU Manager 指示在参数 sources 中传递的唤醒源已成功验证([SWS_EcuM_02829])。唤醒后,ECU State Manager 在验证序列中等待此确认。在调用时,该函数停止验证的当前超时定时器([SWS_EcuM_02710]),并通过对位掩码执行按位或运算将传入的事件输入到已验证唤醒事件的内部变量中([SWS_EcuM_04078])。

该函数是可重入的([SWS_EcuM_02829]),并且允许从任务上下文和中断上下文中调用([SWS_EcuM_02345])。如果 ECU Manager 处于状态 RUN,则除非涉及通信通道,否则该调用对所有唤醒源均无效果([SWS_EcuM_02790])。相反,对于分配给通信通道的源,该服务在 ECU 的任何阶段均发挥完全的作用([SWS_EcuM_02791])。

在整个执行流程中,该服务与唤醒验证和通信管理紧密交互:

  • 验证检查:ECU Manager 调用标注(callout)EcuM_CheckValidation 进行检查;如果检测到有效的唤醒事件,则通过 EcuM_ValidateWakeupEvent 进行反馈([SWS_EcuM_02925])。
  • 配置:如果未为唤醒源配置验证协议(EcuMValidationTimeout),则 EcuM_SetWakeupEvent 已隐含调用 EcuM_ValidateWakeupEvent([SWS_EcuM_02566])。
  • 通知:如果为唤醒源配置了 EcuMComMChannelRef,该服务将调用 ComM_EcuM_WakeUpIndication([SWS_EcuM_02645])。在配置了 EcuMComMPNCRef 的情况下,还会额外为每个引用的 PNC 触发 ComM_EcuM_PNCWakeUpIndication([SWS_EcuM_04140])。

本使用说明由 AI 基于 AUTOSAR Classic R20-11 规范生成。

实现者指南即将推出(复杂度 I2)

函数 EcuM_ErrorHook [SWS_EcuM_02904] 📄 PDF

void EcuM_ErrorHook (uint16 reason);

The ECU State Manager will call the error hook if the error codes "ECUM_E_RAM_CHECK_ FAILED" or "ECUM_E_CONFIGURATION_DATA_INCONSISTENT" occur. In this situation it is not possible to continue processing and the ECU must be stopped. The integrator may choose the modality how the ECU is stopped, i.e. reset, halt, restart, safe state etc.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: a96df00e2811 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步且不可重入的回调函数 EcuM_ErrorHook(通过 EcuM_Externals.h 提供)在发生使常规后续处理无法继续并需要停止 ECU 的严重错误时,由 ECU State Manager 调用 [SWS_EcuM_02904]。具体的错误原因通过传入参数 reason 传递 [SWS_EcuM_02904]。

定义的错误原因包括 ECUM_E_RAM_CHECK_FAILED 和 ECUM_E_CONFIGURATION_DATA_INCONSISTENT [SWS_EcuM_02904]。如果唤醒时的 RAM 检查失败,ECU Manager 有义务以原因 ECUM_E_RAM_CHECK_FAILED 触发 EcuM_ErrorHook [SWS_EcuM_02987]。此外,当调用操作系统函数失败且未指定其他错误响应时,通过此 hook 进行错误处理;在这种情况下,EcuM 保持在先前的状态 [SWS_EcuM_04139]。

在实现时,以下边界条件适用于系统集成商:

  • ECU 的停止形式:集成商选择使 ECU 停机的方式(例如复位、halt、重启或安全状态)[SWS_EcuM_02904]。Interpretation:在采取诸如复位或 halt 等彻底措施时,该函数通常可能不再返回常规流程控制。 问题 Q-59c23e3a2569f670 (未决)
  • 向 DEM 发送错误消息:只要能确保 DEM 不会写入损坏的 NVRAM 块,将错误转发给 DEM 由集成商自行决定 [SWS_EcuM_02987]。

此文本由 AI 创建,并基于 AUTOSAR CP R20-11 规范。

实现者指南即将推出(复杂度 I1)

函数 EcuM_AL_SetProgrammableInterrupts [SWS_EcuM_04085] 📄 PDF

void EcuM_AL_SetProgrammableInterrupts (void);

If the configuration parameter EcuMSetProgrammableInterrupts is set to true, this callout Ecu M_AL_SetProgrammableInterrupts is executed and shall set the interrupts on ECUs with programmable interrupts.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 166191cb51d3 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用和调用条件

Callout 函数 EcuM_AL_SetProgrammableInterrupts 由 ECU State Manager 模块调用,以便在具有可编程中断控制器的 ECU 上配置和设置相应的中断 [SWS_EcuM_04085]。然而,仅当配置参数 EcuMSetProgrammableInterrupts 被设置为值 true 时,才会执行此 Callout [SWS_EcuM_04085]。如果该参数未激活,则不进行调用 [SWS_EcuM_04085]。对于集成人员和平台驱动程序,该接口的声明通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_04085]。

该接口具有语法 void EcuM_AL_SetProgrammableInterrupts (void) 并分配有 Service-ID 0x4A [SWS_EcuM_04085]。调用完全不带参数:既不传递输入、输入/输出参数,也不传递输出参数,且函数不向调用模块返回返回值 [SWS_EcuM_04085]。

并发性与限制

规范为 EcuM_AL_SetProgrammableInterrupts 规定了异步执行行为(Asynchronous)[SWS_EcuM_04085]。关于并发性,该函数被归类为不可重入(Non Reentrant)[SWS_EcuM_04085]。对于集成而言,这意味着对该接口进行并行或嵌套调用是不允许的,并且与中断相关的配置必须在没有并发重入的情况下运行 [SWS_EcuM_04085]。

本使用说明基于 AUTOSAR 规范自动创建。

函数 EcuM_AL_DriverInitZero [SWS_EcuM_02905] 📄 PDF

void EcuM_AL_DriverInitZero (void);

This callout shall provide driver initialization and other hardware-related startup activities for loading the post-build configuration data. Beware: Here only pre-compile and link-time configurable modules may be used.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5df1108381d2 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

标注函数 EcuM_AL_DriverInitZero(Service-ID 0x31)被同步调用,既没有参数也没有返回值,且不可重入 [SWS_EcuM_02905]。它通过头文件 EcuM_Externals.h 声明 [SWS_EcuM_02905]。该函数用于提供早期驱动程序初始化以及基本的硬件相关启动活动,这些对于随后能够加载 post-build 配置数据是绝对必要的 [SWS_EcuM_02905]。

限制与多核运行

对于实现和执行,适用以下具体规定和限制:

  • 配置类:在此早期时间点,仅允许使用可预编译(Pre-Compile)或链接时(Link-Time)配置的模块 [SWS_EcuM_02905]。此时 Post-Build 可配置驱动程序尚不可用。
  • 调用上下文:该函数由 EcuM_Init 在系统的每个 Core 上调用 [SWS_EcuM_04145]。
  • Core 特定初始化:标注的实现必须确保,在当前活动的 Core 上仅初始化实际在该特定 Core 上执行的那些 MCAL 模块 [SWS_EcuM_04145]。

对于此标注,未定义返回值、具体错误代码或通过 DET 或 DEM 的通知 [SWS_EcuM_02905]。

此使用说明基于 AUTOSAR Release R20-11 的规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_DeterminePbConfiguration [SWS_EcuM_02906] 📄 PDF

const EcuM_ConfigType* EcuM_DeterminePbConfiguration (void);

This callout should evaluate some condition, like port pin or NVRAM value, to determine which post-build configuration shall be used in the remainder of the startup process. It shall load this configuration data into a piece of memory that is accessible by all BSW modules and shall return a pointer to the EcuM post-build configuration as a base for all BSW module post-build configrations.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 8491e826e02d 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EcuM_DeterminePbConfiguration([SWS_EcuM_02906])是 ECU State Manager 的同步标注(callout),通过头文件 EcuM_Externals.h 提供,且 Service-ID 为 0x32。该接口不包含输入、输出或输入/输出参数([SWS_EcuM_02906])。其核心目的在于:在启动过程中根据硬件或存储器条件确定在系统启动的后续过程中应采用哪一个 post-build 配置数据集([SWS_EcuM_02906])。

为确定配置,标注应当评估外部或驻留准则,例如端口引脚的状态或 NVRAM 中的值([SWS_EcuM_02906])。随后,该函数必须将这些配置数据加载到所有 BSW 模块均可访问的内存段中([SWS_EcuM_02906])。作为返回值,它返回一个指向 EcuM post-build 配置的类型为 const EcuM_ConfigType* 的指针([SWS_EcuM_02906])。该指针构成了整个 BSW 的共同基础,因为该结构体包含指向所有其他 BSW 模块各自 post-build 配置的指针([SWS_EcuM_02906])。

就调用行为而言,该函数被指定为同步且不可重入(Non Reentrant)([SWS_EcuM_02906])。未为该标注定义具体的错误代码、特殊的错误返回值以及与 DET 或 DEM 的接口([SWS_EcuM_02906])。因此,根据规范要求的解释,推测特定于应用的标注实现必须自行处理错误状态,因为缺少有效的配置指针推测会阻碍相关依赖 BSW 模块的有序启动。 问题 Q-b9487647fb39a2e2 (未决)

此使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_AL_DriverInitOne [SWS_EcuM_02907] 📄 PDF

void EcuM_AL_DriverInitOne (void);

This callout shall provide driver initialization and other hardware-related startup activities in case of a power on reset.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 1a4bc344c682 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与语义

函数 EcuM_AL_DriverInitOne 是 ECU 状态管理器(EcuM)的一个标注函数,通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02907]。其主要任务是在上电复位的情况下执行驱动程序初始化以及控制单元的其他硬件相关启动活动 [SWS_EcuM_02907]。由于这是一个标注,硬件和驱动程序初始化的具体实现可能由各自的系统集成商完成。 问题 Q-e22baf2fa31cf075 (未决)

该接口具有 C 签名 void EcuM_AL_DriverInitOne (void),并分配给 Service-ID 0x33 [SWS_EcuM_02907]。它不接受任何输入参数,也不向调用者返回任何返回值 [SWS_EcuM_02907]。

并发性与限制

根据 [SWS_EcuM_02907],以下边界条件适用于调用和运行时行为:

  • 同步性:执行是同步进行的(Synchronous),因此调用者会等待启动活动完成。
  • 可重入性:该函数被定义为不可重入(Non Reentrant);不允许并发或中断性的多次调用。
  • 调用上下文:仅针对上电复位之后的初始化阶段指定激活。

错误处理

由于 EcuM_AL_DriverInitOne 具有返回类型 void,因此在接口级别不存在关于初始化成功或失败的直接反馈 [SWS_EcuM_02907]。在当前规范范围内,未为此标注定义具体错误代码、DET 或 DEM 消息。

此文本由 AI 创建,并基于 AUTOSAR 规范 R20-11。

实现者指南即将推出(复杂度 I1)

函数 EcuM_LoopDetection [SWS_EcuM_04137] 📄 PDF

void EcuM_LoopDetection (void);

If the configuration parameter EcuMResetLoopDetection is set to true, this callout EcuM_Loop Detection is called on every startup.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: e51873f736db 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EcuM_LoopDetection 是 ECU State Manager 的一个 Callout,其服务 ID 为 0x4B,通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_04137]。

用法与调用上下文

只要配置参数 EcuMResetLoopDetection 设置为 true,该 Callout 就会在每次启动(Startup)时被同步调用 [SWS_EcuM_04137]。该函数既没有输入、输入/输出参数,也没有输出参数,并且不提供返回值(签名:void EcuM_LoopDetection (void))[SWS_EcuM_04137]。

并发性与限制

EcuM_LoopDetection 的执行被指定为同步且不可重入(Non Reentrant)[SWS_EcuM_04137]。由于它是一个 Callout,循环检测的具体实现通常由集成商或用户负责,以捕获系统启动时的重复复位循环。

本使用提示基于 AUTOSAR 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_OnGoOffOne [SWS_EcuM_02916] 📄 PDF

void EcuM_OnGoOffOne (void);

This call allows the system designer to notify that the GO OFF I state is about to be entered.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ee988344d1c4 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

函数 EcuM_OnGoOffOne 用于通告达到系统状态 GO OFF I,并使系统设计人员有机会在转换之前立即采取相应措施 [SWS_EcuM_02916]。该函数同步执行,不需要传入参数(既无 in 也无 inout),且不返回返回值(void)[SWS_EcuM_02916]。由于该接口是通过头文件 EcuM_Externals.h 声明的,因此可以合理推断这是一个在集成代码中实现的用户自定义 Callout 函数 [SWS_EcuM_02916]。 问题 Q-93de53c47a5a6142 (未决)

错误处理

在 EcuM_OnGoOffOne 的规范中,既未列出开发错误(DET),也未列出生产错误(DEM)或特定的错误返回值 [SWS_EcuM_02916]。由此可以推断,调用方不期望标准化的错误管理,任何异常情况都必须在用户自定义实现中自主处理 [SWS_EcuM_02916]。

并发性与限制

对于调用上下文和运行时行为,规定了以下属性 [SWS_EcuM_02916]:

  • 重入性:该函数被指定为不可重入(Non Reentrant),绝不得并行或嵌套调用 [SWS_EcuM_02916]。
  • 同步性:其语义为严格同步(Synchronous),因此调用方会等待该函数完全返回 [SWS_EcuM_02916]。
  • Service-ID:该服务在内部由十六进制标识符 0x3C 表示 [SWS_EcuM_02916]。

由于同步行为以及即将转换到 GO OFF I 状态,可以假定应避免阻塞操作,以免不允许地延迟关闭或转换过程 [SWS_EcuM_02916]。 问题 Q-93f5e23c581f0c38 (未决)

本使用说明由 AI 基于 AUTOSAR CP R20-11 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_OnGoOffTwo [SWS_EcuM_02917] 📄 PDF

void EcuM_OnGoOffTwo (void);

This call allows the system designer to notify that the GO OFF II state is about to be entered.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: e613bc195292 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据规范,同步函数 EcuM_OnGoOffTwo 用于使系统设计人员能够收到状态 GO OFF II 即将到来的通知 [SWS_EcuM_02917]。该调用无参数进行,没有 In、Inout 或 Out 参数,且不向调用者返回任何返回值 [SWS_EcuM_02917]。

关于执行上下文和并发性,该接口带有 Service-ID 0x3D,并被指定为不可重入(Non Reentrant)[SWS_EcuM_02917]。它通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02917]。Interpretation:由于声明位于 EcuM_Externals.h 中并用于通知系统设计人员,因此该函数可能被设计为 ECU 管理的同步标注,在切换到状态 GO OFF II 之前被调用。 问题 Q-bb0ae6e4632de827 (未决)

由于具有不可重入接口的特性,该调用不得并行或以中断方式重复进行 [SWS_EcuM_02917]。在规范范围内,未定义具体错误代码、向 DET 或 DEM 的反馈以及单独的错误处理机制 [SWS_EcuM_02917]。

此文本由 AI 基于 R20-11 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_AL_SwitchOff [SWS_EcuM_02920] 📄 PDF

void EcuM_AL_SwitchOff (void);

This callout shall take the code for shutting off the power supply of the ECU. If the ECU cannot unpower itself, a reset may be an adequate reaction.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 0b4004b6930f 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

标注函数 EcuM_AL_SwitchOff 是 ECU State Manager(EcuM)模块的一部分,用于包含用于关闭 ECU 电源供电的用户特定代码 [SWS_EcuM_02920]。该接口被定义为同步的,具有 Service-ID 0x3E,并通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02920]。

根据规范,该函数既不接收输入、输入/输出参数,也不接收输出参数,并且没有返回值(void)[SWS_EcuM_02920]。如果 ECU 的硬件无法自行断电,规范规定触发复位可以作为替代的妥当响应 [SWS_EcuM_02920]。

协同交互与并发性

一旦选定的关机目标为 OFF,ECU Manager 模块必须强制调用 EcuM_AL_SwitchOff [SWS_EcuM_04075]。关于并发行为,该标注被确定为不可重入(Non Reentrant)[SWS_EcuM_02920]。Interpretation:由于该函数的目标是完全切断电源或备选地进行复位,该标注可能代表关机序列的最后一步,此后不再进行任何常规程序执行。 问题 Q-e8a1aaa1413bbea9 (未决)

错误处理

在规范中,既未为此标注规定具体错误代码,也未规定错误处理机制或向 DET 或 DEM 发送的消息 [SWS_EcuM_02920]。

此使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_AL_Reset [SWS_EcuM_04065] 📄 PDF

void EcuM_AL_Reset (EcuM_ResetType reset);

This callout shall take the code for resetting the ECU.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: cf7a6e2e5e21 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

标注 EcuM_AL_Reset 用于包含负责复位 ECU 的集成特定代码([SWS_EcuM_04065])。该接口通过头文件 EcuM_Externals.h 声明,并具有 Service-ID 0x4C([SWS_EcuM_04065])。

该函数的调用是同步进行的,并被定义为不可重入(Non Reentrant)([SWS_EcuM_04065])。作为唯一的输入参数,传入类型为 EcuM_ResetType 的 reset,用于确定要执行的具体复位类型([SWS_EcuM_04065])。该函数没有返回值(void),并且没有任何用于输出或输入/输出的参数([SWS_EcuM_04065])。

在关机阶段的交互中规定,当关机目标设置为 RESET 时,ECU Manager 模块必须强制调用标注 EcuM_AL_Reset([SWS_EcuM_04074])。在规范中,既未为此标注规定错误代码,也未规定向 DET 或 DEM 发送的通知([SWS_EcuM_04065])。Interpretation:该标注可能执行直接导致 MCU 复位的底层硬件控制命令。 问题 Q-1e318404843faabd (未决)

本使用说明由 AI 基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_EnableWakeupSources [SWS_EcuM_02918] 📄 PDF

void EcuM_EnableWakeupSources (EcuM_WakeupSourceType wakeupSource);

The ECU Manager Module calls EcuM_EnableWakeupSource to allow the system designer to notify wakeup sources defined in the wakeupSource bitfield that SLEEP will be entered and to adjust their source accordingly.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 4e41a87f2d45 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EcuM_EnableWakeupSources 是 ECU Manager 具有 Service-ID 0x3F 的同步标注,通过头文件 EcuM_Externals.h 声明 [SWS_EcuM_02918]。它用于通知系统开发人员状态 SLEEP 即将到来,以便对位字段 wakeupSource(类型 EcuM_WakeupSourceType)中指定的唤醒源进行相应的准备和设置 [SWS_EcuM_02918]。

使用与交互

ECU Manager 执行 EcuM_EnableWakeupSources 以配置用于下一个 Sleep 模式的唤醒源;这针对在 EcuMWakeupSourceMask 中为目标 Sleep 模式配置的每个唤醒源进行 [SWS_EcuM_02389]。该函数没有返回值(void),并期望位字段 wakeupSource 作为输入参数 [SWS_EcuM_02918]。

并发性与限制

  • 可重入性:该函数被指定为不可重入(Non Reentrant)[SWS_EcuM_02918]。
  • 同步性:处理是同步进行的 [SWS_EcuM_02918]。
  • 错误处理:在该接口的规范范围内,未定义具体的 DET 或 DEM 错误消息 [SWS_EcuM_02918]。

本使用说明基于 AUTOSAR 规范版本 R20-11 自动生成。

函数 EcuM_GenerateRamHash [SWS_EcuM_02919] 📄 PDF

void EcuM_GenerateRamHash (void);

see EcuM_CheckRamHash

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: ce82c127dbe0 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EcuM_GenerateRamHash 用于在 ECU State Manager 上下文中生成 RAM 校验值,关于工作原理规范参见 EcuM_CheckRamHash [SWS_EcuM_02919]。生成的校验值大概用于稍后结合睡眠或休眠状态对主内存进行完整性检查。 问题 Q-7f316b389e1609c0 (未决)

使用与接口

该服务具有 Service-ID 0x40 和签名 void EcuM_GenerateRamHash(void) [SWS_EcuM_02919]。该函数既没有输入、输出参数,也没有输入/输出参数,且不返回任何返回值。执行是同步进行的。

并发性与限制

该函数被指定为不可重入(Non Reentrant)[SWS_EcuM_02919]。因此,不得从多个上下文以中断方式或并行调用它。声明通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02919]。Interpretation:通过在 EcuM_Externals.h 中的定义,它可能是一个需要用户特定实现的标注,由 ECU State Manager 在状态流程中的适当时机调用。 问题 Q-2f53f1a19cee079c (未决)

错误处理

在 [SWS_EcuM_02919] 中未针对 EcuM_GenerateRamHash 定义具体错误代码,也未定义 DET 或 DEM 消息。

此使用说明基于模块 EcuM 的规范自动生成。

函数 EcuM_SleepActivity [SWS_EcuM_02928] 📄 PDF

void EcuM_SleepActivity (void);

This callout is invoked periodically in all reduced clock sleep modes. It is explicitely allowed to poll wakeup sources from this callout and to call wakeup notification functions to indicate the end of the sleep state to the ECU State Manager.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 331d24f7a327 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

函数 EcuM_SleepActivity 代表 ECU State Manager 的一个 Callout,在头文件 EcuM_Externals.h 中提供,其 Service-ID 为 0x41 [SWS_EcuM_02928]。该调用在所有降低处理器时钟的睡眠模式(reduced clock sleep modes)下周期性进行 [SWS_EcuM_02928]。该函数的签名为 void EcuM_SleepActivity(void),同步工作,且不接收输入、输出或输入/输出参数 [SWS_EcuM_02928]。

功能任务与交互

该 Callout 的目的是在睡眠期间执行活动:规范中明确规定并允许在 EcuM_SleepActivity 内循环轮询(Polling)唤醒源 [SWS_EcuM_02928]。此外,允许直接从该 Callout 中调用唤醒通知函数,以向 ECU State Manager 指示睡眠状态的结束 [SWS_EcuM_02928]。

并发性与限制

该接口被指定为不可重入(Non Reentrant)[SWS_EcuM_02928]。由于该 Callout 不提供返回值,且未定义错误参数,因此不会通过函数接口利用错误代码或像 DET 或 DEM 这样的错误报告器进行直接的错误处理 [SWS_EcuM_02928]。

本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_StartCheckWakeup [SWS_EcuM_04096] 📄 PDF

void EcuM_StartCheckWakeup (EcuM_WakeupSourceType WakeupSource);

This API is called by the ECU Firmware to start the CheckWakeupTimer for the corresponding WakeupSource. If EcuMCheckWakeupTimeout > 0 the CheckWakeupTimer for the Wakeup Source is started. If EcuMCheckWakeupTimeout <= 0 the API call is ignored by the EcuM.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: adada8898a5f 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

根据 [SWS_EcuM_04096],同步接口 EcuM_StartCheckWakeup 由 ECU 固件调用,以针对特定唤醒源启动定时器 CheckWakeupTimer。为此,向该函数传递类型为 EcuM_WakeupSourceType 的参数 WakeupSource。它没有返回值(void),并通过头文件 EcuM_Externals.h 提供。

流程与条件

该函数的执行取决于唤醒源的配置 [SWS_EcuM_04096]:

  • 如果为相关唤醒源配置了 EcuMCheckWakeupTimeout > 0,则启动相应的 CheckWakeupTimer。
  • 如果适用 EcuMCheckWakeupTimeout <= 0,则该函数调用将被 EcuM 完全忽略。

并发与错误处理

该函数被指定为非重入(Non Reentrant)[SWS_EcuM_04096]。因此,调用者必须确保针对相同或其他唤醒源的调用不会并发发生。未针对该调用指定特定错误码以及向 DET 或 DEM 发送的通知;根据规范,在非正超时时间下调用不会产生任何影响,这大概可以解释为对无关定时器检查的容错拦截 [SWS_EcuM_04096]。 问题 Q-19d98b03d3ee7504 (未决)

此使用说明由 AI 基于 AUTOSAR R20-11 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_CheckWakeup [SWS_EcuM_02929] 📄 PDF

void EcuM_CheckWakeup (EcuM_WakeupSourceType wakeupSource);

This callout is called by the EcuM to poll a wakeup source. It shall also be called by the ISR of a wakeup source to set up the PLL and check other wakeup sources that may be connected to the same interrupt.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 9c2d9feb4e41 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

标注 EcuM_CheckWakeup 用于在唤醒事件后检查和轮询唤醒源以及配置 PLL [SWS_EcuM_02929]。该函数通过头文件 EcuM_Externals.h 提供,并具有 Service-ID 0x42 [SWS_EcuM_02929] 敬请注意。

调用上下文与语义

  • 签名与参数:该函数同步执行(Synchronous),没有返回值,并期望类型为 EcuM_WakeupSourceType 的 wakeupSource 作为输入参数 [SWS_EcuM_02929]。
  • 调用者:该标注由 EcuM 调用,以周期性查询唤醒源。此外,必须由唤醒源的中断服务例程(ISR)调用它,以建立 PLL 并检查连接在同一中断上的其他唤醒源 [SWS_EcuM_02929]。
  • 轮询循环:在轮询序列中,EcuM 在阻塞循环中重复调用标注 EcuM_SleepActivity 和 EcuM_CheckWakeup,直到唤醒事件被报告为挂起或已验证 [SWS_EcuM_03020]。

限制与错误处理

该函数被指定为不可重入(Non Reentrant)[SWS_EcuM_02929]。由于调用既可以来自轮询序列的阻塞流程,也可以来自 ISR 上下文,因此集成可能必须确保不会发生未协调的并发调用。 问题 Q-8bc8f164670a0911 (未决)未为此标注定义具体错误代码或向 DET 或 DEM 发送的错误通知。

本使用说明是基于 AUTOSAR 规范自动生成的。

实现者指南即将推出(复杂度 I1)

函数 EcuM_EndCheckWakeup [SWS_EcuM_02927] 📄 PDF

void EcuM_EndCheckWakeup (EcuM_WakeupSourceType WakeupSource);

This API is called by any SW Module whose wakeup source is checked asynchronously (e.g. asynchronous Can Trcv Driver) and the Check of the Wakeup returns a negative Result (no Wakeup by this Source). The API cancels the CheckWakeupTimer for the WakeupSource. If the correponding CheckWakeupTimer is canceled the check of this wakeup source is finished.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 22fef1b09b30 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

当唤醒源的异步检查(例如在异步 CAN 收发器驱动程序中)产生消极结果(即该源未出现唤醒事件)时,软件模块会调用同步函数 EcuM_EndCheckWakeup [SWS_EcuM_02927]。

用法与参数

通过类型为 EcuM_WakeupSourceType 的输入参数 WakeupSource 传入需要取消其关联监控定时器的唤醒源 [SWS_EcuM_02927]。该函数没有返回值(void),且不包含输入/输出或输出参数 [SWS_EcuM_02927]。

工作原理与并发性

  • 该函数取消针对指定唤醒源的定时器 CheckWakeupTimer;随着该定时器的取消,唤醒源的检查被视为已完成 [SWS_EcuM_02927]。
  • 该接口被定义为同步且不可重入(Non Reentrant)[SWS_EcuM_02927]。
  • 声明通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02927]。

本使用说明是基于 AUTOSAR R20-11 的规范自动生成的。

函数 EcuM_CheckRamHash [SWS_EcuM_02921] 📄 PDF

uint8 EcuM_CheckRamHash (void);

This callout is intended to provide a RAM integrity test. The goal of this test is to ensure that after a long SLEEP duration, RAM contents is still consistent. The check does not need to be exhaustive since this would consume quite some processing time during wakeups. A well designed check will execute quickly and detect RAM integrity defects with a sufficient probability. This specification does not make any assumption about the algorithm chosen for a particular ECU. The areas of RAM which will be checked have to be chosen carefully. It depends on the check algorithm itself and the task structure. Stack contents of the task executing the RAM check e.g. very likely cannot be checked. It is good practice to have the hash generation and checking in the same task and that this task is not preemptible and that there is only little activity between hash generation and hash check. The RAM check itself is provided by the system designer. In case of applied multi core and existence of Satellite-Ecu M(s): this API will be called by the Master-EcuM only.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: d1c6f593ca9f 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EcuM_CheckRamHash 是一个同步且不可重入的标注(在 EcuM_Externals.h 中声明),它提供 RAM 内存的完整性测试 [SWS_EcuM_02921]。该函数没有参数,并返回类型为 uint8 的状态值:值 0 表示测试失败,而任何其他值表示成功通过 [SWS_EcuM_02921]。

根据 [SWS_EcuM_02863],EcuM 模块在停止微控制器之前首先调用 [SWS_EcuM_02919],并在从 halt 状态返回后执行 EcuM_CheckRamHash。目标是验证即使在漫长的 SLEEP 阶段之后,RAM 内容也保持一致 [SWS_EcuM_02921]。

对于实现和流程,适用以下边界条件:

  • 算法与检查区域:检查函数由系统设计人员提供;它不必是详尽无遗的,但应执行迅速且足够可靠地检测错误 [SWS_EcuM_02921]。要检查的区域必须仔细选择;执行任务的堆栈内容通常无法检查 [SWS_EcuM_02921]。
  • 任务结构:最佳实践是在具有最小中间活动的同一个不可中断任务中执行哈希生成和检查 [SWS_EcuM_02921]。
  • 多核:在具有卫星 EcuM 的多个处理器内核的情况下,该标注仅由主 EcuM 调用,并且仅检查其范围之内的数据 [SWS_EcuM_02863]、[SWS_EcuM_02921]。

未为此标注定义具体的 DET 或 DEM 消息;返回值为 0 时的错误响应大概取决于上层系统设计 [SWS_EcuM_02921]。 问题 Q-473ef8617db29fe3 (未决)

本段文本由AI创建,基于AUTOSAR Classic R20-11规范。

函数 EcuM_DisableWakeupSources [SWS_EcuM_02922] 📄 PDF

void EcuM_DisableWakeupSources (EcuM_WakeupSourceType wakeupSource);

The ECU Manager Module calls EcuM_DisableWakeupSources to set the wakeup source(s) defined in the wakeupSource bitfield so that they are not able to wake the ECU up.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 474e253af285 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

Service-ID 为 0x44 的同步接口 EcuM_DisableWakeupSources 用于对类型为 EcuM_WakeupSourceType 的位字段参数 wakeupSource 中定义的唤醒源进行配置,使其不再能够唤醒 ECU [SWS_EcuM_02922]。函数签名形式为 void EcuM_DisableWakeupSources (EcuM_WakeupSourceType wakeupSource) [SWS_EcuM_02922]。

根据规范,调用上下文和集成适用以下特性:

  • 调用方与头文件:该函数由 ECU Manager 模块调用,并通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02922]。
  • 参数与返回值:位字段 wakeupSource 作为唯一的输入参数传入。该函数既无输入/输出参数也无输出参数,且不返回任何返回值(void)[SWS_EcuM_02922]。
  • 执行语义与并发性:处理同步进行。此外,该函数被指定为不可重入(Non Reentrant),因此必须避免并发或嵌套调用 [SWS_EcuM_02922]。

关于错误处理,该规范对于此函数调用既未包含具体错误代码,也未包含发送给 DET 或 DEM 的通知 [SWS_EcuM_02922]。

此文本由 AI 基于 AUTOSAR CP R20-11 规范生成。

函数 EcuM_AL_DriverRestart [SWS_EcuM_02923] 📄 PDF

void EcuM_AL_DriverRestart (void);

This callout shall provide driver initialization and other hardware-related startup activities in the wakeup case.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: f02a8bab5708 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

标注 EcuM_AL_DriverRestart 通过头文件 EcuM_Externals.h 声明,并具有 Service-ID 0x45 [SWS_EcuM_02923]。该函数具有签名 void EcuM_AL_DriverRestart (void),不需要传入参数,且不返回任何返回值 [SWS_EcuM_02923]。该接口的目的是在唤醒情况(Wakeup Case)下提供驱动程序初始化以及启动阶段的其他硬件相关活动 [SWS_EcuM_02923]。

对于集成以及与模块 EcuM 的交互,适用强制性规定:

  • 为了在阶段 WakeupRestart 期间重新初始化,集成商必须在 EcuM_AL_DriverRestart 的集成代码中包含一个重启块,该块使用已配置的列表 EcuMDriverRestartList [SWS_EcuM_02947] [SWS_EcuM_02923]。
  • 列表 EcuMDriverRestartList 可以包含充当唤醒源(Wakeup Sources)的驱动程序 [SWS_EcuM_02562]。在这种情况下,EcuM_AL_DriverRestart 必须重新使能(re-arm)这些驱动程序的唤醒检测(“wakeup detected”)回调触发机制 [SWS_EcuM_02562]。

关于运行时行为,该函数被定义为同步且不可重入 [SWS_EcuM_02923]。由于涉及应用程序特定的集成代码,规范在此接口上未定义其自身的错误代码,也未定义向 DET 或 DEM 发送的标准化消息。

此文本由 AI 创建。信息可能不完整,且不替代官方 AUTOSAR 规范。

实现者指南即将推出(复杂度 I2)

函数 EcuM_StartWakeupSources [SWS_EcuM_02924] 📄 PDF

void EcuM_StartWakeupSources (EcuM_WakeupSourceType wakeupSource);

The callout shall start the given wakeup source(s) so that they are ready to perform wakeup validation.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 72a2492ac382 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

标注函数 EcuM_StartWakeupSources 用于启动并使传入的唤醒源投入运行,以便为随后执行唤醒验证(Wakeup Validation)做好准备 [SWS_EcuM_02924]。

用法与调用上下文

该函数被指定为具有 Service-ID 0x46 的同步调用,没有返回值(void),并通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02924]。

  • 参数 wakeupSource(in):将要启动的唤醒源或多个唤醒源的位掩码(类型为 EcuM_WakeupSourceType)传递给标注函数 [SWS_EcuM_02924]。不存在额外的输入或输出参数(inout/out)[SWS_EcuM_02924]。

并发性与限制

关于执行环境,EcuM_StartWakeupSources 被归类为不可重入(Non Reentrant)[SWS_EcuM_02924]。因此,调用者必须确保该函数不会同时从中断服务例程或并行任务中执行。

交互与错误处理

由于 EcuM_StartWakeupSources 被声明为标注,受影响源的底层硬件激活由系统集成商通过应用程序特定实现负责 [SWS_EcuM_02924]。规范既未为此接口规定向 DET 或 DEM 发送错误消息,也未规定特定的错误返回值 [SWS_EcuM_02924];因此,启动源时的任何错误状态大概都会在标注内进行集成特定的捕获。 问题 Q-b595e7175c34a831 (未决)

此文本由 AI 创建,并基于 AUTOSAR R20-11 规范。

实现者指南即将推出(复杂度 I2)

函数 EcuM_CheckValidation [SWS_EcuM_02925] 📄 PDF

void EcuM_CheckValidation (EcuM_WakeupSourceType wakeupSource);

This callout is called by the EcuM to validate a wakeup source. If a valid wakeup has been detected, it shall be reported to EcuM via EcuM_ValidateWakeupEvent().

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c36dd6936c23 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

函数 EcuM_CheckValidation 用作 ECU State Manager 检查唤醒源的 Callout 接口 [SWS_EcuM_02925]。EcuM 调用此函数以确定检测到的唤醒事件是否有效 [SWS_EcuM_02925]。

使用

该 Callout 具有服务 ID 0x47,并通过头文件 EcuM_Externals.h 提供 [SWS_EcuM_02925]。作为传递参数,使用类型为 EcuM_WakeupSourceType 的 wakeupSource,通过它识别待校验的唤醒源 [SWS_EcuM_02925]。该函数没有返回值(void),且不包含输出或输入/输出参数 [SWS_EcuM_02925]。执行方式为同步 [SWS_EcuM_02925]。

错误处理

规范中未为此 Callout 定义特定的错误码、错误情况下的返回值或向 DET 或 DEM 的上报。

并发性与限制

在并发性方面,EcuM_CheckValidation 被定义为不可重入(Non Reentrant)[SWS_EcuM_02925]。EcuM 的调用上下文必须确保不会针对相同或不同的唤醒源发生并行或嵌套调用。

相互作用

如果在执行过程中检测到有效的唤醒事件,则必须通过函数调用 EcuM_ValidateWakeupEvent() 将其回报给 EcuM [SWS_EcuM_02925]。理解:用于检查硬件的设备专用逻辑以及关于有效性的决定,推测完全在集成代码中实现。 问题 Q-08061e09b474728d (未决)

本使用说明基于 AUTOSAR CP R20-11 规范自动生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_StopWakeupSources [SWS_EcuM_02926] 📄 PDF

void EcuM_StopWakeupSources (EcuM_WakeupSourceType wakeupSource);

The callout shall stop the given wakeup source(s) after unsuccessful wakeup validation.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 63994628bd66 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

EcuM 模块(Classic Platform)的标注函数 EcuM_StopWakeupSources 用于在唤醒验证未成功后有针对性地停止传入的唤醒源 [SWS_EcuM_02926]。该同步接口的声明可通过头文件 EcuM_Externals.h 获取,并带有 Service-ID 0x48 [SWS_EcuM_02926]。

使用与接口参数:

  • 输入参数:作为唯一参数,传入类型为 EcuM_WakeupSourceType 的 wakeupSource,用于指定要停止的唤醒源 [SWS_EcuM_02926]。
  • 返回值与输入/输出:既不存在输入/输出参数(inout),也不存在输出参数(out)[SWS_EcuM_02926]。该函数不向调用者返回任何返回值(void)[SWS_EcuM_02926]。
  • 执行行为:函数执行被确定为同步(Synchronous)[SWS_EcuM_02926]。

并发性与错误处理:

该接口被指定为不可重入(Non Reentrant)[SWS_EcuM_02926]。因此不允许并行调用,调用者必须避免并行调用。规范未为此标注定义具体的错误代码、返回值,也未定义向 Default Error Tracer(DET)或 Diagnostic Event Manager(DEM)模块发送的通知 [SWS_EcuM_02926]。Interpretation:由于该函数作为外部标注通过 EcuM_Externals.h 提供,相关唤醒硬件的硬件相关停用以及内部错误处理由用户特定实现负责。 问题 Q-b537c805bed751ab (未决)

此文本由 AI 基于 R20-11 规范生成。

实现者指南即将推出(复杂度 I1)

函数 EcuM_MainFunction [SWS_EcuM_02837] 📄 PDF

void EcuM_MainFunction (void);

The purpose of this service is to implement all activities of the ECU State Manager while the OS is up and running.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 9ac46d3f83ab 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用法与调用上下文

函数 EcuM_MainFunction 具有签名 void EcuM_MainFunction(void),服务 ID 为 0x18,并通过头文件 SchM_EcuM.h 提供 [SWS_EcuM_02837]。它不接收参数且不返回返回值 [SWS_EcuM_02837]。其任务是在操作系统运行(“OS is up and running”)期间处理 ECU State Manager 的所有活动 [SWS_EcuM_02837]。在此期间,该函数通常应由调度器周期性调用(Interpretation:通过 SchM_EcuM.h 集成)。 问题 Q-ca471f22bdb1f11d (未决)

交互与任务

在运行期间,EcuM_MainFunction 承担核心协调任务:

  • 唤醒源校验:若在 WakeupRestart 序列完成后存在候选唤醒源列表,EcuM 模块将在 EcuM_MainFunction 内校验这些候选对象 [SWS_EcuM_02539]。
  • 校验超时到期:若挂起唤醒事件的校验超时到期,函数将通过“或”运算设置已到期唤醒事件内部变量中的关联位 [SWS_EcuM_04081]。此外,它通过 BswM_EcuM_Current_Wakeup 并带有该事件的 EcuM_WakeupSourceType 位掩码和状态 ECUM_WKSTATUS_EXPIRED 通知 BSW 管理 [SWS_EcuM_04082]。
  • Alarm Clock Service:若该服务通过 EcuMAlarmClockPresent 存在,则 EcuM_MainFunction 更新 Alarm Clock Timer [SWS_EcuM_04002]。

限制与实例

作为多核或多实例架构的一项重要边界条件,EcuM_MainFunction 必须在 EcuM 的所有实例中执行 [SWS_EcuM_04011]。

本使用说明根据 R20-11 规范自动生成。

实现者指南即将推出(复杂度 I2)

类型 EcuM_ConfigType [SWS_EcuM_04038] 📄 PDF

A pointer to such a structure shall be provided to the ECU State Manager initialization routine for configuration.

类型 EcuM_RunStatusType [SWS_EcuM_04120] 📄 PDF

Result of the Run Request Protocol sent to BswM

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 94aa8a70183e 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

数据类型 EcuM_RunStatusType 被定义为 uint8,并通过头文件 EcuM.h 提供([SWS_EcuM_04120])。它用于在 ECU Manager 中正式表示 Run-Request 协议的当前状态,并作为结果传输给 Basic Software Mode Manager(BswM)([SWS_EcuM_04120])。

允许的取值范围包括三个离散状态([SWS_EcuM_04120]):

  • ECUM_RUNSTATUS_UNKNOWN(值 0):表示未知状态,同时用作定义的初始化值(Init Value)。
  • ECUM_RUNSTATUS_REQUESTED(值 1):标识 ECU Manager 已主动请求 RUN 状态这一状况。
  • ECUM_RUNSTATUS_RELEASED(值 2):指示 ECU Manager 已再次释放 RUN 状态。

在交互方面,要求 [SWS_EcuM_04121] 规定 ECU Manager 模块必须根据 EcuM_RunStatusType 中列出的状态值,将 Run-Request 协议的当前状态强制通知给 BswM。Interpretation:由于该要求未提及用于消息流的具体函数签名或调用约定,因此状态信息通常应通过内部通知函数或回调接口传递给 BswM 模块。 问题 Q-e136b90c2edbc29c (未决)在当前要求中,未针对该基本数据类型规定特定的错误代码、DET 或 DEM 报告以及特殊的重入条件。

本使用说明是基于 AUTOSAR Classic R20-11 的规范自动创建的。

实现者指南即将推出(复杂度 I1)

类型 EcuM_WakeupSourceType [SWS_EcuM_04040] 📄 PDF

EcuM_WakeupSourceType defines a bitfield with 5 pre-defined positions (see Range). The bitfield provides one bit for each wakeup source. In WAKEUP, all bits cleared indicates that no wakeup source is known. In STARTUP, all bits cleared indicates that no reason for restart or reset is known. In this case, ECUM_WKSOURCE_RESET shall be assumed.

类型 EcuM_WakeupStatusType [SWS_EcuM_04041] 📄 PDF

The type describes the possible states of a wakeup source.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 99623532d1ab 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

根据 [SWS_EcuM_04041],数据类型 EcuM_WakeupStatusType 描述了 ECU State Manager 中唤醒源(Wakeup Source)的可能状态。该类型派生自基本类型 uint8,并通过头文件 EcuM.h 提供 [SWS_EcuM_04041]。

值范围通过四个状态体现唤醒事件的生命周期 [SWS_EcuM_04041]:

  • ECUM_WKSTATUS_NONE(值 0):未检测到挂起的唤醒事件 [SWS_EcuM_04041]。
  • ECUM_WKSTATUS_PENDING(值 1):检测到唤醒事件,但尚未验证 [SWS_EcuM_04041]。
  • ECUM_WKSTATUS_VALIDATED(值 2):唤醒事件有效并已成功确认 [SWS_EcuM_04041]。
  • ECUM_WKSTATUS_EXPIRED(值 3):唤醒事件未及时验证,因此已过期 [SWS_EcuM_04041]。

使用与交互:该类型充当唤醒源的中央状态表示。Interpretation:调用者可能在状态查询范围内评估此状态,以确定是唤醒源正在被积极验证、已经发出了有效唤醒信号,还是超出了验证时间窗口。 问题 Q-a3f721e8f1753eb1 (未决)

此文本自动生成。所有信息仅基于相应版本的规范要求。

实现者指南即将推出(复杂度 I1)

类型 EcuM_ResetType [SWS_EcuM_04044] 📄 PDF

This type describes the reset mechanisms supported by the ECU State Manager. It can be extended by configuration.

类型 EcuM_StateType [SWS_EcuM_91005] 📄 PDF

ECU State Manager states.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 04e4b37b6e32 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类型 EcuM_StateType 是从 uint8 派生的数据类型,通过头文件 EcuM.h 提供,用于表示 ECU State Manager 的运行状态 [SWS_EcuM_91005]。EcuM 模块必须定义 EcuM_StateType 中列出的所有状态 [SWS_EcuM_02664]。取值范围包括子状态掩码 ECUM_SUBSTATE_MASK(0x0f)以及主状态 ECUM_STATE_STARTUP(0x10)、ECUM_STATE_RUN(0x32)、ECUM_STATE_POST_RUN(0x33)、ECUM_STATE_SHUTDOWN(0x40)和 ECUM_STATE_SLEEP(0x50)[SWS_EcuM_91005]。

使用与交互

该数据类型作为 BswM 与 EcuM 之间进行状态通信的核心参数:

  • 向 EcuM 发起状态切换:BswM 通过服务 ID 为 0x2b 的同步且可重入的函数调用 EcuM_SetState(EcuM_StateType state),将状态切换通知 EcuM 模块 [SWS_EcuM_04122]。
  • 向 BswM 报告状态:EcuM 通过调用接口 BswM_EcuM_CurrentState(EcuM_StateType State) 向 BswM 报告当前状态 [SWS_EcuM_04143]。

并发、时序与错误处理

关于时间顺序,规范要求只有当 RTE 通过相应的确认端口给出反馈后,EcuM 才允许设置新状态 [SWS_EcuM_04143]。当前资料中未针对该数据类型规定特定的错误码、返回值或 DET/DEM 消息。

此使用说明是基于规范要求自动生成的。

实现者指南即将推出(复杂度 I1)

类型 EcuM_Mode [SWS_EcuM_04107] 📄 PDF

–

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 930c9709cbac 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类型 EcuM_Mode 根据 [SWS_EcuM_04107] 定义为 ModeDeclarationGroup,表示 ECU State Manager 的核心状态。STARTUP 被确定为初始模式。此外,该组还包含定义的模式 POST_RUN、RUN、SHUTDOWN 以及 SLEEP [SWS_EcuM_04107]。

在系统集成中,EcuM_Mode 用作服务接口 EcuM_CurrentMode 内模式组 currentMode 的类型基础 [SWS_EcuM_04108]。通过该接口可以查询当前 ECU 模式,或者通过 RTE 模式机制向其他软件组件发送信号。

在调用上下文和并发性方面,该类型规范本身不包含关于重入性或错误码的显式限制;状态转换的管理通过 EcuM 的相应服务接口进行。

本提示自动生成,基于 AUTOSAR R20-11 规范数据。

实现者指南即将推出(复杂度 I1)

类型 currentMode [SWS_EcuM_04112] 📄 PDF

–

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: b0199fd54780 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

元素 currentMode 被定义为 EcuM 模块的 Provided-Port,并为软件架构提供服务接口 EcuM_CurrentMode [SWS_EcuM_04112]。该服务接口用于读取当前 ECU 模式,并在数据类型 EcuM_Mode 的基础上封装模式组 currentMode [SWS_EcuM_04108]。

在系统运行过程中,用于指示状态变更:

  • 调用与使用:一旦发生模式切换,EcuM 便会通过 RTE 模式端口向软件组件(SW-C)报告该切换 [SWS_EcuM_04133]。在规范假定端口名称为 currentMode 且使用直接 RTE API 的情况下,为此会调用函数 Rte_Switch_currentMode_currentMode( Rte_ModeType_EcuM_Mode mode) [SWS_EcuM_04133]。
  • 参数与返回值:参数 mode 将新进入的模式传递给 RTE [SWS_EcuM_04133]。由 Switch-API 提供的 Rte_StatusType 类型的返回值不作评估,而是根据规范必须强制忽略 [SWS_EcuM_04133]。
  • 交互:需要获知模式变更通知的软件组件,必须将模式切换接口 EcuM_CurrentMode 请求为 Required-Port [SWS_EcuM_04133]。

此使用说明由系统自动生成,且仅基于 R20-11 版本的规范要求。

实现者指南即将推出(复杂度 I1)

类型 EcuM_ShutdownCauseType [SWS_EcuM_04045] 📄 PDF

This type describes the cause for a shutdown by the ECU State Manager. It can be extended by configuration.

类型 EcuM_ShutdownModeType [SWS_EcuM_04101] 📄 PDF

This data type represents the modes of the ECU Manager module.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 799a0b090179 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用与取值范围

数据类型 EcuM_ShutdownModeType 基于 uint16,并通过头文件 Rte_EcuM_Type.h 提供 [SWS_EcuM_04101]。它映射了在 ECU State Manager 中配置的模式。其取值范围包括:

  • 根据 EcuMSleepModeId 配置的 Sleep 模式 [SWS_EcuM_04101],以及
  • 由偏移量 256 + EcuMResetModeId 计算得出的已配置 Reset 模式 [SWS_EcuM_04101]。

交互与调用上下文

该类型用于 ECU Manager 的同步且可重入的服务中:

  • EcuM_SelectShutdownTarget 接收 shutdownMode 作为输入参数,以指定具体的 Sleep 模式(当目标为 ECUM_SHUTDOWN_TARGET_SLEEP 时)或 Reset 机制(当目标为 ECUM_SHUTDOWN_TARGET_RESET 时)[SWS_EcuM_02822]。
  • EcuM_GetShutdownTarget 通过指向 EcuM_ShutdownModeType 的指针参数返回为当前关机目标选择了哪个已配置的 Sleep 或 Reset 模式 [SWS_EcuM_02824]。
  • EcuM_GetLastShutdownTarget 通过输出参数输出前一次关机过程的关机模式 [SWS_EcuM_02825]。通过服务接口 EcuM_ShutdownTarget,该功能也可供软件组件(SW-C)使用 [SWS_EcuM_03011]。

错误处理与边界条件

这些函数返回 Std_ReturnType。例如,如果向 EcuM_GetShutdownTarget 或 EcuM_GetLastShutdownTarget 传递了 NULL 指针,则调用失败并返回 E_NOT_OK [SWS_EcuM_02824], [SWS_EcuM_02825]。成功执行时,这些服务报告 E_OK [SWS_EcuM_02822], [SWS_EcuM_03011]。

此使用说明是基于规范要求自动生成的。

实现者指南即将推出(复杂度 I1)

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_EcuM
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_EcuM@rel:R20-11#295c3b66
Content hash
295c3b66
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_ECUStateManager.pdf#nameddest=SWS_EcuM_02813

主题图

详细视图

请在大纲中选择一个条目。

初始化与状态

Returns the version information of this module.

void EcuM_GetVersionInfo (Std_VersionInfoType* versioninfo);
EcuM_Init 函数

Initializes the ECU state manager and carries out the startup procedure. The function will never return (it calls StartOS)

void EcuM_Init (void);

服务 · Get…

EcuM_GetBootTarget returns the current boot target - see EcuM_SelectBootTarget. EcuM_Get BootTarget is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_GetBootTarget (EcuM_BootTargetType* target);

EcuM_GetCurrentTime returns the current value of the EcuM clock (i.e. the time since battery connect). EcuM_GetCurrentTime is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_GetCurrentTime (EcuM_TimeType* time);

Gets expired wakeup events.

EcuM_WakeupSourceType EcuM_GetExpiredWakeupEvents (void);

EcuM_GetLastShutdownTarget returns the shutdown target of the previous shutdown process. EcuM_GetLastShutdownTarget is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_GetLastShutdownTarget (EcuM_ShutdownTargetType* shutdownTarget, EcuM_ShutdownModeType* shutdownMode);

Gets pending wakeup events.

EcuM_WakeupSourceType EcuM_GetPendingWakeupEvents (void);

EcuM_GetShutdownCause returns the selected shutdown cause as set by EcuM_Select ShutdownCause. EcuM_GetShutdownCause is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_GetShutdownCause (EcuM_ShutdownCauseType* shutdownCause);

EcuM_GetShutdownTarget returns the currently selected shutdown target as set by EcuM_ SelectShutdownTarget. EcuM_GetShutdownTarget is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_GetShutdownTarget (EcuM_ShutdownTargetType* shutdownTarget, EcuM_ShutdownModeType* shutdownMode);

Gets validated wakeup events.

EcuM_WakeupSourceType EcuM_GetValidatedWakeupEvents (void);

EcuM_GetWakeupTime returns the current value of the master alarm clock (the minimum absolute time of all user alarm clocks). EcuM_GetWakeupTime is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_GetWakeupTime (EcuM_TimeType* time);

服务 · A…

This callout shall provide driver initialization and other hardware-related startup activities in case of a power on reset.

void EcuM_AL_DriverInitOne (void);

This callout shall provide driver initialization and other hardware-related startup activities for loading the post-build configuration data. Beware: Here only pre-compile and link-time configurable modules may be used.

void EcuM_AL_DriverInitZero (void);

This callout shall provide driver initialization and other hardware-related startup activities in the wakeup case.

void EcuM_AL_DriverRestart (void);

This callout shall take the code for resetting the ECU.

void EcuM_AL_Reset (EcuM_ResetType reset);

If the configuration parameter EcuMSetProgrammableInterrupts is set to true, this callout Ecu M_AL_SetProgrammableInterrupts is executed and shall set the interrupts on ECUs with programmable interrupts.

void EcuM_AL_SetProgrammableInterrupts (void);

This callout shall take the code for shutting off the power supply of the ECU. If the ECU cannot unpower itself, a reset may be an adequate reaction.

void EcuM_AL_SwitchOff (void);

服务 · Set…

EcuM_SetAbsWakeupAlarm sets the user's wakeup alarm to an absolute point in time. EcuM_ SetAbsWakeupAlarm is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_SetAbsWakeupAlarm (EcuM_UserType user, EcuM_TimeType time);

EcuM_SetClock sets the EcuM clock time to the provided value. This API is useful for testing the alarm services; Alarms that take days to expire can be tested. EcuM_SetClock is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_SetClock (EcuM_UserType user, EcuM_TimeType time);

EcuM_SetRelWakeupAlarm sets a user's wakeup alarm relative to the current point in time. EcuM_SetRelWakeupAlarm is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_SetRelWakeupAlarm (EcuM_UserType user, EcuM_TimeType time);

Function called by BswM to notify about State Switch.

void EcuM_SetState (EcuM_StateType state);

Sets the wakeup event.

void EcuM_SetWakeupEvent (EcuM_WakeupSourceType sources);

服务 · Check…

This callout is intended to provide a RAM integrity test. The goal of this test is to ensure that after a long SLEEP duration, RAM contents is still consistent. The check does not need to be exhaustive since this would consume quite some processing time during wakeups. A well designed check will execute quickly and detect RAM integrity defects with a sufficient probability. This specification does not make any assumption about the algorithm chosen for a particular ECU. The areas of RAM which will be checked have to be chosen carefully. It depends on the check algorithm itself and the task structure. Stack contents of the task executing the RAM check e.g. very likely cannot be checked. It is good practice to have the hash generation and checking in the same task and that this task is not preemptible and that there is only little activity between hash generation and hash check. The RAM check itself is provided by the system designer. In case of applied multi core and existence of Satellite-Ecu M(s): this API will be called by the Master-EcuM only.

uint8 EcuM_CheckRamHash (void);

This callout is called by the EcuM to validate a wakeup source. If a valid wakeup has been detected, it shall be reported to EcuM via EcuM_ValidateWakeupEvent().

void EcuM_CheckValidation (EcuM_WakeupSourceType wakeupSource);

This callout is called by the EcuM to poll a wakeup source. It shall also be called by the ISR of a wakeup source to set up the PLL and check other wakeup sources that may be connected to the same interrupt.

void EcuM_CheckWakeup (EcuM_WakeupSourceType wakeupSource);

服务 · Select…

EcuM_SelectBootTarget selects a boot target. EcuM_SelectBootTarget is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_SelectBootTarget (EcuM_BootTargetType target);

EcuM_SelectShutdownCause elects the cause for a shutdown. EcuM_SelectShutdownCause is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_SelectShutdownCause (EcuM_ShutdownCauseType target);

EcuM_SelectShutdownTarget selects the shutdown target. EcuM_SelectShutdownTarget is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_SelectShutdownTarget (EcuM_ShutdownTargetType shutdownTarget, EcuM_ShutdownModeType shutdownMode);

服务 · On…

This call allows the system designer to notify that the GO OFF I state is about to be entered.

void EcuM_OnGoOffOne (void);

This call allows the system designer to notify that the GO OFF II state is about to be entered.

void EcuM_OnGoOffTwo (void);

服务 · Release…

Releases a POST RUN request previously done with a call to EcuM_RequestPOST_RUN. The service is intended for implementing AUTOSAR ports.

Std_ReturnType EcuM_ReleasePOST_RUN (EcuM_UserType user);

Releases a RUN request previously done with a call to EcuM_RequestRUN. The service is intended for implementing AUTOSAR ports.

Std_ReturnType EcuM_ReleaseRUN (EcuM_UserType user);

服务 · Request…

Places a request for the POST RUN state. Requests can be placed by every user made known to the state manager at configuration time. Requests for RUN and POST RUN must be tracked independently (in other words: two independent variables). The service is intended for implementing AUTOSAR ports.

Std_ReturnType EcuM_RequestPOST_RUN (EcuM_UserType user);

Places a request for the RUN state. Requests can be placed by every user made known to the state manager at configuration time.

Std_ReturnType EcuM_RequestRUN (EcuM_UserType user);

服务 · Start…

This API is called by the ECU Firmware to start the CheckWakeupTimer for the corresponding WakeupSource. If EcuMCheckWakeupTimeout > 0 the CheckWakeupTimer for the Wakeup Source is started. If EcuMCheckWakeupTimeout <= 0 the API call is ignored by the EcuM.

void EcuM_StartCheckWakeup (EcuM_WakeupSourceType WakeupSource);

The callout shall start the given wakeup source(s) so that they are ready to perform wakeup validation.

void EcuM_StartWakeupSources (EcuM_WakeupSourceType wakeupSource);

服务 · 其他

Ecum_AbortWakeupAlarm aborts the wakeup alarm previously set by this user. EcuM_Abort WakeupAlarm is part of the ECU Manager Module port interface.

Std_ReturnType EcuM_AbortWakeupAlarm (EcuM_UserType user);

Clears wakeup events.

void EcuM_ClearWakeupEvent (EcuM_WakeupSourceType sources);

This callout should evaluate some condition, like port pin or NVRAM value, to determine which post-build configuration shall be used in the remainder of the startup process. It shall load this configuration data into a piece of memory that is accessible by all BSW modules and shall return a pointer to the EcuM post-build configuration as a base for all BSW module post-build configrations.

const EcuM_ConfigType* EcuM_DeterminePbConfiguration (void);

The ECU Manager Module calls EcuM_DisableWakeupSources to set the wakeup source(s) defined in the wakeupSource bitfield so that they are not able to wake the ECU up.

void EcuM_DisableWakeupSources (EcuM_WakeupSourceType wakeupSource);

The ECU Manager Module calls EcuM_EnableWakeupSource to allow the system designer to notify wakeup sources defined in the wakeupSource bitfield that SLEEP will be entered and to adjust their source accordingly.

void EcuM_EnableWakeupSources (EcuM_WakeupSourceType wakeupSource);

This API is called by any SW Module whose wakeup source is checked asynchronously (e.g. asynchronous Can Trcv Driver) and the Check of the Wakeup returns a negative Result (no Wakeup by this Source). The API cancels the CheckWakeupTimer for the WakeupSource. If the correponding CheckWakeupTimer is canceled the check of this wakeup source is finished.

void EcuM_EndCheckWakeup (EcuM_WakeupSourceType WakeupSource);

The ECU State Manager will call the error hook if the error codes "ECUM_E_RAM_CHECK_ FAILED" or "ECUM_E_CONFIGURATION_DATA_INCONSISTENT" occur. In this situation it is not possible to continue processing and the ECU must be stopped. The integrator may choose the modality how the ECU is stopped, i.e. reset, halt, restart, safe state etc.

void EcuM_ErrorHook (uint16 reason);

see EcuM_CheckRamHash

void EcuM_GenerateRamHash (void);

Instructs the ECU State Manager module to go into a sleep mode, Reset or OFF depending on the previously selected shutdown target.

Std_ReturnType EcuM_GoDownHaltPoll (EcuM_UserType UserID);

If the configuration parameter EcuMResetLoopDetection is set to true, this callout EcuM_Loop Detection is called on every startup.

void EcuM_LoopDetection (void);

Typically called from the shutdown hook, this function takes over execution control and will carry out GO OFF II activities.

void EcuM_Shutdown (void);

This callout is invoked periodically in all reduced clock sleep modes. It is explicitely allowed to poll wakeup sources from this callout and to call wakeup notification functions to indicate the end of the sleep state to the ECU State Manager.

void EcuM_SleepActivity (void);

This function implements the STARTUP II state.

void EcuM_StartupTwo (void);

The callout shall stop the given wakeup source(s) after unsuccessful wakeup validation.

void EcuM_StopWakeupSources (EcuM_WakeupSourceType wakeupSource);

After wakeup, the ECU State Manager will stop the process during the WAKEUP VALIDATION state/sequence to wait for validation of the wakeup event.This API service is used to indicate to the ECU Manager module that the wakeup events indicated in the sources parameter have been validated.

void EcuM_ValidateWakeupEvent (EcuM_WakeupSourceType sources);

周期性

The purpose of this service is to implement all activities of the ECU State Manager while the OS is up and running.

void EcuM_MainFunction (void);

类型

–

A pointer to such a structure shall be provided to the ECU State Manager initialization routine for configuration.

EcuM_Mode 类型

–

This type describes the reset mechanisms supported by the ECU State Manager. It can be extended by configuration.

Result of the Run Request Protocol sent to BswM

This type describes the cause for a shutdown by the ECU State Manager. It can be extended by configuration.

This data type represents the modes of the ECU Manager module.

ECU State Manager states.

This data type represents the time of the ECU Manager module.

Unique value for each user.

EcuM_WakeupSourceType defines a bitfield with 5 pre-defined positions (see Range). The bitfield provides one bit for each wakeup source. In WAKEUP, all bits cleared indicates that no wakeup source is known. In STARTUP, all bits cleared indicates that no reason for restart or reset is known. In this case, ECUM_WKSOURCE_RESET shall be assumed.

The type describes the possible states of a wakeup source.