Autosar 系列教程:小柴带你学 AutoSar 总目录

# 小柴带你学 AutoSar 系列三、标准和规范篇(3)ModeManagement

宝子们,我来啦

虽迟但到哈哈哈😜

一个人的精力果然是有限的

最近在搬家哈哈哈😋

只要坚持下去就可以打败 99.99% 的人了✌️

主打一个默默无闻

# ModeManagementGuide

# 2 Overall mechanisms and concepts

A mode can be seen as the current state of an ECU1 wide, global variable, which is maintained by the RTE respectively the Schedule Manager.

一个代表 ECU 当前状态的全局变量是由 RTE 和调度管理器维护

Modes can be used for different purposes.

First of all modes are used to synchronize Software Components and Basic Software Modules. Via modes specified triggers can be enabled and disabled, and consequently the activation of Executable Entitys can be prevented.

Also Executable Entitys can be triggered explicitely during a Mode Switch.

On the other hand mode switches can explicitly trigger executable entities during transition from one mode to another. For example the RTE can activate an OnEntry ExecutableEntity to initialize acertain resource before entering a specific mode. In this mode the triggers of this ExecutableEntity are activated. If the mode is left the OnExit ExecutableEntity is called, which could execute some cleanup code and the triggers would be deacti vated.

模式管理有如下几个目的:

  • 可以同步 SWC 和 BSW
    • 通过使能和失能特殊的触发器来执行或禁止相应的运行实体
    • 此外运行实体在模式切换期间显示触发

这里对自己写代码也有一些感触了,就是代码写好之后,通过模式切换来触发函数,这样架构师就可以将代码分配给 Coder,之后架构师通过模式管理来组织代码的执行。当然啦,初始化也是一个状态切换哦!

# 2.1 Declaration of modes

例如:

ECU state management there may exist the ModeDeclarations

  • STARTUP,
  • RUN
  • POST_RUN
  • SLEEP

# 2.2 Mode managers and mode users

两个模式:管理者模式 和 用户模式

Responsible for switching modes are Mode managers, which are the only instances able to change the value of the global variable.

也就是说要单独将模式管理做成软件组件的形式

# 2.3 Modes in the RTE

每个组件都有模式管理接口

image-20240831180708672

# 2.4 Modes in the Basic Software Scheduler

Another possibility for a Basic Software Module acting as a Mode user to get informed about mode switches, is to register a BSW Module Entry, which is triggered by a Mode Switch Event (see also [3]).

这里也有另一种设想,模式的切换的逻辑都是固定的,那么是否可以将模式和模式的入口出口都通过注册的机制来处理,这样就无需再多写模式切换的逻辑了。说干就干之后会设计一个注册机制的模式管理框架

image-20240807115103069

# 2.5 Communication of modes

分为:

  • Mode Switch
  • Mode Request

image-20240831180853675

# 3 Configuration of the Basic Software Modemanager

# 3.2 Semantics of BswM Configuration: Interfaces and behavioral aspects

In general the BswM can be seen as a state machine, which is defined by its interface and a behavioral description. The input actions of this state machine are mode requests. Each mode request is described in the ECU configuration of the BswM as a BswMModeRequestSource. These mode requests can be of different types (C-API calls, mode requests via RTE, mode notifications via RTE, etc.) but internally they are treated in the same way.

If a mode is requested the internal mirror of this BswMModeRequestSource is updated and depending on the configuration a rule evaluation is triggered, which results in the execution of predefined action lists. Action lists group Actions. Typically an action is a triggering of a mode switch in the RTE or Schedule Manager, but there are also predefined actions which change the status of some Basic Software Module.

总的来说,BswM 可以被看作是一个状态机,它由其接口和行为描述定义该状态机的输入操作是模式请求。每个模式请求在 BswM 的 ECU 配置中作为 BswMModeRequestSource 进行描述。这些模式请求可以是不同类型 (C-API 调用,通过 RTE 发送的模式请求,通过 RTE 发送模式通知等),但它们在内部以相同的方式处理。
如果请求模式,则此 BswMModeRequestSource 的内部镜像将进行更新并且根据配置触发规则评估,从而导致执行预定义的动作列表。动作列表将动作分组。通常,动作是触发 RTE 或调度管理器中的模式切换,但也有预定义的动作,可以更改某些基本软件模块的状态。

Interface of the BswM

The interface is defined by the BswMModeRequestSource and the BswMActionListItem containers.

BswM 的接口有两个

  • BswMModeRequestSource
  • BswMActionListItem

Mode Requests

BswMModeRequestSource 是一个可选的容器

Available Actions

伪代码

EcuM_SetState(EcuM_StateType State)
modeGroup EcuM_StateType {
    ECUM_STATE_STARTUP,
    ECUM_STATE_APP_RUN,
    ECUM_STATE_APP_POST_RUN,
    ECUM_STATE_SHUTDOWN,
    ECUM_STATE_SLEEP
}

后面又一堆无聊的伪代码

Configuration of the BswM behavior

The behavior of the BswM is specified via rules and action lists. A rule is a logical expression, which combines the current values of ModeRequestTypeMaps. The evaluation of each rule either results in the execution of its true or false action lists.

BswM 的行为是通过规则和操作列表来指定的。规则是一个逻辑表达式,它结合了 ModeRequestTypeMaps 的当前值。对每个规则的评估要么导致其真或假操作列表的执行。

image-20240807151000055

The ModeControlContainer contains these ActionLists. An ActionList can consist of a set of atomic actions, other “nested” ActionLists or it can reference (nested) rules which are then evaluated in the context of this Actionlist.

ModeControlcontainer 包含这些 ActionLists。ActionList 可以由一组原子操作、其他 “嵌套 ActionLists 或引用 (嵌套) 规则组成,然后在此 Actionlist 的上下文中进行评估。

image-20240807151015607

# 3.3 ECU state management

During startup and shutdown the task of the BswM is to initialize all basic software modules in a similar way as it is done by the ECUM in older AUTOSAR releases. To achieve this the following ModeDeclarationGroup is defined, which indicates the overall state of the ECU to application software components and is used for internal rule arbitration.

在启动和关闭期间,BswM 的任务是初始化所有基本软件模块,其方式与早期 AUTOSAR 版本中的 ECUM 类似。为了实现这一点定义了以下 ModeDeclarationGroup,它指示 ECU 对应用软件组件的总体状态,并用于内部规则仲裁。

modeGroup MDG_EcuMode {
    ECU_RUN,
    ECU_APP_RUN,
    ECU_APP_POST_RUN,
    ECU_GO_SLEEP,
    ECU_GO_OFF_ONE,
    ECU_SLEEP,
    ECU_GO_OFF_TWO,
    ECU_STARTUP_ONE,
    ECU_STARTUP_TWO,
    ECU_RESET_READY
}
interface modeSwitch MSIF_EcuMode {
    mode MDG_EcuMode ecuMode
}

image-20240807180720010

# 3.4 Communication Management

Besides parts of the ECU state management, the BswM is also responsible for parts of the communication management. This section describes the functionality of the BswM, which is related to the Communication Stack of AUTOSAR. This covers but is not restricted to the following uses cases.

  • Starting and stopping of IPDU Groups in general
  • Partial Networking
  • Diagnostic use cases which influence the communication of an ECU. e.g. it might be necessary to set the FlexRay State manager to passive mode via FrSm_SetEcuPassive() when requested by an application.
  • Service Discovery Control for Appplication SWCs

To fulfill the requested functionality the BswM has ModeRequestSources to

  • the Communication Manager
  • the bus state managers
  • AUTOSAR COM
  • Service Discovery

除了 ECU 状态管理的一部分外,BswM 还负责通信管理的一部分。本节描述了 BswM 的功能,该功能与 AUTOSAR 的通信堆栈有关。这包括但不限于以下用例。

Partial Network Cluster

A Partial Network Cluster (PNC) is a (logical) group of ECUs which have to be active at the same time to realize some distributed functionality. A PNC can be assigned to one or multiple users (configuration in ComM) and specific software components can request or release communication for a PNC by requesting the communication mode of a user mapped to the PNC. ComM implements a state machine for each partial network cluster (PNC) and each PNC has its own state. For a simple mapping, the PNC state definitions are related to the states of ComM.

部分网络集群 (PNC) 是 (逻辑) ECU 组,这些 ECU 必须同时处于活动状态才能实现某些分布式功能。PNC 可以分配给一个或多个用户 (在 ComM 中进行配置),特定的软件组件可以通过请求映射到 PNC 的用户通信模式来请求或释放 PNC 的通信。ComM 为每个部分网络集群 (PNCS) 实现一个状态机,每个 PNC 都有自己的状态。对于简单的映射,PNC 状态定义与 ComM 的状态相关。

image-20240808104459145

The status of all PNCs on the nodes of a system channel is exchanged within the so-called PNC bit vector via a network management message (NM message).

系统信道节点上的所有 PNC 的状态通过网络管理消息 (NM 消息) 在所谓的 PNC 位矢量内交换。

Each PNC uses a dedicated bit position within a bit vector (PNC bit vector) transferred by a NM message on CAN, FlexRay and Ethernet. If a PNC is requested by a local ComM user on the node, the node sets the corresponding PNC bit in the PNC bit vector to 1. If the PNC is not requested anymore; the node sets the corresponding PNC bit in the PNC bit vector to 0. (Please note: If the optional feature "Synchronized PNC shutdown" is used and a PN shutdown messages has to be transmitted, the PNC bits are set to 1 for the PNCs which are released and the remaining PNC bits are set to 0). The <Bus>Nm extract the PNC bit vector from a received NM-PDU and forward the PNC bit vector to the NM interface. The Nm interface module collects and aggregates PNC requests.

每个 PNC 在由 CAN、FlexRay 和以太网上的 NM 消息传输的位向量 (PNC 位向量) 中都使用一个专用位。如果节点上的本地 ComM 用户请求 PNC,则节点将 PNC 位向量中的相应 PNC 位设置为 1。如果不再需要 PNC,则节点会将 PNC 位向量的相应 PNC 位设为 0。(请注意:如果使用了可选功能 “同步 PNC 关闭” 并且必须发送 PN 关闭消息,则已释放的 PNC 的 PNC 位将设置为 1,其余的 PNC 位将设为 0)。<Bus>Nm 从接收到的 NM-PDU 中提取 PNC 位向量并将 PNC 位矢量转发到 NM 接口。Nm 接口模块收集和汇总 PNC 请求。

Each PNC uses the same bit position in the PNC bit vector on every system channel within the NM message. ComM uses 3 types of PNC bit vector named External and Internal Request Array (EIRA), External Request Array (ERA) and Internal Request Array (IRA) to exchange PNC status information with NM interface and <Bus>Nms.

有三种类型

  • External and Internal Request Array (EIRA) 外部中断请求阵列
  • External Request Array (ERA) 外部请求阵列
  • Internal Request Array (IRA) 内部请求阵列

Partial networking is supported on the bus types CAN, FlexRay and Ethernet. Activation and deactivation of the I-PDU groups of the PNCs on a CAN, FlexRay and Ethernet node is required to control the communication capabilities considering the current state of the PNC and to avoid false timeouts in the system.

部分网络支持 CAN、FlexRay 和以太网总线类型。在 CAN、Flex-Ray 和以太网节点上,需要对 PNC 的 I-PDU 组进行激活和失活,以控制通信能力,考虑到 PNC 的当前状态,并避免系统中的错误超时。

Starting and stopping of I-PD groups in COM are handled in BswM. I-PDU-Groups shall be started if the corresponding PNC is internally or externally requested. As soon as a PNC is neither internally norexternally requested, the corresponding I-PDU-Group shall be stopped.

COM 中的 I-PDU 组启动和停止由 BswM 处理。如果相应的 PNC 内部或外部请求,则应启动相应的 I-PDU-Group,一旦 PNC 既没有内部请求也没有外部请求,则应停止相应的 I-PDU 群组。

Internal PNC requests indicate communication needs locally on the ECU and are also called "active PNC request". External PNC requests indicate communication needs of a remote ECU in the network and are also called "passive PNC request".

内部 PNC 请求指示 ECU 上的本地通信需求,也称为 “主动 PNC 请求”。

外部 PNC 请求指示网络中远程 ECU 的通信需求,也称为 “被动 PNC 请求”。

The logic to control I-PDU-Groups is handled as interaction between ComM and BswM. ComM indicates the current state of a particular PNC state machine to BswM.

控制 I-PDU - 群的逻辑是作为 ComM 和 BswM 之间的交互处理的。ComM 向 BswM 表示特定 PNC 状态机的当前状态。

The BswM controls the corresponding I-PDU groups by means of mode arbitration and mode control. Please note, deactivation of single FlexRay ECUs is not possible.

BswM 通过模式仲裁和模式控制来控制相应的 I-PDU 组。请注意,单个 FlexRayECU 是不可用的。因为 FlexRay 是严格基于时间传输的,需要至少两个节点才可以正常通信。

The PNC Gateway feature is used to span (logical) partial network clusters across bus / communication channel boundaries, "gatewaying" PNC requests from one bus/net work to the others.

PNC 网关功能用于跨越总线 / 通信信道边界的 (逻辑) 部分网络集群,将 PNC 请求从一个总线 / 网络 “网关化” 到其他网络。

The PNC Gateway collects PNC requests from all of its multiple active channels (which are called active since it actively keeps them awake, if required) and aggregates them.

PNC 网关从其所有多个活动通道 (这些通道被称为活动通道,因为如果需要,它会主动保持它们处于清醒状态) 收集 PNC 请求并对其进行汇总。

The PNC Gateway sends the aggregated PNC state in the network to all its active channels, which causes all nodes to have the same view on the global PNC request state as the gateway.

PNC 网关将网络中聚合的 PNC 状态发送到其所有活动信道,这使得所有节点对全局 PNC 请求状态具有与网关相同的视图。

If the PNC Gateway is not the topmost PNC Gateway in the network hierarchy, the PNC Gateway will also send the aggregated PNC request state of all subordinate nodes, plus its own internal request state, to its superior PNC coordinator, which is connected via the so-called connector type "passive".

如果 PNC 网关不是网络层次结构中的最高 PNC 网关,则 PNC 网关还将发送所有子节点的聚合 PNC 请求状态以及它自己的内部请求状态到其上级 PNC 协调器,该协调器通过所谓的 “被动” 连接器类型连接。

The superior PNC coordinators will aggregate the subordinate coordinators PNC request states, so the top-level coordinator will know about all active PNC requests in the network, and send that info to the subordinate nodes.

上级 PNC 协调器将聚合下属协调器的 PNC 请求状态,因此顶级协调器将了解网络中所有活动的 PNC 请求,并将该信息发送到子节点。

image-20240808175912278

image-20240808180646651

Aggregation of internal and external Partial Network Cluster

内部和外部的网络集群的聚合

This feature is used by every ECU that is member of a Partial Network Cluster (PNC).

  • Active PNC requests are forwarded by the ComM via the Nm to the <Bus>Nms.
  • Passive PNC requests are received by the <Bus>Nms and forwarded to the Nm.

作为部分网络集群 (PNC) 成员的每个 ECU 都使用此功能。

  • 主动 PNC 请求由 ComM 通过 Nm 转发到 <Bus>Nm。
  • <Bus>Nm 接收被动 PNC 请求并将其转发给 Nm。

Nm handles received PNC request with respect to a so-called PN filter mask. The PN filter mask define which of the received PNC requests are relevant. Nm collects and maintains internal and external PNC requests.

Nm 处理接收到的与 PN 过滤器掩码相关的 PNC 请求。PN 过滤器掩码定义了哪些接收到的 PNC 请求是相关的。Nm 收集和维护内部和外部 PNC 请求。

The aggregation of internal and external requested PNCs is called "External Internal Request Array (EIRA)".

内部和外部请求的 PNC 的汇总称为 “外部内部请求阵列 (EIRA)

Changes of the EIRA are forwarded by Nm to ComM. ComM needs this information to handle changes in the corresponding PNC state machines.

EIA 的更改由 Nm 转发到 ComM。ComM 需要此信息来处理相应 PNC 状态机中的更改。

The provided information of a request change (PNC request changed from requested to released and vice versa) to ComM at (almost) the same time on every ECU, results to switch the I-PDU-Groups synchronously on all direct connected ECUs.

在每个 ECU 上 (几乎) 同时向 ComM 提供的请求更改 (PNC 请求从请求变为释放反之亦然) 信息导致在所有直接连接的 ECU 上同步切换 I-PDU 组。

Therefore the Nm maintain timers (so-called PNC reset timer) of each PNC request in the EIRA.

因此,Nm 在 EIRA 中维护每个 PNC 请求的定时器 (即 PNC 复位定时器)

The PNC reset timer is restarted every time the corresponding PNC is requested within received PNC bit vector and every time the corresponding PNC request is transmitted.

每次在接收到的 PNC 位矢量内请求对应的 PNC 以及每次发送对应的 PNC 请求时,都会重新启动 PNC 复位定时器。

Aggregation of external Partial Network Cluster

外部的网络集群的聚合

This feature is used by the ECUs where the PNC Gateway functionality is enabled to collect the external PNC requests per channel.

此功能由启用 PNC 网关功能的 ECU 使用,以收集每个通道的外部 PNC 请求。

The external PNC requests have to be coordinated across all affected channels. The logic of the PNC coordination is provided by ComM.

外部 PNC 请求必须通过所有受影响的通道进行协调。PNC 协调的逻辑由 ComM 提供。

There, for each channel it is configured if it is actively or passively coordinated.

对于每个通道,如果它是主动协调还是被动协调,都会进行配置。

On actively coordinated channels, external PNC requests are mirrored back to the channel where the PNC request was received and also forwarded to all other coordinated channels (either passively or actively coordinated) where this PNC is assigned to.

在主动协调的通道上,外部 PNC 请求被镜像回接收 PNC 请求的通道,并转发到分配有该 PNC 的所有其他协调通道 (无论是被动协调还是主动协调)。

On passive coordinated channels external PNC requests are forwarded to other actively coordinated channels where this PNC is assigned to without mirroring back on the channel from where the external PNC request was received.

This avoids endless mirroring of partial network cluster requests,

在被动协调通道中,外部 PNC 请求被转发到其他主动协调通道,该 PNC 也会被分配给主动协调通道,而不会在接收外部 PNC 请求的通道中镜像回来。这避免了部分网络集群请求的无休止的反射。

if 2 ECUs have PNC Gateway functionality enabled and are connected to the same channel.

The Nm module provides the information if PNCs are externally requested or released to ComM and manages the PNC timer handling for each relevant PNC and per channel.

The aggregated state of the external requested PNCs is called "External Request Array" (ERA).

如果两个 ECU 启用了 PNC Gateway 功能并连接到同一信道,则 Nm 模块会在外部向 ComM 请求或释放 PNC 时提供这些信息,并管理每个相关 PNC 和每个信道的 PNC 定时器处理。外部请求的 PNC 的聚合称为 “外部请求阵列”(ERA)

Synchronized PNC shutdown

PNC shutdown 的同步

In order to avoid timeout failure on application level, the PNC shall shutdown in a synchronized way (all nodes in the PNC will shutdown at the same point in time).

为了避免应用层的超时故障,PNC 应以同步方式关闭 (PNC 中的所有节点将在同一时间点关闭)。

The synchronized PNC shutdown is a functionality which is a cooperation of ComM, Nm and <Bus>Nm to ensure a synchronized PNC shutdown at almost the same point in time across the whole PN topology.

同步 PNC 关闭是一个由 ComM、Nm 和 总线 Nm 共同实现的功能 <Bus>,可确保在整个 PN 拓扑中几乎相同的时间点同步 PNC 关断。

A synchronized PNC shutdown is handled by ECUs in role of a top-level PNC coordinator or intermediate PNC coordinator if the PNC Gateway is enabled.

如果 PNC 网关处于启用状态,则由 ECU 充当顶级 PNC 协调器或中间 PNC 协调器处理同步 PNC 关闭。

If the ComM of an ECU in the role of a top-level PNC coordinator detects that a PNC is released (PNC is no longer internally or externally requested), the ComM requests a synchronized PNC shutdown.

如果充当顶级 PNC 协调整个 ECU 的 ComM 检测到 PNC 释放 (PNC 内部或外部请求不再存在),则 ComM 请求同步 PNC 关闭

The Nm module stores all requests and handles them in the context of the Nm_Mainfunction. The Nm module indicates the affected <Bus>Nms regarding an activated PNC shutdown process.

Nm 模块存储所有请求,并在 Nm_Mainfunction 函数中处理它们。Nm 模块指示与已激活的 PNC 关机过程有关的受影响的 <Bus>Nm。

The <Bus>Nms call the Nm module to provide the aggregated requests for a synchronized PNC shutdown as PNC bit vector per given NM-Channel.

<Bus>Nms 调用 Nm 模块,以便以每个给定的 NM 信道的 PNC 位向量的形式提供对同步 PNC 关机的聚合请求。

The <Bus>Nms use the provided PNC bit vector to assemble a NM-PDU as PN shutdown message and transmit this message on the according NM channel.

<Bus>Nm 使用提供的 PNC 位矢量来组装 NM-PDU 作为 PN 关闭消息,并在相应的 NM 通道上传输该消息。

If a PN shutdown message is received by an ECU in the role of an intermediate PNC coordinator, the <Bus>Nms extract the PNC bit vector from the received PN shutdown message and forwards the information by calling the callback function Nm_ForwardSynchronizedPncShutdown.

如果中间 PNC 协调器角色中的 ECU 接收到 PN 关闭消息,则 <Bus>Nms 从接收到的 PN 关闭消息中提取 PNC 位向量,并通过调用回调函数 Nm_ForwardSynchronizedPncShutdown 来转发该信息。

The callback function will immediately forward the indication to ComM by calling ComM_Nm_ForwardSynchronizedPncShutdown. ComM will immediately request a synchronized PNC shutdown of all actively PNC coordinated (coordinated by a PNC gateway) ComMChannels.

回调函数将立即通过调用 ComM_Nm_ForwardSynchronizedPncShutdown 将指示转发到 ComM。ComM 将立即请求所有积极 PNC 协调 (由 PNC 网关协调) 的 ComMChannels 的同步 PNC 关闭。

The requests for a synchronized PNC shutdown are forwarded to the Nm module per NM-Channel and handled in the same way as described in the previous section. If a PNC leaf node receives a PN shutdown message, then it will handle the message as a usual NM message (update the local PN info and reset PN reset time).

同步 PNC 关闭请求通过 NM 通道转发到 Nm 模块,处理方式与前一节所述相同。如果 PNC 叶节点接收到 PN 关闭消息,则它将像处理常规 NM 消息一样处理该消息 (更新本地 PN 信息并重置 PN 复位时间)

Scheduling of main functions

Since state changes of communication channels or PNCs are generally processed in the context of the main processing functions, it is important to properly consider the scheduling and the order of execution for the main processing functions for the modules involved in the communication and network management (ComM, Nm, <Bus>Nms).

由于通信信道或 PNC 的状态变化通常在主处理功能的上下文中进行处理,因此正确考虑涉及通信和网络管理 (ComM、Nm、<Bus>Nms) 的模块的主处理功能的调度和执行顺序非常重要。

ComM generally coordinates the activities considering the events in the system and triggers the required actions (by calling the relevant APIs) of the lower layers.

ComM 通常会考虑系统中的事件来协调活动,并触发下层所需的动作 (通过调用相关的 API)。

Events in the system causing specific actions required to be triggered by ComM can be internal requests of users (internal requests for channels or PNCs), passive/external requests for channels or PNCs or synchronized PNC shutdown messages received on the bus.

系统中导致需要由 ComM 触发特定操作的事件可以是

  • 用户的内部请求 (对信道或 PNC 的内部请求)、
  • 对信道或 PNC 的被动 / 外部请求
  • 或在总线上接收到的同步 PNC 关闭消息。

External events may be caused by wakeup events, reception of cyclic NM messages or synchronized shutdown messages.

外部事件可能由

  • 唤醒事件、
  • 周期性 NM 消息的接收
  • 或同步关机消息引起。

ComM receives and processes all internal and external requests

ComM 接收和处理所有内部和外部请求

and triggers required actions

并触发必要的动作

that will lead to state changes in the state machines for communication and network management modules

这将引导通信和网络管理模块状态机的状态变化

and consequently the transmission of cyclic NM messages or synchronized shutdown messages on the bus.

从而在总线上传输循环 NM 消息或同步关闭消息。

During integration of the modules, it must be considered that the processing of specific requests is done asynchronously in the basic software (e.g. transmission requests,some requests from the application)

在集成模块时,必须考虑特定请求的处理在基本软件中异步完成 (例如传输请求、来自应用程序的某些请求)

and also that specific actions may be processed decoupled in the context of the main processing cycle of the involved modules (e.g.transmission in the <Bus>Nms, processing of timers, state changes and notificationsto upper layers).

并且特定操作可能在所涉及模块的主要处理周期的上下文中脱钩处理 (例如在 < Bus>Nms 中的传输、处理定时器、状态更改和通知给上层)。

I-PDU Group Switching

For the I-PDU group switching it is expected that dedicated I-PDU groups for outgoing and incoming I-PDUs in COM exist for each channel or partial network.

对于 I-PDU 组交换,预计每个通道或部分网络都存在用于 COM 中传入和传出 I-PDUs 的专用 I-PDU 组。

AUTOSAR COM takes care that an I-PDU is active (started) if at least one I-PDU group containing this I-PDU is active.

AUTOSAR COM 确保如果至少一个包含此 I-PDU 的 I-PDU 组处于活动状态,则 I-PDU 处于活动状态 (启动)

有两种组织方式

  • Channel related I-PDU Group Handling
  • PNC related I-PDU Group Handling

image-20240809114837791

image-20240809114845904

Channel related I-PDU Group Handling

Listing 3.18: ComM reports FULL_COMMUNICATION

rule channel1requested initially false {
    if ( ComM_Mode_Channel1 == COMM_FULL_COMMUNICATION ) {
    	actionlist channel1requestedActions/* channel 1 */
    }
}
actions channel1requestedActions on condition { /* channel 1 */
    PduGroupSwitch {
        init true
        enable 	ArMmExample.EcuC.MyCom.CAN1IPDUS_TX,
        		ArMmExample.EcuC.MyCom.CAN1IPDUS_RX
    }
}
rule channel2requested initially false {
    if ( ComM_Mode_Channel2 == COMM_FULL_COMMUNICATION ) {
    	actionlist channel2requestedActions/* channel 2 */
    }
}
actions channel2requestedActions on condition {/* channel 2 */
    PduGroupSwitch {
        init true
        enable 	ArMmExample.EcuC.MyCom.CAN2IPDUS_TX,
        		ArMmExample.EcuC.MyCom.CAN2IPDUS_RX
    }
}

Listing 3.19: ComM reports SILENT_COMMUNICATION

Listing 3.20: ComM reports NO_COMMUNICATION

PNC related I-PDU Group Handling

/* PNC 1 */
rule pnc1requested initially false {
    if ( PNC1 == PNC_REQUESTED || PNC1 == PNC_READY_SLEEP ) {
    	actionlist pnc1requestedActions
    }
}
actions pnc1requestedActions on condition {
    PduGroupSwitch {
        init true
        enable 	ArMmExample.EcuC.MyCom.PNC1IPDUS_TX,
        		ArMmExample.EcuC.MyCom.PNC1IPDUS_RX
    }
}
/* PNC 2 */
rule pnc2requested initially false {
    if ( PNC2 == PNC_REQUESTED || PNC2 == PNC_READY_SLEEP ) {
    	actionlist pnc2requestedActions
    }
}
actions pnc2requestedActions on condition {
    PduGroupSwitch {
        init true
        enable 	ArMmExample.EcuC.MyCom.PNC2IPDUS_CH1_TX,
                ArMmExample.EcuC.MyCom.PNC2IPDUS_CH1_RX,
                ArMmExample.EcuC.MyCom.PNC2IPDUS_CH2_TX,
                ArMmExample.EcuC.MyCom.PNC2IPDUS_CH1_RX
    }
}
/* PNC 3 */
rule pnc3requested initially false {
    if ( PNC3 == PNC_REQUESTED || PNC3 == PNC_READY_SLEEP ) {
        actionlist pnc3requestedActions
    }
}
actions pnc3requestedActions on condition {
    PduGroupSwitch {
        init true
        enable 	ArMmExample.EcuC.MyCom.PNC3IPDUS_TX,
        		ArMmExample.EcuC.MyCom.PNC3IPDUS_RX
    }
}

Listing 3.21: ComM reports PNC_REQUESTED or PNC_READY_SLEEP

Listing 3.22: ComM reports PNC_PREPARE_SLEEP

Listing 3.23: ComM reports PNC_NO_COMMUNICATION

J1939 Networkmanagement

In contrast to current AUTOSAR network management, the task of J1939 network management is not to handle sleep and wake-up of ECUs, but to assign unique addresses to each node represented by an ECU.

与目前的 AUTOSAR 网络管理不同,J1939 网络管理的任务不是处理 ECU 的休眠和唤醒,而是为 ECU 代表的每个节点分配唯一地址。

This is achieved by sending the AddressClaimed (AC, 0x0EE00) parameter group a start-up, which announces the desired address.

这是通过向 AddressClaim (AC,OxOEE00) 参数组发送启动来实现的,该启动会宣布所需的地址。

If another node claims the same address, and has higher priority, the node has to go silent after sending the Cannot ClaimAddress parameter group ((AddressClaim)AC with null address as SA), or try to use another address.

如果另一个节点声称相同的地址,并且具有更高的优先级,则该节点必须在发送 CannotClaimAddress 参数组 (空地址为 SA 的 AC) 后保持沉默,或者尝试使用另一个地址。

To support this use case the BswM is extended to accept state change indications from the J1939Nm via the API function BswM_J1939Nm_StateChangeNotification()(see also 3.2.2.2.15).

为了支持此用例,BswM 扩展为通过 API 函数 BswM_J1939Nm_StateChangeNotification (另参见 3.2.1.2.2.15) 接受来自 l1939Nm 的状态变化指示。

Depending on the state indicated by the network management the BswM needs to switch ComIPduGroups of COM, PduRRoutingPathGroups of PduR, and general request handling of the J1939Rm.

根据网络管理所指示的状态,BswM 需要切换 COM 的 ComIPduGroups 、PduR 的 PduRRoutingPathGroups 以及 J1939 RM 的通用请求。

The first two actions are realized via BswMPduGroupSwitch- and BswMPduRouter Control -actions. The J1939 Request Manager shall be switched using the BswMJ1939Rm action.

COM is expected to have IPDU groups containing all locally received and transmitted I-PDUs for each network. The PduR shall be configured in the same way, having RoutingPathGroups for all locally received and transmitted IPDUs for each channel, excluding the received I-PDU for the Request message forwarded to the J1939Rm.

COM 应具有包含每个网络所有本地接收和传输的 IPDU 的 IPDU 组。PduR 应以相同的方式进行配置,具有用于每个信道所有本地接收和传输的所有 IPDU 的 RoutingPathGroups,但不包括转发到 J1939Rm 的请求消息的接收 IPDU。

The BswM must then be configured to

然后,BSWM 必须配置

switch on and off the aforementioned IPDU groups

打开和关闭上述 IPDU 组

and PduRRoutingPathGroups depending on the reported NM states,

和依赖于 NM 状态的 PduRRoutingPathGroups

as well as general request handling of the J1939 Request Manager.

以及 J1939 请求管理器的一般请求处理。

J1939 diagnostic mode management

In addition to address assignment the BswM has also to supervise the sending of
broadcast messages in a J1939 environment. Each IPDU group represents the broadcast messages (J1939 PGs with PDU2 format PGN or PDU1 format PGN and broadcast destination address) of one network.

除了地址分配之外,BswM 还必须监督 J1939 环境中的广播消息的发送。每个 IPDU 组表示一个网络的广播消息 (J1939 PGs,具有 PDU2 格式 PGN 或 PDU1 格式 PGN 和广播目标地址)

For this purpose it is also expected that COM contains one IPDU group for each channel, which contains the broadcast messages of this ECU.

为此,还希望 COM 为每个信道包含一个 IPDU 组,该组包含该 ECU 的广播消息。

Listing 3.25: Rule to implement broadcast management according to J1939

rule J1939_broadcast_management initially false {
    if ( BswMJ1939DcmBroadcastStatus == NETWORK_ENABLED) {
    	actionlist J1939ActivateBroadcastActions
    } else {
    	actionlist J1939DeactivateBroadcastActions
    }
}
actions J1939ActivateBroadcastActions on condition {
    PduGroupSwitch {
        init true
        enable ArMmExample.EcuC.MyCom.J1939BroadcastIPDUS
    }
}
actions J1939DeactivateBroadcastActions on condition {
    PduGroupSwitch {
        disable ArMmExample.EcuC.MyCom.J1939BroadcastIPDUS
    }
}

LIN Schedule Table Switch

The BswM is able to switch the schedule tables LIN channels based on requests from Application SWCs.

BswM 能够根据应用程序 SWC 的请求切换调度表 LIN 通道。

The SWC requests a LIN schedule table from the BswM in form of an application mode. After the successful switch the BswM switches to the requested mode.

SWC 以应用模式的形式向 BSWM 请求 LIN 调度表。成功切换后,Bswm 切换到所请求的模式。

In the following, an example for this behavior is shown. At first, a ModeDeclarationGroup is needed which is used by the Application SWCs to request a certain schedule to which the LIN channel shall be switched.

下面显示了这种行为的示例。首先,需要一个模式声明组,该组由应用程序 SWC 用于请求 LIN 通道应切换到的特定时间表。

modeGroup MDG_LinScheduleTables {
    Schedule1,
    Schedule2
}

An enumeration containing the same values is needed for the SenderReceiverInterface between BswM and SWC.

BSWM 和 SWC 之间的 SenderReceiverInterface 需要一个包含相同值的枚举。

enum ENUM_LinScheduleTables {
    Schedule1,
    Schedule2
}

A ModeSwitchInterface is necessary to switch the application mode after the LIN schedule table was set.

在设置 LIN 调度表后,必须使用 ModeSwitchInterface 来切换应用程序模式。

interface modeSwitch LinScheduleMode {
	mode MDG_LinScheduleTables LinScheduleMode
}

Also a SenderReceiverInterface which uses the previously defined enumeration is needed. It can be used by the application SWC to request a mode that should lead to a LIN schedule table switch.

此外,还需要使用先前定义的枚举的 SenderReceiverInterface。应用程序 SWC 可以使用它来请求引导 LIN 调度表切换状态。

interface senderReceiver LinChannel1ScheduleTableRequestPort {
    data ENUM_LinScheduleTables LinScheduleMode
}

The following BswM rule switches the schedule table of a LIN channel when the application SWC request another application mode.

当应用程序 SWC 请求另一个应用程序模式时,以下 BswM 规则是切换 LIN 通道的调度表。

rule LinChannel1Schedule1Request initially false {
    if (LinChannel1ScheduleTableRequestPort == Schedule1)
    {
    	LinScheduleSwitch(LinSchedule1)
    }
}

The following BswM rule switches the application mode to the mode which was previously requested by the application. It is triggered when the LinSM notifies the BswM that a LIN schedule table switch occurred.

下列 BswM 规则将应用程序模式切换到先前由应用程序请求的模式。当 LINSM 通知 BSWM 发生了 LIN 调度表切换时,将触发该规则。

rule LinChannel1Schedule1Switched initially false {
    if (LinSM_CurrentState == LinSchedule1)
    {
    	RteSwitch(LinScheduleMode, Schedule1)
    }
}

And finally the corresponding rules for the LIN schedule table LinSchedule2:

最后为 LIN 进度表 LinSchedule2 提供了相应的规则:

rule LinChannel1Schedule2Request initially false {
    if (LinChannel1ScheduleTableRequestPort == Schedule2)
    {
    	LinScheduleSwitch(LinSchedule2)
    }
}
rule LinChannel2Schedule1Switched initially false {
    if (LinSM_CurrentState == Schedule2)
    {
    	RteSwitch(LinScheduleMode, LinSchedule2)
    }
}

Ethernet switch port group switching

For Ethernet switch port switching it is expected that EthSwtPorts are condensed to EthIfSwitchPortGroups. EthIfSwitchGroups could be derived from the SystemDescriptionExtract.

对于以太网交换机端口交换,希望把 EthSwtPorts 压缩为 EthIfSwitchPortGroups。 EthIfSwitchGroups 可以从 SystemDescriptionExtract 中派生。

According to the modelling each EthSwitchPortGroup is mapped to at least one PNC. The switching of EthIfSwitchPortGroup is realized with particular BswM rules.

根据该模型,每个 EthSwitchPortGroup 被映射到至少一个 PNC。
EthIfSwitchPortGroup 的切换是用特定的 BswM 规则实现的。

Therefore, ComM reports the current mode of a PNC via BswM_ComM_CurrentPNCMode. The mapping between PNCs and EthSwitchPortGroup is known by the BswM.

因此,ComM 通过 BswM_ComM_CurrentPNCMode 报告 PNC 的当前模式。PNCs 与 EthSwitchPortGroup 之间的映射由在 BswM 这 。

Thus, the BswM forward the reported current mode of a PNC to the EthIf by calling EthIf_SwitchPortGroupRequestMode with corresponding EthIfSwitchPortGroup.

因此,BSwM 通过调用具有相应 EthIfSwitchPortGroup 的 EthIf_SwitchPortGroupRequestMode 将报告的 PNC 当前模式转发到 Ethlf。

According to the given PortMode (either ETH_MODE_DOWN or ETH_MODE_ACTIVE) the EthIf manages the requests for EthIfSwitchPortGroups and decides to switch off or switch on EthSwtPorts.

根据给定的 PortMode (ETH_MODE_DOWN 或 ETH_MODE_ACTIVE),Ethlf 管理 EthIfSwitchPortGroups 的请求,并决定关闭或打开 EthSwtPorts。

To illustrate how the switching of EthIfSwitchPortGroups can be managed the following scenario is created. The exemplary ECU shall have two partial networks (named PNC1 and PNC2) and two according EthIfSwtPortGroups (named EthIfSwtPortGroup1 and EthIfSwtPortGroup2) configured:

为了说明如何管理 EthIfSwitchPortGroups 的切换,创建了以下场景。示例 ECU 应配置两个部分网络 (名称为 PNC1 和 PNC2) 和两个相应的 EthIfSwtPortGroups (名称为 EthIfSwtPortGroup1 和 EthIfSwtPortGroup2)

  • If PNC1 is requested,than EthIf_SwitchPortGroupRequestMode is called with EthSwtPortGroup1 and ETH_MODE_ACTIV
  • If PNC1 is released, than EthIf_SwitchPortGroupRequestMode is called with EthSwtPortGroup1 and ETH_MODE_DOWN
  • If PNC2 is requested, than EthIf_SwitchPortGroupRequestMode is called with EthSwtPortGroup2 and ETH_MODE_ACTIVE
  • If PNC2 is released,than EthIf_SwitchPortGroupRequestMode is called with EthSwtPortGroup2 and ETH_MODE_DOWN

If a partial network is requested than the corresponding EthSwtPortGroup is switched on.

如果请求的部分网络则打开相应的 EthSwtPortGroup

Listing 3.26: ComM reports the transition to COMM_PNC_FULL_COMMUNICATION

rule pnc1requested initially false {
    if ( PNC1 == COMM_PNC_REQUESTED ||
        PNC1 == COMM_PNC_READY_SLEEP ||
        PNC1 == COMM_PNC_PREPARE_SLEEP ){
        	actionlist pnc1requestedActions
    }
}
actions pnc1requestedActions on condition {
    EthIfSwitchPortGroupRequestMode {
        init false
        enable EthIfSwtPortGroup1
    }
}
rule pnc2requested initially false {
    if ( PNC2 == COMM_PNC_REQUESTED ||
        PNC2 == COMM_PNC_READY_SLEEP ||
        PNC2 == COMM_PNC_PREPARE_SLEEP ){
        	actionlist pnc2requestedActions
    }
}
actions pnc2requestedActions on condition {
    EthIfSwitchPortGroupRequestMode {
        init false
        enable EthIfSwtPortGroup2
    }
}

Listing 3.27: ComM reports COMM_PNC_NO_COMMUNICATION

Ethernet switch port group switching with wake-up request

AUTOSAR supports the handling for OA TC10 compatible Ethernet hardware to sleep/wake-up over dataline. In combination with PNC handling and the Ethernet switch port group switching, the ComM indicate the BswM for an active PNC request with a wake-up request by reporting COMM_PNC_REQUESTED_WITH_WAKEUP_REQUEST.

AUTOSAR 支持处理 OA TC10 兼容以太网硬件的休眠 / 唤醒数据线。结合 PNC 处理和以太网交换机端口组交换,ComM 通过 COMM_PNC_REQUESTED_WITH_WAKEUP_REQUEST 来指示 BswM 具有唤醒请求的活跃的 PNC 。

The BswM forwards the active PNC to the EthIf by calling EthIf_SwitchPortGroupRequestMode with the corresponding EthIfSwtPortGroup and the corresponding Eth_ModeType ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

BswM 通过调用 EthIf_SwitchPortGroupRequestMode,并将相应的 EthIfSwtPortGroup 和相应的 Eth_ModeType ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST 传递给 Ethlf,将活动的 PNC 转发给 Ethlf。

Based on the exemplary configuration in chapter 3.4.8 Ethernet switch port group switching, the following example illustrates the Ethernet switch port switching with wake-up on dataline request:

基于第 3.4.8 章以太网交换机端口组交换中的示例配置,下面的示例演示了在 dataline 请求时唤醒以太网的交换机的 port

  • If PNC1 is requested, than EthIf_SwitchPortGroupRequestMode is called with EthSwtPortGroup1 and ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST
  • If PNC2 is requested, than EthIf_SwitchPortGroupRequestMode is called with EthSwtPortGroup2 and ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST

If a partial network is requested and the Ethernet hardware supports and uses
the wake-up on dataline,

than the corresponding EthSwtPortGroup is switched
on

and the request for a wake-up over dataline is reported by the Eth_ModeType
ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST.

如果请求部分网络,并且以太网硬件支持并使用数据线上的唤醒,

则相应的 EthSwtPortGroup 被打开,

并且通过 Eth_ModeType ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST 报告对数据线上唤醒的请求。

rule pnc1requested_with_wakeup_request initially false {
    if ( PNC1 == COMM_PNC_REQUESTED_WITH_WAKEUP_REQUEST){
    	actionlist pnc1requested_with_wakeup_request_Actions
    }
}
actions pnc1requested_with_wakeup_request_Actions on condition
{
    EthIfSwitchPortGroupRequestMode {
        init false
        enable EthIfSwtPortGroup1
    }
}
rule pnc2requested_with_wakeup_request initially false {
    if ( PNC2 == COMM_PNC_REQUESTED_WITH_WAKEUP_REQUEST){
    	actionlist pnc2requested_with_wakeup_request_Actions
    }
}
actions pnc2requested_with_wakeup_request_Actions on condition
{
    EthIfSwitchPortGroupRequestMode {
        init false
        enable EthIfSwtPortGroup1
    }
}

Besides the management of requests for EthIfSwitchPortGroup switching, the EthIf supervises the accumulated link state per EthSwitchPortGroup. If the EthIf detects an unexpected change of the accumulated link state of the EthIfSwitchPortGroup, the EthIf indicates this link state change by calling BswM_EthIf_PortGroupLinkStateChg of the affected EthIfSwitchPortGroup. This indication could be forwarded to the application via a ModeSwitch to react on such communication errors scenarios (e.g. Ethernet switch port hardware error, loose connection of the dataline,... a.s.o.).

EthIf 也会去监控 port 的 link 状态,当 port link status 发生改变时,会调用 BswM_EthIf_PortGroupLinkStateChg () 来做一些处理。

PduR routing path group switching

PduR routing path group switching is used to switch routing path of I-PDUs which are not assigned to a Com I-PDU group (see chapter 3.4.4 I-PDU Group Switching),

e.g I-PDUs transmitted via LdCom. LdCom has not the capability to control I-PDU groups as it is provided by Com.

PduR 路由路径组交换用于交换未分配给 Com I-PDU 组的 L-PDUs 的路由路径 (请参阅第 3.4.4 节 I-PDU 组交换)

例如通过 LdCom 传输的 I-PDUs。LdCom 没有 Com 提供的控制 I-PDU 群的能力。

Therefore it is possible to control the affected PudR routing paths by configured PduR routing path groups (similar to I-PDU groups in Com).

因此,可以通过配置的 PduR 路由路径组 (类似于 com 中的 I-PDU 组) 来控制受影响的 PudR 路由路由。

The PduR routing path groups are controlled via the following API: PduR_EnableRouting(<routing path group id>) and PduR_DisableRouting(<routing path group id>).

俩 API

The APIs could be called by BswM based on particular BswM rules. This enable the switching of PduR routing path groups in combination with partial networking,

e.g. ComM indicate the current PNC state to BswM, BswM evaluate the trigger conditions of the dedicated BswM rules and trigger the BswM action (control the PduR routing path groups).

也就是说 ComM 告诉 BswM 当前 PNC 的状态,然后 BswM 根据你特定的规则去处理

Please note:

  • If I-PDUs should be controlled, then it is recommended to control Com I-PDUs via Com I-PDU groups and the remaining I-PDUs via switching of PduR routing path groups.

如果应该控制 I-PDUs

那么建议通过 Com I-PDU 组来控制 Com I-PDUs

通过切换 PduR 路由路径组来控制其余的 I-PDU。

The following scenarios illustrate how PduR routing path groups of an ECU can be managed. The exemplary ECU shall have one physical Ethernet channel with two VLANs and three partial network clusters.

下面的场景说明如何管理一个 ECU 的 PduR 路由路径组。示例 ECU 应有一个物理以太网信道与两个 VLAN 和三个部分网络集群。

The mode request ports for the VLANs are named EthSM_Vlan1 and EthSM_Vlan2, the request sources for the partial network clusters are named PNC1, PNC2 and PNC3. I-PDUs of PNC1 shall be communicated only over Vlan1. I-PDUs of PNC2 shall be communicated over Vlan1 and Vlan2. I-PDUs of PNC3 shall be communicated only over Vlan2. In case of an indication by a bus state manager the BswM shall check, which partial network clusters are requested.

Listing 3.29: Active wakeup on channel

rule activeWakeupVlan1 initially false {
    if ( EthSM_Vlan1 == ETHSM_BSWM_FULL_COMMUNICATION){
    	actionlist activeWakeupVlan1Actions
    }
}
actions activeWakeupVlan1Actions on condition{
	rule pnc1requested rule pnc2requested
}
rule activeWakeupVlan2 initially false{
    if ( EthSM_Vlan2 == ETHSM_BSWM_FULL_COMMUNICATION &&
    PNC2 != PNC_REQUESTED &&
    PNC3 != PNC_REQUESTED ) {
    	actionlist activeWakeupVlan2Actions
    }
}
actions activeWakeupVlan2Actions on condition{
    rule pnc2requested rule pnc3requested
}

If the bus state manager reports that a VLAN is going offline the BswM disable the corresponding I-PDU routing path groups. If the channel is part of a partial network the whole partial network has to be disabled.

如果总线状态管理器报告 VLAN 即将下线,则 BswM 应禁用相应的 I-PDU 路由路径组。如果信道是部分网络的一部分,则必须禁用整个部分网络。

Listing 3.30: EthSM reports NO_COMMUNICATION

rule offlineVlan1 initially false {
if (EthSM_Vlan1 == ETHSM_BSWM_NO_COMMUNICATION){
	actionlist offlineVlan1Actions }
}
actions offlineVlan1Actions on condition {
PduRRoutingPathGroupSwitch{
    init true disable ArMmExample.EcuC.MyPduR.VLAN1_IPDU_ROUTING_PATHS,
    ArMmExample.EcuC.MyPduR.PNC1_IPDU_ROUTING_PATHS, ArMmExample.EcuC.MyPduR
    .PNC2_IPDU_ROUTING_PATHS }
}
rule offlineVlan2 initially false {
    if ( EhtSM_Can2 == CANSM_BSWM_NO_COMMUNICATION ) {
        actionlist offlineVlan2Actions
    }
}
actions offlineVlan2Actions on condition {
    PduRRoutingPathGroupSwitch {
        init true disable ArMmExample.EcuC.MyPduR.VLAN2_IPDU_ROUTING_PATHS,
            ArMmExample.EcuC.MyPduR. PNC2_IPDU_ROUTING_PATHS, ArMmExample.EcuC.
            MyPduR.PNC3_IPDU_ROUTING_PATHS
    }
}

In case that a single partial network cluster is released the I-PDU routing path group representing this network has to be disabled.

如果释放了单个部分网络集群,则必须禁用表示该网络的 I-PDU 路由路径组。

Listing 3.31: PNC reports NO_COMMUNICATION

rule pnc1nocom initially false {
    if ( PNC1 == PNC_NO_COMMUNICATION ) {
    	actionlist pnc1nocomTrueActions
    }
}
actions pnc1nocomActions on condition {
    PduRRoutingPathGroupSwitch {
    	init true disable ArMmExample.EcuC.MyPduR.PNC1_IPDU_ROUTING_PATHS
    }
}
rule pnc2nocom initially false {
    if ( PNC2 == PNC_NO_COMMUNICATION ) {
    	actionlist pnc2nocomTrueActions
    }
}
actions pnc2nocomActions on condition {
    PduRRoutingPathGroupSwitch {
    	init true disable ArMmExample.EcuC.MyPduR.PNC2_IPDU_ROUTING_PATHS
    }
}
rule pnc3nocom initially false {
    if ( PNC3 == PNC_NO_COMMUNICATION ) {
    	actionlist pnc3nocomActions
    }
}
actions pnc3nocomActions on condition {
    PduRRoutingPathGroupSwitch {
    	init true disable ArMmExample.EcuC.MyPduR.PNC3_IPDU_ROUTING_PATHS
    }
}

If a partial network cluster is requested the corresponding I-PDU routing path groups are enabled.

如果请求部分网络集群,则启用相应的 1-PDU 路由路径组。

Listing 3.32: PNC reports PNC_REQUESTED or PNC_READY_SLEEP

rule pnc1requested initially false {
    if ( PNC1 == PNC_REQUESTED ||
    PNC1 == PNC_READY_SLEEP )
    { actionlist pnc1requestedActions }
}
actions pnc1requestedActions on condition {
    PduRRoutingPathGroupSwitch
    { init true enable ArMmExample.EcuC.MyPduR.PNC1_IPDU_ROUTING_PATHS }
}
rule pnc2requested initially false {
    if ( PNC2 == PNC_REQUESTED ||
    PNC2 == PNC_READY_SLEEP )
    { actionlist pnc2requestedActions }
}
actions pnc2requestedActions on condition {
    PduRRoutingPathGroupSwitch
    { init true enable ArMmExample.EcuC.MyPduR.PNC2_IPDU_ROUTING_PATHS }
}
rule pnc3requested initially false
    { if ( PNC3 == PNC_REQUESTED || PNC3 == PNC_READY_SLEEP ) { actionlist
    pnc3requestedActions }
}
actions pnc3requestedActions on condition
    { PduRRoutingPathGroupSwitch { init true enable ArMmExample.EcuC.MyPduR.
    PNC2_IPDU_ROUTING_PATHS }
}

Service Discovery Control

AUTOSAR offers a standard mean to control Service Oriented Communication by Application Software Components. It makes use of the generic means to do mode management with BswM.

AUTOSAR 提供了一种通过应用软件组件来控制面向服务的通信的标准方法,它利用通用的方法来使用 BswM 进行模式管理。

To achieve a standard interface and behavior, the Mode Request Ports and Mode Switch Interfaces are standardized together with a configuration description for the BswM (see [4] Specification of Basic Software Mode Manager, chapter 7.8). This way not only the interfaces but also the expected behavior is well defined.

为了实现标准的接口和行为,将模式请求端口和模式切换接口与 BswM 的配置描述一起标准化 (参见 [4] 基本软件模式管理器规范,第 7.8 章). 这样不仅接口定义得很好,而且预期的行为也很好的定义了。

The configuration description is meant to be used for the tooling to generate a matching set of rules and actionlists to provide the actual control of service discovery.

配置描述旨在用于工具生成一组匹配的 rules 和 actionlists ,以提供对服务发现的实际控制。

Both auto-offer/auto-subscribe as well as an own project-specific approach can be used in parallel.

Only exception is, that if auto-offer/auto-subscribe is used,

no applicative control is possible for the same service instance on the same ECU.

auto-offer/auto-subscribe 以及自己项目的特定方法都可以并行使用。

唯一的例外是,如果使用 auto-offer/auto-subscribe,则不可能对同一 ECU 上的同一服务实例进行应用控制。

image-20240814155205768

In order to be able to use the standard means for Service Discovery control, it has to be taken into account already at design time of the Application-SWCs.

为了能够使用标准的服务发现控制手段,在应用程序 - SWC 的设计时就必须考虑到这一点。

While the fact that the use cases are required must be known at design time, the actual interfaces are completely agnostic to which SOA technology they will be applied.

虽然在设计时必须知道需要用例这一事实,但实际的接口完全不知道会被应用到哪个 SOA 技术。

image-20240814155658948

For a SWC to be able to request the subscription to one or more events a corresponding S/R-port is needed.

对于 SWC 要能够请求订阅一个或多个活动,就需要相应的 S/R port。

The fact that this port shall be used to interact with ServiceDiscovery is expressed by setting ServiceNeedsKind to BswMgrNeeds.

通过将 ServiceNeedsKind 设置为 BswMgrNeeds 来表示该端口应用于与 ServiceDiscovery 交互.

The kind of interaction is determined by the RoleBasedDataAssignment which could be one of

  • ClientEventSubscription
  • ClientEventSubscriptionStatus
  • ServerServiceOffer
  • ServerEventSubscriptionStatus

有这么几个类型的交互种类

The mapping to the actual payload ports (i.e. events/methods) is provided by referencing all Event-/Method-Ports relevant for this request/notification in RepresentedPort Group.

image-20240814160230207

The mapping is done at design time.

image-20240814160522126

# 3.5 Diagnostics

In AUTOSAR release 4.0.3 onwards the DCM is the overall mode manager for all diagnostic use cases. The BswM is responsible to change the state of the other basic software modules accordingly.

在 AUTOSAR4.0.3 版之后,DCM 是所有诊断用例的总体模式管理器,BswM 负责相应地改变其他基本软件模块的状态。

Diagnostic Session Control

例子

Listing 3.33: ModeGroup for session control service of the DCM

modeGroup DcmDiagnosticSessionControl {
    DefaultSession,
    ProgrammingSession,
    ExtendedDiagnosticSession,
    SafetySystemDiagnosticSession,
    AllSessionLevel
}
interface modeSwitch MSIF_DcmDiagnosticSessionControl {
    mode DcmDiagnosticSessionControl diagnosticSessionControl
}

The DCM acting as a mode manager can inform other BSW modules about the current mode of the session control service and if needed set the basic software in the
corresponding mode.

DCM 作为模式管理器,可以将会话控制服务的当前模式通知其他 BSW 模块并在需要时将 Bsw 设置在相应的模式中。

Listing 3.34: ModeRequestPort for session control service of the DCM

request BswModeNotification DiagnosticSessionControl {
    source MSIF_DcmDiagnosticSessionControl.diagnosticSessionControl
    processing IMMEDIATE
    initialValue DefaultSession
}

ECU Reset

In case of ECU Reset, the interaction between DCM and BswM is more complex. The Specification of the Diagnostic Communication Manager [5] specifies for this purpose the interface as described in listing 3.35. Via this interface the DCM signals the BswM to

  1. prepare the ECU to execute a specific reset.
  2. to explicitly execute this reset.

在 ECU reset 的情况下,DCM 与 BswM 的交互更加复杂。诊断通信管理器规范 [5] 为此目的指定清单 3.35 中描述的接口。通过该接口,DCM 向 BswM 发送信号到
1. 为 ECU 执行特定 reset 做好准备。
2. 以显式执行此 reset。

Listing 3.35: Mode switch interface for ECU reset diagnostic service

modeGroup DcmEcuReset{
    NONE,
    HARD,
    KEYONOFF,
    SOFT,
    JUMPTOBOOTLOADER,
    JUMPTOSYSSUPPLIERBOOTLOADER ,
    EXECUTE
}
interface modeSwitch MSIF_DcmEcuReset {
    mode DcmEcuReset ecureset
}

[SWS_Dcm_00373] states that on reception of a request for UDS Service with the sub functions other than enableRapidPowerShutDown (0x04) or disableRapidPower ShutDown (0x05), the DCM module shall switch the ModeDeclarationGroupPrototype DcmEcuReset to the received resetType. After the mode switch is requested the DCM triggers the start of the positive response message transmission.

好像是废话哈哈哈

Rapid Power Shutdown

enableRapidPowerShutdown (0x04) or disableRapidPowerShutdown (0x05)

这个控制的,当然如果有特定的下电序列,也可以提供给 BswM

Communciation Control diagnostic service

If the DCM reports to the BswM that a specified communication control mode is entered, the BswM has to enable resp. disable the corresponding IPDU groups as shown in listing 3.38.

如果 DCM 向 BswM 报告输入了指定的通信控制模式,则 Bswm 必须启用 resp. 禁用相应的 IPDU 组

Control DTC Setting

Listing 3.39: Mode switch interface for Control of DTC setting

modeGroup DcmControlDTCSetting {
    ENABLEDTCSETTING,
    DISABLEDTCSETTING
}
interface modeSwitch MSIF_DcmControlDtcSetting {
    mode DcmControlDTCSetting dtcSetting
}

Roe Status

The Dcm will switch the current status of the Roe per configured Roe Event via a mode switch of ModeDeclarationGroupPrototype DcmResponseOnEvent_<RoeEventID> switching the mode to EVENT_STARTED, EVENT_STOPPED and EVENT_CLEARED.

The information is necessary mainly for applications that need to interact with the Dcm if the events shall be triggered from external.

Dcm 将通过模式开关 ModeDeclarationGroupPrototype DcmResponseOnEvent_ <Roe EventID> 将 Roe 事件的当前状态切换为 EVENT_STARTED、EVENT_STOPPED 和 EVENT_CLEARED,以配置 Roe 事件。

如果事件要从外部触发,这些信息主要对需要与 DCM 交互的应用程序是必要的。

Listing 3.40: Mode switch interface for Roe Status

ModeGroup DcmResponseOnEvent_<RoeEventID> {
    EVENT_STARTED,
    EVENT_STOPPED,
    EVENT_CLEARED
}
interface modeSwitch MSIF_DcmResponseOnEvent{
    mode DcmResponseOnEvent currentMode
}

# 3.6 BswM to BswM interaction on multicore ECUs

The BswM mainly interacts with the state managers of the functional clusters, e.g. with the ComM, and should therefore be locally available on the same partition in order to limit inter-core communication as much as possible.

BswM 主要与功能集群的状态管理器进行交互,例如与 ComM 进行交互,因此应该在同一分区上本地可用,以尽可能限制内核之间的通信。

Therefore, the BswM can be distributed over multiple partitions containing BSW modules. These independent BswMs have partition specific configuration sets. The synchronization of the different partition local BswM instances can be accomplished by normal mode-communication (mode request, mode switch) between BswM service components.

因此,BSwM 可以分布在包含 BSW 模块的多个分区中。这些独立的 BswMs 具有分区特定的配置集。不同分区本地 BswM 实例之间的同步可以通过 BswM 服务组件之间的正常模式通信 (模式请求,模式切换) 来实现。

If a partition of the ECU contains BSW modules running inside the partition, the partition would also have a partition local BswM.

如果 ECU 的分区包含在该分区内部运行的 BSW 模块,则该分区也将有一个分区本地 BsWM。

A partition local BswM is responsible for the complete initialization of the BSW Modules within its partition. As the initialization sequence largely depends on the distribution of the modules in different partitions, this has a big impact on the configuration of all partition local BswMs.

分区本地 BSwM 负责其分区内的 BSW 模块的完整初始化。每个分区内的 BswM 的配置很关键

Each partition local BswM has the job of coordinating the initialization of the BSW modules which are running in its partition.

每个分区本地 BSwM 负责协调在其分区中运行的 Bsw 模块的初始化。

Each instance of the BswM will then take care of the correct initialization and deinitialization of the partition local BSW modules, so that the following scenarios can be realized:

然后,BswM 的每个实例将处理分区本地 Bsw 模块的正确初始化和去初始化,从而可以实现以下场景:

  • Startup up: After startup of the OS, each EcuM will hand over control to the partition local BswM, which then takes care of the initialization of the other partition local BSW Modules. Afterwards, the partition local BswM signals the readiness of the partition to the other BswM instances running in other partitions. This signalling is done using normal mode-communication between the BswM service components.
  • Shutdown: The partition local BswM determines via its ModeRequestSources, whether it can be shut down or not. If this is the case, it signals its current state to the other BswM instances running in other partitions. This signalling is done using normal mode communication between the BswM service components. The BswM placed inside the partition of the Master EcuM can then decide on this information whether it initiates a shutdown of the ECU.
  • Deinitialization: The BswM (on the partition where the Master EcuM is running inside) can signal the other BswMs that it wants to shutdown the ECU. This signalling is done using normal mode-communication between the BswM service components. The other BwsMs can then deinitialize the modules running inside their partition in order to enable a clean shutdown.
  • Restart of a partition: If a partition is restarted, the local BswM signals to the other BswM instances that it is in a restart mode. This signalling is done using normal mode communication between the BswM service components. Then, the other BswMs can determine if local applications need to be informed or potentially restarted, and how to synchronize them to the newly started partition.

# 3.7 Inter-partition Actions

The BswM does not implement mechanisms to prevent the execution of actions which affect modules residing on another partition.

BswM 不实现阻止执行影响驻留在另一分区的模块的操作的机制。

The configurator of the BswM needs to be aware of this during the configuration of BswM actions. Generally, the BswM can safely execute actions which affect its own partition, but special consideration on the part of the configurator must be given when configuring a BswM action which affects another partition.

在配置 BswM 操作时,BswM 的配置器需要意识到这一点。一般来说 BswM 可以安全地执行影响其自身份区的操作,但当配置影响另 - 个分区的 BswM 操作时必须特别考虑配置器的部分。

When configuring a cross-partition action, care must be taken to ensure tha the cross-partition action (in implementation, a function call to another partition) can be executed safely and without endangering system performance or stability.

当配置跨分区操作时,必须注意确保跨分区操作 (在实现中,对另一个分区的函数调用) 可以安全地执行,并且不会危及系统性能或稳定性。

If necessary, the implementor of a function needs to state limitations with respect to its usage(e.g. ’not prepared to be called cross-partition with memory protection enabled’).

如果有必要,函数的实现者需要对它的使用状态进行限制 (例如不准备在启用内存保护的情况下被称为交叉分区’)。

Among other things, the following issues need to be considered on the part of the configurator of cross-partition actions: memory protection, stopping/restarting of partitions, and proper preparation of the callee’s (i.e. the recipient of the action) partition.

跨分区操作的配置器需要考虑以下问题:内存保护、分区停止重新启动以及正确准备被调用方 (即操作的接收方) 的分区。

# 3.8 Inter-partition Requests/Indications

If the BswM is integrated in a multi-partition ECU, mode requests and/or mode indications could possibly be sent across partition boundaries to the BswM.

如果 BswM 集成在多分区 ECU 中,则可能跨分区边界向 BswM 发送模式请求和 / 或模式指示。

In the case of a mode request/indication which crosses a partition via the Rte (e.g. BswMSwcModeRequest), the configurator does not need to take special considerations regarding system stability or data consistency, the Rte handles the communication of this type of cross-partition mode request/indication.

如果模式请求 / 指示通过 Rte 跨越分区 (例如 BswMSwcModeRequest),则配置器不需要特别考虑系统稳定性或数据一致性,Rte 会处理此类跨分区模式请求 / 指示的通信。

However, if the cross-partition mode request/indication comes directly from a BSW module (e.g. BswMComMIndication) or from a generic source (e.g. BswMGenericRequest), the configurator must take special considerations, for example:

  1. When the configurator uses memory protection, memory sections which are in volved in cross-partition mode requests/indications (e.g. BswM-internal status flags) need to be configured to allow such cross-partition access.

  2. Cross-partition Mode requests/indications which are configured with IMMEDIATE processing may also trigger an immediately executed actionlist. The resultant actions will be executed in the context of the caller (e.g. a BSW module in another partition). For these IMMEDIATE cross-partition mode requests/indication, the same issues as in chapter "Inter-partition Actions" also need to be considered.

然而,如果跨分区模式请求 / 指示直接来自 BSW 模块 (例如 BswMComMIndication) 或来自通用源 (例如 BswMGenericRequest) 那配置得特殊考虑例如:

  • 当配置器使用内存保护时,涉及跨分区模式请求 / 指示的内存段 (例如 BswM - 内部状态标志) 需要进行配置以允许此类跨分区访问。
  • 配置了 IMMEDIATE 处理的跨分区模式请求 / 指示也可能触发立即执行的动作列表。产生的动作将在调用者的上下文中执行 (例如,另一个分区中的 BSW 模块)。对于这些 IMMEDIATE 跨分区模式请求 / 指标,还需要考虑 “跨分区操作” 章中的相同问题。

# ModeManagement

# 1 Scope of Document

The goal of this document is to define the functional and non-functional requirements for all modules of the AUTOSAR mode management:

  • ECU State Manager [2] (EcuM) which manages startup and shutdown of the ECU. This includes triggering the shutdown when all requests for run are released;
  • Watchdog Manager [3] (WdgM) which collects the indications of aliveness and correct execution order from the independent applications and relays them to the hardware watchdog in a suitable way;
  • Communication Manager [4] (ComM) which coordinates the communication of the independent applications.
  • Basic Software Mode Manager (BswM) which organizes mode handling and mode related interaction of SW-Cs and the BSW modules.

All modules are needed if more than one independent software component resides on the ECU.

本文档的目标是定义 AUTOSAR 模式管理的所有模块的功能和非功能要求:

  • ECU 状态管理器(ECUM)
    • 管理 ECU 的 startup 和 shutdown ,包括在所有的运行请求被释放后执行 shutdown.
  • 看门狗管理器(WdgM)
    • 从独立应用程序中收集可靠和正确的执行命令的指示,并以适当的方式将其转发给硬件监督机构;
  • 通信管理器(ComM)
    • 负责协调独立应用程序的通信。
  • 基本软件模式管理器 (BSWM)
    • 用于组织模式处理和 SWC 和 BSW 模块的模式相关交互。

# 4 Requirements Specification

# 4.1 ECU State Manager (EcuM)

The ECU State Manager [2] is a basic software module that manages the ECU states and the transitions between these states.

It manages all wake-up events and configures the ECU for SLEEP when requested.

ECU 状态管理器是一个基本的软件模块,用于管理 ECU 状态和这些状态之间的转换。

它管理所有唤醒事件,并根据睡眠的请求配置 ECU。

The ECU State Manager [2] shall support individual preparation-activities and transitions to bring up the ECU or put it into a decreased power mode (low-power mode,e.g. sleep / standby).

By a well defined usage of ECU State Manager [2] features and capabilities, this module can then be used to perform a pre-defined strategy of power-consumption, thus allowing efficient energy management for the ECU.

ECU 状态管理器 [2] 应支持单个准备活动和过渡活动,以启动 ECU 或将其放入降低功率模式 (低功率模式,例如睡眠 / 待机)。通过明确定义使用 ECU 状态管理器 [2] 该模块具有功能和能力,可用于执行预先定义的功耗策略,从而为 ECU 实现高效的能源管理。

Configuration (Common)

[SRS_ModeMgm_09122] Configuration of users of the ECU State Manager

所有的状态切换都是用户配置的,所以预先配置好,不是预期的状态切换不予响应

[SRS_ModeMgm_09100] Selection of wake-up sources shall be configurable

唤醒源可配置的

Depending on the ECU, the allowed wake-up source may vary:

  • reception of a CAN frame,
  • direct input(s),
  • either CAN frames or direct inputs,
  • 等等

Normal Operation (Common)

[SRS_ModeMgm_09104] ECU State Manager shall take over control after OS shutdown

OS 关闭后由 ECUM 接管。因为 OS 启动也是由 ECUM 启动的。

[SRS_ModeMgm_09128] Several shutdown targets shall be supported

支持配置几个 shutdown 目标

Power Off

Reset of ECU

Sleep Modes

[SRS_ModeMgm_09270] The ECU State Manager shall provide a service for the selection of the shutdown target

服务化吧

[SRS_ModeMgm_09271] The ECU State Manager shall provide a service for the retrieval of the current shutdown target

能检索当前的 shutdown 目标,就增删改查呗

[SRS_ModeMgm_09119] Several sleep modes shall be available

[SRS_ModeMgm_09102] API for selecting the sleep mode shall be provided

[SRS_ModeMgm_09272] The ECU State Manager shall provide a service for the retrieval of the last sleep targets

跟 sleep 的实现和 shutdown 一样的标准

[SRS_ModeMgm_09072] ECU shutdown shall be forced

要有一个强制关机的接口

[SRS_ModeMgm_09017] The ECU State Manager shall provide an API to query the current ECU state

查询 ECU 状态的接口

[SRS_ModeMgm_09136] The ECU State Manager shall be the receiver of all wake up events

ECUM 是所有唤醒事件的接收者,废话整个芯片的状态都是 ECUM 说了算

[SRS_ModeMgm_09098] Storing the wake-up reasons shall be available

要存储下来当前的唤醒原因,也可以通过外部通信获取

[SRS_ModeMgm_09097] The ECU State Manager module shall start a timeout after receiving a wake-up indication

要有一个唤醒验证的操作,并有超时处理。

[SRS_ModeMgm_09126] An API for querying the wake-up reason shall be provided

可以获取最近的唤醒原因

[SRS_ModeMgm_09274] The ECU State Manager shall provide a service for the retrieval of the selected reset modality

[SRS_ModeMgm_09274] The ECU State Manager shall provide a service for the retrieval of the selected reset modality

[SRS_ModeMgm_09101] An API to query the reset reason shall be provided

[SRS_ModeMgm_09276] The ECU State Manager shall provide a service allowing the selection of the boot target

[SRS_ModeMgm_09275] The ECU State Manager shall provide a service for querying the time of previous resets

一堆接口要支持

[SRS_ModeMgm_09127] The ECU State Manager shall de-initialize Basic Software modules where appropriate during the shutdown process

ECUM 要在 shutdown 的过程中协助 bsw 去初始化。

[SRS_ModeMgm_09116] Requesting and releasing the RUN state shall be provided

要提供请求和释放 RUN 状态的接口

Fixed

Please note that the Specification of ECU State Manager [2] with fixed state machine is not part of this Release anymore.

The ECU State Manager [2] Fixed is a variant of the EcuM which has a fixed set of states: OFF, RUN, SLEEP and transient states: STARTUP, WAKEUP, SHUTDOWN).

也是 ECUM 的状态,不过规范了并固定了几种状态

[SRS_ModeMgm_09120] Configuration of initialization process of Basic Software modules shall be available

[SRS_ModeMgm_09147] Configuration of de-initialization process of Basic Software modules shall be provided

[SRS_ModeMgm_09146] Configuration of time triggered increased inoperation shall be provided

[SRS_ModeMgm_09001] The number and names of main states and the transitions between main states shall be standardized.

[SRS_ModeMgm_09173] A Run State shall have a minimum duration

[SRS_ModeMgm_09114] Starting/invoking the shutdown process shall be provided

[SRS_ModeMgm_09113] Initialization of Basic Software modules shall be done

[SRS_ModeMgm_09009] The ECU State Manager shall provide the ability to execute external, statically-configured code at each transition between ECU states

[SRS_ModeMgm_09118] The ECU State Manager shall provide a mechanism to enter a step by step decreasing power mode

支持分级别低功耗

[SRS_ModeMgm_09115] The ECU State Manager shall include a mechanism to evaluate the condition to stay in the RUN state

状态管理要可以判断可以保持在 RUN 的条件

[SRS_ModeMgm_09164] Shutdown synchronization for SW-Components shall be supported

支持 SWC 的 shutdown 同步

[SRS_ModeMgm_09165] The ECU State Manager shall provide services to request and release the POST-RUN state

[SRS_ModeMgm_09166] The ECU State Manager shall evaluate the condition to stay in the POST-RUN state

[SRS_ModeMgm_09145] Wake-sleep operation shall be supported

Flex

[SRS_ModeMgm_09234] The EcuM shall handle the initialization of Basic Software modules

[SRS_ModeMgm_09235] The ECU State Manager shall offer two targets for shutting down the ECU

[SRS_ModeMgm_09185] A persistent Alarm Clock used by local SW-Cs shall be provided

[SRS_ModeMgm_09186] Alarm Clock shall be active while the ECU is powered

[SRS_ModeMgm_09187] In Case of wakeup, all the alarm clock shall be canceled

[SRS_ModeMgm_09188] In Case of startup, all the alarm clock shall be canceled

[SRS_ModeMgm_09189] Consecutive requests shall honor the earliest expiring alarm only

[SRS_ModeMgm_09190] The alarm clock service shall allow setting an alarm relative to the current time using a time resolution of seconds

[SRS_ModeMgm_09199] The alarm clock service shall allow setting an alarm absolute by using an absolute time with a resolution of seconds

[SRS_ModeMgm_09194] The alarm clock service shall allow setting the clock

[SRS_ModeMgm_09277] The ECU State Manager shall provide an alarm clock service which shall allow the retrieval of clock values

自我感觉没那么重要

[SRS_ModeMgm_09236] There shall be one instance of the function EcuM_Init that distinguishes between the different cores

要区分多核,只有 master 核可以启动其他核心。

[SRS_ModeMgm_09237] RTE_Start shall be called on each core.

RTE [7]_Start shall be called locally on each core by means of tasks triggered by the BswM on the main core through dedicated available actions.

RTE_Start 应通过主核心上的 BswM 通过专用可用动作触发的任务在每个核心上本地调用,每个核心都需要初始化,且需要同步,避免其他核提前进入 OS 调度

[SRS_ModeMgm_09238] State changes shall be ECU global

Only the entire ECU changes into either

  • "off",
  • "fully functional"
  • or "sleeping"(halted or set to poll)

[SRS_ModeMgm_09239] To shutdown, ShutdownAllCores shall be called on the
master core after synchronizing all cores

关闭也需要同步

[SRS_ModeMgm_09254] Validation and handling of a wakeup event shall be done locally

唤醒事件也要在本核心上

# 4.2 Watchdog Manager

Functional Overview

The Watchdog Manager [3] is a basic software module of the standardized basic software architecture of AUTOSAR (service layer).

看门狗管理器是 AUTOSAR (服务层) 标准化基本软件架构的 BSW 模块

It is intended to supervise the reliability of application execution with respect to timing constraints (temporal program flow monitoring) and with respect to the correct sequence of execution (logical program flow monitoring).

旨在监督应用程序执行的可靠性,包括时间约束 (时间程序流程监控) 和执行的正确顺序 (逻辑程序流程监控)

Derived from the layered architecture approach [9], a decoupling between application timing constraints and watchdog hardware timing constraints becomes possible.

源自分层架构方法,使得应用程序定时约束和看门狗硬件定时约定之间的解耦成为可能。

Based on this decoupling the Watchdog Manager [3] provides temporal program flow monitoring (alive-supervision) of several independent applications as well as logical program flow monitoring (the supervision of the correct execution order) while triggering the watchdog hardware.

基于这种解耦,Watchdog Manager 在触发看门狗硬件时,提供对几个独立应用程序的时间程序流监控 (alive-supervision) 以及逻辑程序流监控 (对正确执行顺序的监督)。

The following features are provided by the Watchdog Manager

  • Supervision of multiple individual applications located on the ECU, having in dependent timing constraints and requiring a special supervision of runtime be haviour and aliveness.
  • Logical supervision of safety-related tasks and periodic functions (main functions).
  • Fault-reaction mechanism for each independent supervised entity.
  • Possibility to switch off supervision of individual applications, without violating the watchdog triggering (e.g. for inhibited applications).
  • Triggering of internal or external, standard or window, watchdog, via a watchdog driver. The access to the internal or external watchdog will be handled by the Watchdog Interface.
  • Selection of the watchdog mode (Off Mode, Slow Mode, Fast Mode) depending on the ECU state and the hardware capabilities.

看门狗的特性

Functional Requirements

[SRS_ModeMgm_09107] The Watchdog Manager shall provide an initialization service

[SRS_ModeMgm_09109] It shall be possible to prohibit the disabling of watchdog

应该可以禁止失能看门狗

[SRS_ModeMgm_09112] The Watchdog Manager shall cyclically check the periodicity of the supervised entities

[SRS_ModeMgm_09221] The Watchdog Manager shall check the correct sequence of code execution in supervised entities

看门狗管理器不仅检查代码的执行时间还检查执行时序

[SRS_ModeMgm_09125] The Watchdog Manager shall provide a service allowing the Update temporal program flow monitoring

[SRS_ModeMgm_09222] The Watchdog Manager shall provide a service allowing the Update logical program flow monitoring

要在检查点那里做 trace

[SRS_ModeMgm_09160] The Watchdog Manager shall provide the indication of failed temporal monitoring

要有失败的指示,提醒 SWC 或其他模块

[SRS_ModeMgm_09161] The Watchdog Manager shall reset the triggering condition in the Watchdog Driver in Case of temporal failure

没看懂啥意思

[SRS_ModeMgm_09226] The Watchdog Manager shall reset reset the triggering condition in the Watchdog Driver in Case of logical program flow violation

程序流错误时看门狗触发

[SRS_ModeMgm_09169] The Watchdog Manager shall be able to immediately reset the MCU

[SRS_ModeMgm_09162] The Watchdog Manager shall be able to notify the software of an upcoming watchdog reset

就是看门狗触发时可以通知到其他软件

[SRS_ModeMgm_09163] It shall be possible to configure a delay before provoking a watchdog reset

可以配置看门狗触发后延时多久后重启

[SRS_ModeMgm_09143] The Watchdog Manager shall set the triggering condition during inactive monitoring

[SRS_ModeMgm_09231] The Watchdog Manager shall periodically set the triggering condition in the Watchdog Driver as long as the monitoring has not failed

要设置触发条件,同时也要定期去设置看门狗的触发条件

[SRS_ModeMgm_09110] The watchdog Manager shall provide a service interface, to select a mode of the Watchdog Manager

有几个模式

  • off
  • slow
  • fast

[SRS_ModeMgm_09028] The Watchdog Manager shall support multiple watchdog instances****

支持多个看门狗实现,感觉这个思想真的吊

[SRS_ModeMgm_09233] The Watchdog Manager shall support independent triggering condition values for each watchdog instance

每个看门狗都有自己的配置和触发条件

[SRS_ModeMgm_09232] The Watchdog Manager shall provide a service to cause a watchdog reset

[SRS_ModeMgm_09106] The list of entities supervised by the Watchdog Manager shall be configurable at pre-compile time

[SRS_ModeMgm_09220] It shall be possible to configure all the transition relations

[SRS_ModeMgm_09158] The Watchdog Manager shall support Post build time and mode dependent selectable configuration sets for the Watchdog Manager

[SRS_ModeMgm_09223] The Watchdog Manager shall support Post build time and mode dependent selectable configuration of transition relations

总之就是配配配

Fault Operation

[SRS_ModeMgm_09159] The Watchdog Manager shall report failure of temporal or program flow monitoring to DEM

有报错机制

# 4.3 Communication Manager

Functional Overview

The Communication Manager [4] collects and coordinates the communication access requests from communication requestors (users, see glossary).

通讯管理收集和协调来自通信请求者 (用户,请参见术语表) 的通信访问请求。

The purpose of the Communication Manager [4] is:

  • Simplifying the usage of the communication protocol stack for the user. This includes the starting and stopping physical channel communication and a simplified network management handling.
  • Temporarily disabling sending of messages to prevent the ECU from (actively) waking up the physical channel(s).
  • Controlling of more than one physical channels of an ECU by implementing a state machine for every physical channel.
  • Requesting the appropriate communication state to the BusState Manager
  • Simplifying the resource management by allocating all resources necessary for the requested communication mode.

ComM 有这么几个目的

  • 简化了用户对通信协议栈的使用,包括物理信道通信的启动和停止以及简化的网络管理处理
  • 暂时禁用发送消息,以防止 ECU (主动) 唤醒物理信道。
  • 通过为每个物理通道实现状态机来控制 ECU 的多个物理通道。
  • 向 BusState Manager 请求适当的通信状态
  • 通过分配所请求的通信模式所需的所有资源,简化了资源管理。

In order to do so, the Communication Manager [4] defines "communication modes",
indicating if a given physical channel is available for the application and how (send/
receive; only receive, neither send nor receive).

为此,通信管理器 [4] 定义 “通信模式”,指示给定的物理信道是否可供应用程序使用,以及如何使用 (发送 / 接收;仅接收,既不发送也不接收)。

Functional Requirements

[SRS_ModeMgm_09078] The Communication Manager shall coordinate multiple communication requests

[SRS_ModeMgm_09246] The communication manager shall arbitrate and coordinate requests from users on physical channel and users on PNCs

[SRS_ModeMgm_09247] For each configured PNC an independent state machine shall be instantiated

ComM 来协调通信请求,也来管理 PNC,而且每个 PNC 都有自己的状态机

[SRS_ModeMgm_09248] it shall be possible to distinguish between internal and external PNC activation requests

要区分 PNC 的内部或外部激活请求

[SRS_ModeMgm_00049] The Communication Manager shall initiate the wake-up and keep awake physical channels

ComM 发起唤醒并保持物理通道唤醒

[SRS_ModeMgm_09080] Each physical channel shall be controlled by an independent communication mode

每个物理信道应由独立的通信模式控制

[SRS_ModeMgm_09081] The Communication Manager shall provide an API allowing collecting communication requests

ComM 应提供允许收集通信请求的 API

[SRS_ModeMgm_09083] The Communication Manager shall support two communication modes for each physical channel

ComM 应支持每个物理信道的两种通信模式

[SRS_ModeMgm_09084] The Communication Manager shall provide an API which allows application to query the current communication mode

ComM 应提供一个允许应用程序查询当前通信模式的 API

[SRS_ModeMgm_09172] It shall be possible to evaluate the current communication mode

应有可能评估当前的通信模式

[SRS_ModeMgm_09149] The Communication Manager shall provide an API for querying the requested communication mode

ComM 应提供一个 API,用于查询请求的通信模式

[SRS_ModeMgm_09085] The Communication Manager shall provide an indication of communication mode changes

模式改变的时候要有指示

[SRS_ModeMgm_09168] The Communication Manager shall support users that are connected to no physical channel

抽象呗,上下层级解耦

[SRS_ModeMgm_09071] It shall be possible to limit communication modes independently for each physical channel

应可为每个物理信道独立限制通信模式

[SRS_ModeMgm_09157] It shall be possible to revoke a communication mode limitation, independently for each physical channel

应该可以对每个物理信道独立地撤销通信模式限制

[SRS_ModeMgm_09087] The Minimum duration of communication request after wakeup shall be configurable

唤醒后的最小维持时间可配置

[SRS_ModeMgm_09089] The Communication Manager shall be able to prevent waking up physical channels

应该可以配置禁止唤醒物理通道

[SRS_ModeMgm_09155] The Communication Manager shall provide a counter for inhibited communication requests

[SRS_ModeMgm_09156] It shall be provided an API to retrieve the number of inhibited "Full Communication" mode requests

给各种请求计数

[SRS_ModeMgm_09249] PNC gateway and coordination functionality

Description:

Communication Manager shall be aware of the distribution of each PNC over different ComM channels (where each channel represents a particular connection to a bus (e.g. CAN, FlexRay) or network (e.g. switched Ethernet network)) and shall take care to forward the activation requests from one channel to the other.

ComM 应了解每个 PNC 在不同 ComM 通道上的分布 (每个通道表示对总线例如 CAN、FlexRay) 或网络 (例如交换式以太网网络) 的特定连接),并应小心地将激活请求从一个通道转发到另一个通道。

The Communication Manager of a PNC gateway can either act per PNC as top-level PNC coordinator or as intermediate PNC coordinator.

PNC 网关的 ComM 可以作为每个 PNC 的顶级 PNC 协调器或中间 PNC 协调人。

The top-level PNC coordinator is responsible for the coordinated shutdown of all PNC members, because it is the only node which has the full overview of the states of all PNCs.

最顶级 PNC 协调器负责协调关闭所有 PNC 成员,因为它是唯一全面了解所有 PNC 状态的节点。

If the top-level PNC coordinator detects, that a PNC request has been released, then a NM message is transmitted where this PNC is indicated as released.

如果顶级 PNC 协调器检测到已释放了 PNC 请求,则发送一个 NM 消息,其中该 PNC 被指示为已释放。

The NM message is forwarded as usual NM message by the intermediate PNC coordinate to the PNC leaf nodes. If the optional feature "synchronized PNC shutdown" is enabled the top-level PNC coordinator transmits a NM message as PN shutdown message.

NM 消息由中间 PNC 协调器作为常规 NM 消息转发到 PNC 叶节点。如果启用了可选功能 “同步 PNC 关机”,则顶级 PNC 协调器将 NM 消息作为 PN 关机消息发送。

The intermediate PNC coordinator is responsible to forward a PN shutdown message (request for a synchronized PNC shutdown) per channel has fast as possible.

中间 PNC 协调器负责尽可能快地在每个信道上转发 PN 关闭消息 (请求同步 PNC 关闭)

Rationale:

A PNC can span over different buses which are not necessarily connected to each involved ECU.

PNC 可以跨越不同的总线,而这些总线不一定与每个相关 ECU 相连。

AUTOSAR supports Partial Network topologies, where different PNCs are coordinated by different ECUs in the role of a top-level PNC coordinator.

AUTOSAR 支持部分网络拓扑,其中不同的 PNCs 由不同的 ECU 协调,扮演最高级别 PNC 协调器的角色。

Please note, a PNC can have only one top-level coordinator across a Partial Network.

This has to be ensured by a proper Partial Network communication design.

请注意,一个 PNC 在部分网络中只能有一个顶级协调器,必须通过适当的局部网络通信设计来确保这一点。

Use Case:

ECU A is connected to network 1 and 2,

ECU B is connected to network 2 and 3,

ECU C is connected to network 3;

as PNC 1 involves SWCs on all these ECUs, the communication manager on each ECU must know where and how to forward the activation requests.

ECU A is acting as top-level PNC coordinator for PNC1. If all ECUs have released PNC1 and optional feature "synchronized PNC shutdown" is enabled, then ECU A transmit a PN shutdown message on network 1 and 2 to start a synchronized PNC shutdown of PNC1.

ECU B is acting as intermediate PNC coordinator and forwards the request for a synchronized PNC shutdown of PNC1 to network 3

一个小例子

[SRS_ModeMgm_09250] PNC activation requests shall be exchanged with the Network Management via a PNC bit vector

PNC 激活请求应通过 PNC 位矢量与网络管理器交换

Communication Manager shall provide callback functions get external PNC activation requests as PNC bit vector

and call functions of the Network Management in order to forward PNC activation requests as PNC bit vector according to the specified bit codes.

The content of the PNC bit vector is provided/required by the Network Management.

ComM 和 PNC 和 NM 之间的交互,ComM 应提供回调函数,以便将外部 PNC 激活请求作为 PNC 位矢量接收,然后转发,PNC 位向量的内容由 NM 提供 / 要求。

[SRS_ModeMgm_09278] The Communication Manager shall support synchronous and asynchronous request upon a indicated wakeup

[SRS_ModeMgm_09279] The Communication Manager shall support a coordinated release of PNCs

一些支持项

[SRS_ModeMgm_09251] PNC communication state shall be forwarded to the BswM

因为要涉及其他模块所以要把 PNC 的状态告诉 BswM

[SRS_ModeMgm_09256] PNC Gateway Functionality shall consider systems with more than one gateways connected to the same network

If there are multiple PNC Gateways within the system, then mirroring of cluster-requests need to be limited to avoid keeping awake each other (forwarding of cluster-requests is unaffected). For this, the following distinction shall be possible:

  • Channel Connector of PNC Gateway is of type "active", then PNC requests are forwarded and mirrored on the channel
  • Channel Connector of PNC Gateway is of type "passive", then PNC requests are only forwarded, but not mirrored on the channel
  • Channel Connector of PNC Gateway is of type "none", then PNC requests are not forwarded and not mirrored back on the channel

Constraint: If there are multiple PNC Gateways within the system, there shall always be one Gateway on top of the PNC Gateways hierarchical topology.

也要考虑多个 gateways 连接到同一个网络下的情况分三种类型

[SRS_ModeMgm_09257] ComM shall forward PNC-Clusters also to busses that are currently not awake

[SRS_ModeMgm_09258] Optional Dynamic Extension of PNC Gateway

The PNC Gateway shall be extended to support a dynamic PNC Learning mechanism

牛啊,还支持动态学习

[SRS_ModeMgm_09259] ComM API shall provide interfaces to access PNC Mapping (optional)

The API of the ComM shall provide interfaces for the configurable PNC Mapping stored in NVRAM:

  • to read out the current entries (includes "statically" entries) *
  • to update / add entries (optional) *
  • to reset all entries ("statically" entries will be unaffected)

* for testing reasons only

要有这个接口

[SRS_ModeMgm_09260] ComM API shall provide an interface to start PNC Learning mechanism for PNC Mapping (optional)

[SRS_ModeMgm_09261] ComM shall forward the information for Partial Networking Learning (optional)

[SRS_ModeMgm_09262] ComM shall set all its assigned PNCs when partial networking learning is requested (optional)

各种学习

[SRS_ModeMgm_09263] ComM API shall provide an interface to set PNC-membership on Host-ECU (optional)

[SRS_ModeMgm_09264] ComM API shall provide an interface to configure PN filter mask (optional)

提供接口

[SRS_ModeMgm_09265] ComM shall send the information for Partial Networking Learning (optional)

ComM 应为部分联网学习发送信息

[SRS_ModeMgm_09266] ComM shall support communication channels that act as communication slaves with wake-up capability

ComM 应支持作为具有唤醒能力的通信从机的通信信道

[SRS_ModeMgm_09267] ComM shall support communication channels which act as communication slaves without wake-up capability

[SRS_ModeMgm_09268] ComM shall support the possibility to forward the information if the communication request is active or passive to it’s lower layer layer

[SRS_ModeMgm_09269] The Communication Manager shall support synchronized PNC shutdown

就支持这些玩意

[SRS_ModeMgm_09090] Relationship between users and physical channels shall be configurable at pre compile time

[SRS_ModeMgm_09133] It shall be possible to assign physical channels to the Communication Manager

[SRS_ModeMgm_09132] It shall be possible to assign Network Management to physical channels

[SRS_ModeMgm_09141] The Communication Manager shall be able to configure the physical channel wake-up prevention

[SRS_ModeMgm_09243] The Communication Manager shall be able to handle the Partial Networks on Flexray, CAN and Ethernet

[SRS_ModeMgm_09244] The number of supported PNCs shall be configurable strictly at pre-compile time

[SRS_ModeMgm_09245] Enabling or disabling the Partial Network Cluster management in ComM shall be post-build selectable.

[SRS_ModeMgm_09207] ComM shall allow for additional bus specific state managers

都是要支持配置的

# 4.4 Basic Software Mode Manager

Functional Overview

The VFB defines and the RTE implements the concept of Mode Declaration Groups.

VFB 定义模式声明组,RTE 实现模式声明组的概念。

There can be multiple Mode Declaration Groups that are independent of each other.E.g. in Figure 1 the Mode Declaration Group is "AMM_KeySwitch" and the Modes in this group are "Off", "Accessory", "Ignition".

可以有多个彼此独立的模式声明组。例如,在图 1 中,式声明组为 “AMM_KeySwitch”,该组中的模式为 “Off”“Accessory” 和 “Ignition”。

A Mode Declaration Group can not contain parallel Modes. Parallel Modes must be implemented by separate Mode Declaration Groups. E.g. diagnostic modes are independent of key switch modes, i.e., they go into a validMode Declaration Group "AMM_Diagnostics".

模式声明组不能包含并行模式。并行模式必须由单独的模式声明组实现。例如,诊断模式与键开关模式无关,即它们进入有效的模式声明组 “AMM_Diagnostics”

There is no hierarchy of Modes within a Mode Group. E.g. "Diagnostics_On" and "Diagnostics_Off" cannot have sub-modes.

image-20240820134255891

Interfaces between Mode -Requester, -Manager and -User

image-20240820134342051

Relation of Modes

image-20240820134756896

这些层级的模式都是彼此影响的

image-20240820134942160

Functional Requirements

[SRS_ModeMgm_09174] The BSW Mode Manager shall support the ’disable normal Communication’

支持禁用正常通信

It shall be possible to disable normal communication and at the same time keep a predefined set of PDU groups active including diagnostic communication.

可以禁用正常通信,同时保持一组预定义的 PDU 组处于活动状态,包括诊断通信。

[SRS_ModeMgm_09179] The BSW Mode Manager shall provide an Interface to allow Mode Requests of SW-C’s

[SRS_ModeMgm_09228] The BSW Mode Manager shall provide an Interface to allow Mode Requests of BSW Modules

给上下提供接口

[SRS_ModeMgm_09180] The BSW Mode Manager shall evaluate the current mode requests

[SRS_ModeMgm_09182] The BSW Mode Manager shall propagate a performed mode change to all local SW-Cs

[SRS_ModeMgm_09184] The mode manager shall be able to use a COM interface to activate, respectively deactivate, I-PDU groups

[SRS_ModeMgm_09229] The mode manager shall be able to make generic, configured callouts of void functions to other BSW modules

[SRS_ModeMgm_09230] All actions shall only be performed on mode change

所有的动作都只有在模式改变时执行,卧槽有所感悟。

写代码就首先写一个模式管理的,之后设定出用到的几个模式,然后设计各个模式之间切换的动作

初始化也是状态,卧槽悟了

[SRS_ModeMgm_09240] ComM shall notify BswM of any PNC communication state change

前面好像说过这个吧

[SRS_ModeMgm_09241] BswM shall be able to request communication modes for existing CommUsers

[SRS_ModeMgm_09253] The BswM shall be able to set the halt mode for each single CPU Core independently

一些模式吧我觉得

[SRS_ModeMgm_09177] The rules of the mode arbitration shall be pre-compile and post-build configurable

[SRS_ModeMgm_09178] The lists of mode transition specific actions shall be pre-compile and post-build configurable

[SRS_ModeMgm_09175] A configurable Set of Mode dependent enabled and concomitant disabled IPDU groups shall be supported

[SRS_ModeMgm_09176] Configurable Sets of Mode dependent enabled I-PDU Groups shall be supported

[SRS_ModeMgm_09183] Configurable Mode Activation initiated Reset of Signals to Initial Values shall be supported

这些配置要支持

# ECUStateManager

# 1 Introduction and Functional Overview

The ECU Manager module (as specified in this document) is a basic software module (see [1]) that manages common aspects of ECU states. Specifically, the ECU Manager module:

  • Initializes and de-initializes the OS, the SchM and the BswM as well as some basic software driver modules.
  • configures the ECU for SLEEP and SHUTDOWN when requested.
  • manages all wakeup events on the ECU

ECUM 是 BSW 层

  • 管理初始化 OS、SchM、BswM、以及一些基本的软件驱动模块
  • 管理 ECU 的状态
  • 管理唤醒事件

image-20240724153319855

The ECU Manager module provides the wakeup validation protocol to distinguish ’real’ wakeup events from ’erratic’ ones.

EcuM 提供了唤醒验证协议,来区分真实唤醒和不稳定唤醒

Furthermore:

  • Partial or fast startup where he ECU starts up with limited capabilities and later, as determined by the application, continues startup step by step.
  • Interleaved startup where the ECU starts minimally and then starts the RTE to execute functionality in SW-Cs as soon as possible. It then continues to start further BSW and SW-Cs, thus interleaving BSW and application functionality..
  • Multiple operational states where the ECU has more than one RUN state. This, among other things, refines the notion of a spectrum of SLEEP states to RUN states. There can now be a continuum of operational states spanning from the classic RUN (fully operational) to the deepest SLEEP (processor halted).
  • Multi-Core ECUs: STARTUP, SHUTDOWN, SLEEP and WAKEUP are coordi nated on all cores of the ECU.

此外

  • 部分或快速启动,ECU 以有限的功能启动,然后根据应用程序的决定,继续逐步启动。
  • 交错启动,ECU 最小启动,然后启动 RTE 以尽快执行 SW-Cs 中的功能。然后,它继续启动进一步的 BSW 和 SW-Cs,从而将 BSW 和应用程序功能交织在一起。
  • 多个运行状态,ECU 具有多个 RUN 状态。这将睡眠状态谱的概念细化为运行状态。现在可以有一系列操作状态,从经典的 RUN (完全运行) 到最深的睡眠 (处理器停止)
  • 多核 ECU: 启动,关闭,睡眠和唤醒是协调在所有核心的 ECU。

Flexible ECU management employs the generic mode management facilities provided by the following modules:

  • RTE and BSW Scheduler module [2] are now amalgamated into one module: This module supports freely configurable BSW and application modes and their mode-switching facilities.
  • BSW Mode Manager module [3]: This module implements configurable rules and action lists to evaluate the conditions for switching ECU modes and to implement the necessary actions to do so.

BswM 模块配合 EcuM 来实现模式切换

Thus with Flexible ECU Management, most ECU states are no longer implemented in the ECU Manager module itself. In general, the ECU Manager module takes over control when the generic mode management facilities are unavailable in:

  • Early STARTUP phases,
  • Late SHUTDOWN phases,
  • SLEEP phases where the facilities are locked out by the scheduler

During the UP Phase of the ECU Manager module the BSW Mode Manager is responsible for further actions. Whereas, the ECU Manager module arbitrates RUN and POST_RUN Requests from SW-Cs and notifies BswM about the status of the modes.

在 ECU 管理器模块的 UP 阶段,BSW 模式管理器负责进一步的行动,而 ECU 管理器模块则仲裁来自 SW-C 的 RUN 和 POST RUN 请求,并通知 BSwM 关于式的状态。

# 7 Functional Specification

# 7.1 Phases of the ECU Manager Module

image-20240724161658298

7.1.1 STARTUP Phase

The purpose of the STARTUP phase is to initialize the basic software modules to the

point where Generic Mode Management facilities are operational.

7.1.2 UP Phase

7.1.3 SHUTDOWN Phase

7.1.4 SLEEP Phase

The ECU saves energy in the SLEEP phase.

The ECU Manager module wakes the ECU up in response to intended or unintended wakeup events. Since unintended wakeup events should be ignored, the ECU Manager module provides a protocol to validate wakeup events. The protocol specifies a cooperative process between the driver which handles the wakeup source and the ECU Manager (see section 7.6.4 ).

响应预期或者非预期的唤醒事件,并且有响应的唤醒验证机制

7.1.5 OFF Phase

# 7.2 Structural Description of the ECU Manager

Standardized AUTOSAR Software Modules

Some Basic Software driver modules are initialized, shut down and re-initialized upon wakeup by the ECU Manager module.

The OS is initialized and shut down by the ECU Manager.

After the OS initialization, additional initialization steps are undertaken by the ECU Manager module before passing control to the BswM. The BswM hands execution control back to the ECU Manager module immediately before OS shutdown. Details are provided in the chapters 7.3 STARTUP and 7.4 SHUTDOWN .

一些标准化的软件模块

Software Components

SW-Components contain the AUTOSAR ECU’s application code. A SW-C interacts with the ECU Manager module using AUTOSAR ports.

# 7.3 STARTUP Phase

image-20240724181823042

StartPreOS Sequence

image-20240725110729816

Activities in the StartPostOS Sequence

image-20240725111024887

# 7.4 SHUTDOWN Phase

image-20240823162235012

image-20240823162326111

image-20240823162348543

# 7.5 SLEEP Phase

image-20240823162413491

image-20240823162521318

image-20240823162542307

image-20240823162654622

image-20240823163040612

# 7.6 UP Phase

In the UP Phase, the EcuM_MainFunction is executed regularly and it has three major functions:

  • To check if wakeup sources have woken up and to initiate wakeup validation, if necessary (see 7.6.4 Activities in the WakeupValidation Sequence)
  • To update the Alarm Clock timer
  • Arbitrate RUN and POST_RUN requests and releases.

在 UP 阶段,EcuM MainFunction 会定期执行,它有三个主要功能:

  • 检查唤醒源是否已唤醒,并在必要时启动唤醒验证 (参见唤醒验证序列中的 7.6.4 活动)
  • 更新闹钟定时器
  • 对 RUN 和 POST_RUN 请求和释放进行仲裁。

Alarm Clock Handling

Interaction of Wakeup Sources and the ECU Manager

Wakeup Validation Timeout

Requirements for Drivers with Wakeup Sources

Requirements for Wakeup Validation

Wakeup Sources with Integrated Power Control

# 7.7 Shutdown Targets

"Shutdown Targets" is a descriptive term for all states ECU where no code is executed.

They are called shutdown targets because they are the destination states where the state machine will drive to when the UP phase is left. The following states are shutdown targets:

  • Off
  • Sleep
  • Reset

# 7.8 Alarm Clock

# 7.9 MultiCore

The BSW modules can be distributed over different partitions and therefore over different cores. Some BSW modules as the BswM have to be included into every partition. Other modules like the OS or the EcuM have be included into one partition per core.

BSW 模块可以分布在不同的分区中,因此可以分布在不同的核心上。一些 BSW 模块,如 BsWM,必须包含在每个分区中。其他模块,如 OS 或 EcuM,必须包含在一个分区中。

image-20240823170909487

In a multi core architecture the EcuM has to be distributed in a way, that one instance per core exists.

在多核心架构中,EcuM 必须以每个核心存在一个实例的方式进行分布。

There is one designated master core in which the boot loader starts the master EcuM via EcuM_Init.

有一个指定的主核心,引导加载程序在其中通过 EcuM_Init 启动主 EcuM。

The master EcuM starts some drivers, determines the Post Build configuration and starts all remaining cores with all their satellite EcuMs.

主 EcuM 启动一些驱动程序,确定构建后配置,并使用其所有卫星 EcuM 来启动所有剩余的核心。

Each EcuM now starts the core local OS and all core local BswMs (in every partition resides exactly one BswM).

每个 EcuM 现在都启动核心本地操作系统和所有核心本地 BswM (每个分区中都驻留着一个 BsWM

If the same image of EcuM is executed on every core of the ECU, the ECU Manager’s behavior has to differ on the different cores.

如果 EcuM 的相同映像在 ECU 的每个核心上执行,则 ECU Manager 在不同的核心上的行为必须有所不同。

This can be accomplished by the ECU Manager by testing first whether it is on a master or a slave core and act appropriately.

这可以通过 ECU 管理器来完成,首先测试它是否位于主核心或从属核心上,并采取适当的行动。

The ECU Manager module supports the same phases on a MultiCore ECU as are available on conventional ECUs (i.e. STARTUP, UP, SHUTDOWN and SLEEP).

ECU Manager 模块支持与传统 ECU 相同的多核 ECU 阶段 (即 STARTUP、UP、SHUTDOWN 和 SLEEP)

If safety mechanisms are used, The ECU State Manager has to run with full trust level.

如果使用安全机制,ECU 状态管理器必须在完全信任级别运行。

This section uses previous ECU Manager terms for various ECU states, notably Run/PostRun.

本节使用以前的 ECU Manager 术语来描述各种 ECU 状态,特别是 Run/PostRun。

With flexible ECU management, the system integrator determines the ECU’s states’ names and semantics.

通过灵活的 ECU 管理,系统集成商确定 ECU 的状态名称和语义。

Methods to ensure a de-initialization phase must be upheld, however. The names used here are therefore not normative.

但是,必须坚持确保去初始化阶段的方法,因此这里使用的名称不是规范性的。

Master Core

There is one explicit master core. Which core the master core is, is determined by the boot loader.

有一个显式的主核,主核是什么,由引导加载程序决定。

The EcuM of the master core gets started as first BSW module and performs initialization actions.

主核心的 EcuM 作为第一个 BSW 模块启动,并执行初始化操作。

Then is starts all other cores with all other EcuMs.

然后用所有其他 EcuM 启动所有其他核心。

When these are started, it initializes together with each satellite EcuM the core local OS and BswM.

当这些启动时,它会与每个卫星 EcuM 一起初始化核心本地操作系统和 BsWM。

Slave Core

On every slave core, one satellite EcuM has to run. If a core contains more than one partition, only on EcuM per core has to exist.

在每个从属核心上,必须运行一个卫星 EcuM。如果一个核心包含多个分区,每个核心必须只存在于 EcuM 上。

Master Core - Slave Core Signalling

This section discusses the general mechanisms with which BSW can communicate over cores. It presupposed general knowledge of the SchM, which is described and specified in the RTE.

本节讨论了 BSW 在核心上进行通信的一般机制,前提是人们对 SchM 有一定的了解,这在 RTE 中已经作了描述和阐述。

The Operating System provides a basic mechanism for synchronizing the starts of the operating systems on the master and slave cores.

操作系统提供了一个基本机制,用于同步操作系统在主从内核上的启动。

The Scheduler Manager provides basic mechanisms for communication of BSW modules across partition boundaries.

Scheduler Manager 为 BSW 模块跨分区边界通信提供了基本机制。

One BSW Mode Manager per core is responsible for starting and stopping the RTE.

每个核心中有一个 BSW 模式管理器负责启动和停止 RTE。

Example for Shutdown Synchronization

image-20240826134415650

UP Phase

From the hardware perspective, it is possible that wakeup interrupts could occur on all cores. Then the whole ECU gets woken up and the EcuM running on that processes the wakeup event.

从硬件角度来看,所有内核都可能发生唤醒中断,然后整个 ECU 被唤醒,运行在该 ECU 上的 EcuM 处理唤醒事件。

STARTUP Phase

The ECU Manager module functions nearly identically on all cores. That is, as for the single-core case, the ECU Manager module performs the steps specified for Startup;

ECU Manager 模块在所有内核上的功能几乎相同,即对于单内核的情况,ECU Manager 模块执行指定的启动步骤;

most importantly starting the OS, initializing the SchM and starting the core local BswMs.

最重要的是启动操作系统,初始化 SchM 并启动核心本地 BswM。

After each EcuM has called StartOs on its core, the OS synchronizes the cores before executing the core-individual startup hooks and synchronizes the cores again before executing the first tasks on each core.

每个 EcuM 在其核心上调用 StartOs 后,OS 在执行核心级启动挂钩之前同步核心,并在每个核心上执行第一个任务之前再次同步核心。

StartPostOS is executed on each core and the SchM is initialized on each core. All core local BswMs are initialized by each EcuM.

StartPostOS 在每个核心上执行,SchM 在每个核心初始化。所有核心本地 BswMs 都由每个 EcuM 初始化。

One BswM on every partition has to start the RTE for that core.

每个分区上有一个 BswM 必须为该核心启动 RTE.

Master Core STARTUP

image-20240826135159450

image-20240826135243337

Slave Core STARTUP

image-20240826135405363

image-20240826135454522

SHUTDOWN Phase

When the ECU shall be shut down, the master ECU Manager module calls ShutdownAllCores rather than somehow calling ShutdownOS on the individual cores. The ShutdownAllCores stops the OS on all cores and stops all cores as well.

目前只支持所有核心同时关闭

Master Core SHUTDOWN

image-20240826135814637

image-20240826135832000

Slave Core SHUTDOWN

image-20240826135921626

image-20240826135936834

SLEEP Phase

就是要同步,无聊死了

Runnables and Entry points

P93 没看懂干啥的

# 7.10 EcuM Mode Handling

The ECU State Manager provides interfaces for SW-Cs to request and release the modes RUN and POST_RUN optionally.

ECU 状态管理器为 SWC 提供接口,可选择地请求和释放 RUN 和 POST_RUN 模式。

EcuMFlex arbitrates the requests and releases made by SW-Cs and propagates the result to BswM.

EcuMFlex 对 SWC 提出的请求和释放进行仲裁,并将结果传播到 BswM。

The cooperation between EcuM and BswM is necessary as only the BswM can decide when a transition to a different mode can be made.

EcuM 和 BsWM 之间的合作是必要的,因为只有 BswM 可以决定何时可以过渡到不同的模式。

Due to the fact that the EcuM does not have an own state machine, the EcuM relies on the state transitions made by BswM.

由于 EcuM 没有自己的状态机,所以 EcuM 依赖于 BswM 所做的状态转换。

Therefore the EcuM does not request a state. Furthermore it notifies the BswM about the current arbitration of all requests.

因此,EcuM 不请求某个状态,而且它将所有请求的当前仲裁情况通知 BswM。

And the BswM is notified when the RTE has executed all Runnables belonging to a certain mode.

当 RTE 执行了属于某个模式的所有 Runnables 时,BswM 将收到通知。

image-20240826140757779

# 7.11 Advanced Topics

Relation to Bootloader

The Bootloader is not part of AUTOSAR. Still, the application needs an interface to activate the bootloader. For this purpose, two functions are provided: EcuM_Select_BootTarget and EcuM_GetBootTarget .

引导加载程序不是 AUTOSAR 的一部分。尽管如此,应用程序需要一个接口来激活引导加载程序。为此,提供了两个函数:EcuM_Select_BootTarget 和 EcuM_GetBootTarget 。

image-20240826141145160

Relation to Complex Drivers

If a complex driver handles a wakeup source, it must follow the protocol for handling wakeup events specified in this document.

Handling Errors during Startup and Shutdown

BSW modules are responsible themselves for reporting errors occurring during their initialization directly to the DEM module or the DET module, as specified in their SWSs.

BSW 模块自行负责将初始化过程中发生的错误直接报告给 DEM 模块或 DET 模块,如其 SWS 中所指定的那样。

The ECU Manager module does not report the errors. The BSW module is also responsible for taking any special measures to react to errors occurring during their initialization.

ECU Manager 模块不报告错误。BSW 模块还负责采取任何特别措施来应对初始化过程中发生的错误。

# 7.12 ErrorHook

image-20240826141436988

# 7.13 Error classification

Development Errors

image-20240826141611330

Runtime Errors

image-20240826141637010

# 9 Sequence Charts

# 9.1 State Sequences

参照前面的状态切换序列图

# 9.2 Wakeup Sequences

GPT Wakeup Sequences

General Purpose Timer (GPT)

image-20240826141923686

ICU Wakeup Sequences

Input Capture Unit (ICU)

ICU 不是唤醒源,因此与 GPT 不同,它只是触发中断然后交由 EcuM 去检查唤醒信号

image-20240826142206291

CAN Wakeup Sequences

On CAN a wake up can be detected by the transceiver or the communication controller using either an interrupt or polling. Wake up source identifiers should be shared between transceiver and controller as the ECU State Manager module only needs to know the network that has woken up and passes that on to the Communication Manager module.

在 CAN 上,收发器或通信控制器可以使用中断或轮询来检测唤醒。唤醒源标识符应在收发器和控制器之间共享,因为 ECU 状态管理器模块只需要知道唤醒的网络,并将其传递给通信管理器模块。

image-20240826142620855

image-20240826142814534

LIN Wakeup Sequences

FlexRay Wakeup Sequences

image-20240826143106053

Ethernet Wakeup Sequence

On a Ethernet switched network with OA TC10 compliant Ethernet hardware a wake up can be detected by the used Ethernet hardware (PHY).

在具有 OA TC10 兼容的以太网硬件的以太交换网络上,可用的以太网络硬件 (PHY) 可以检测到唤醒。

image-20240826143417427

image-20240826143433321

image-20240826143454607

image-20240826143508844

# BSWModeManager

# 1 Introduction and functional overview

image-20240820174856654

This specification specifies the functionality, API and the configuration of the AUTOSAR Basic Software module BSW Mode Manager (BswM).

The BSW Mode Manager is the module that implements the part of the Vehicle Mode Management and Application Mode Management concept that resides in the BSW.

Its responsibility is to arbitrate mode requests from application layer SW-Cs or other BSW modules based on simple rules, and perform actions based on the arbitration result.

就是要标准化这个 BSWM

BSW 模式管理器是实现 BSW 中车辆模式管理和应用模式管理概念的部分,

其职责是基于简单规则对应用层 SWC 或其他 BSW 模块的模式请求进行仲裁,并根据仲裁结果执行操作。

# 5 Dependencies to other modules

  • RTE

    • The BswM receives mode requests from the SW-Cs via the RTE. Mode Switch Notifications are also propagated to the SW-Cs via the RTE.
  • EcuM - Flex

    • EcuM Flex can indicate the state of its wakeup sources to BswM. When ECU Mode Handling is used, BswM can set the state of EcuM - Flex and receives status of certain modes based on the RUN Request Protocol.
  • ComM

    • Mode Switch Indications originating from the ComM go through the BswM for further propagation to the SW-Cs. The BswM can request communication modes at the ComM by means of ComMUsers.
  • COM

    • The handling of I-PDU Groups in COM is performed by the BswM. As a part of IPDU group start/stop, it is possible to have the included signal values reset to their corresponding initialization values. BswM handles the enabling and disabling of deadline monitoring of signals in COM.BswM can also trigger transmission of an I-PDU.
  • PduR

    • The BswM can enable and disable routing groups of I-PDUs in the PDU router.
  • CanSM

    • Mode Switch Indications originating from the CanSM go through the BswM for further propagation to the SW-Cs.
  • LinSM

    • BswM coordinates switching of LIN Schedule Tables in the LinSM with starting and stopping of the corresponding I-PDU groups in COM.
    • Mode Switch Indications originating from the LinSM go through the BswM for further propagation to the SW-Cs.
  • LinTp

    • The LIN Transport Protocol that is a part of LinIf requests modes from BswM to makesure that the correct LIN Schedule Table is active during LinTp operation.
  • FrSM

    • Mode Switch Indications originating from the FrSM go through the BswM for further propagation to the SW-Cs.
    • The usage of "Single Slot Mode" on FlexRay is controlled by the FrSM by request of BswM. The send capability of the FlexRay stack can be controlled by the BswM via FrSM by calling the API FrSM_SetEcuPassive.
  • EthSM

    • Mode Switch Indications originating from the EthSM go through the BswM for further propagation to the SW-Cs.
  • DCM

    • The DCM performs mode requests to the BswM based on the diagnostic requests it receives.

    • Example: DCM can request "Disable Normal Communication". During this mode BswM

      will turn off the corresponding I-PDU groups and NM PDUs.

  • J1939Dcm

    • The J1939Dcm reports communication state changes to the BswM for further propagation to the SW-Cs. BswM changes states of J1939Dcm via J1939Dcm_SetState.
  • J1939Nm

    • The J1939Nm provides a state indication via BswM_J1939Nm_StateChangeNotification.
  • J1939Rm

    • BswM changes states of J1939Rm via J1939Rm_SetState.
  • NM Interface

    • BswM will use the Nm_EnableCommunication and Nm_DisableCommunication to control the NM communication based on the current mode.
    • Example: In "Disable Normal Communication" mode, the BswM needs to disable NM communication on the corresponding NM channel.
    • The Nm uses BswM_Nm_CarWakeUpIndication to indicate a CarWakeup.
  • NvM

    • The NvM module reports the state of its blocks to the BswM via "integration code" registered as NvM callbacks. BswM has actions causing the NvM to read and write all blocks during startup and shutdown.
  • OS

    • The features of OS that are required by BswM, are implementation specific.
  • Sd

    • The BswM receives status indications from Sd via several exported APIs (see chapter 8.3 for examples). These status indications from Sd can be configured as BswMModeRequestSources.

# 7 Functional specification

This chapter specifies the functional behavior of the BSW Mode Manager. The operation of the BSW Mode Manager basic functionality can be described as two different tasks: Mode Arbitration and Mode Control.

BSW 模式管理器基本功能的操作可以描述为两个不同的任务:

  • 模式仲裁
  • 模式控制

The Mode Arbitration part initiates mode switches resulting from rule-based arbitration of mode requests and mode indications received from SW-Cs or other BSW modules.

模式仲裁部分启动(从 SW-Cs 或其他 BSW 模块接收的(模式请求)和(模式指示)的基于规则的仲裁导致的)模式切换。

The Mode Control part performs the mode switches by execution of action lists containing mode switch operations of other BSW modules.

模式控制部分通过执行包含其他 BSW 模块模式切换操作的操作列表来执行模式切换

The BswM should be seen as a mode management framework module in which behavior is completely defined by its configuration.

BswM 应该被看作是一个模式管理框架模块,其中的行为完全由其配置来定义。

There may be different ways of implementing the BswM, such as generation of the complete BswM based on the configuration, or as a rule interpreter that parses an encoded configuration at run time.

可能有不同的实现 BswM 的方式,例如根据配置生成完整的 BsWM,或者作为规则解释器在运行时解析编码配置。

However, this specification does not intend to specify any implementation details of the BSW Mode Manager. Hence, any examples stated in this document describing design details should be treated as explanatory text and not as requirements.

然而,该规范并不打算指定 BSW 模式管理器的任何实现细节。因此,本文件中描述设计细节的任何示例都应被视为解释性文本,而不是要求。

# Mode Arbitration

The Mode Arbitration performed by the BswM is simple and rule-based. The rules used for mode arbitration are specified in the configuration of the BSW Mode Manager module.

BswM 执行的模式仲裁是简单且基于规则的,模式仲裁使用的规则在 Bsw 模式管理器模块的配置中指定。

Arbitration Rules

A rule is a logical expression that is composed of a set of mode request conditions.

规则是逻辑表达式,由一组模式请求条件组成。

Mode Conditions and Logical Expressions.

The logical expression that comprises a mode arbitration rule can use different operators such as

  • AND
  • OR
  • XOR
  • NOT
  • NAND

image-20240821165600924

Requirements of Mode Arbitration

As mentioned above, the BswM accepts mode requests and mode indications as input for the mode arbitration.

如上所述,BswM 接受模式请求和模式指示作为模式仲裁的输入。

Immediate and Deferred Operation

There are two different ways to schedule the processing of the mode arbitration.

It is either done immediately within the context of a mode request/indication,

or deferred (cyclically) to the main function of the BswM.

两种模式立即操作和延迟操作

Arbitration Behavior after Initialization

# Mode Control

The Mode Control part of BswM performs all required actions based on the results of the mode arbitration.

根据模式仲裁的结果进行执行所必须的操作

The actions in an Action List can be of three types:

  1. Calls to other BSW modules or the RTE. A set of pre-defined actions are listed in 7.2.4.

  2. Links to other action lists to be included in the execution.

  3. Mode arbitration rules. These rules will be evaluated when the corresponding action list is executed. In this way, a hierarchy of rules is obtained.

1. 调用 BSW 或者 RTE

2. 包含其他操作列表

3. 嵌套的仲裁规则

image-20240821173105981

Mode Processing Cycle

image-20240821173543692

Requirements on Mode Control

Triggered and Conditional action lists

There are two ways that an action list may be executed based on evaluation of rules.

Either it is executed every time the rule is evaluated with the corresponding result, or only when the evaluation result has changed from the previous evaluation.

有两种方式:

  • 每次结果相同时执行
  • 每次结果不同时执行

Available Actions

Behavior of Mode Control after Initialization

用来配置第一次初始化后的执行规则

# Waiting Functionality

Sometimes it is necessary to delay specific actions or wait for further mode controls. For this reason a Timer handling was added to the BswM.

有时需要延迟特定操作或等待进一步的模式控制。为此,在 BswM 中添加了计时器处理

# Multi Partition Support

For multiple BswM instances, each BswM instance will generate its own separate service component description based on its own config set. The integrator will need to allocate these separate service components to the corresponding partition.

BswM is present in each partition with a partition specific configuration (separate instance of BswMConfig per partition). The contained action lists are executed partition locally

对于多个 BswM 实例,每个 BswM 实例将根据自己的配置集生成自己的单独的服务组件描述。集成器需要将这些单独的服务组件分配给相应的分区。

# Error classification

Section 7.2 "Error Handling" of the document "General Specification of Basic Software Modules" describes the error handling of the Basic Software in detail. Above all, it constitutes a classification scheme consisting of five error types which may occur in BSW modules.

文档《基本软件模块通用规范》第 7.2 节 “错误处理” 详细描述了基本软件的错误处理,最重要的是,它构成了一个由 BSW 模块中可能出现的五种错误类型组成的分类方案。

Development Errors

image-20240823145641445

Runtime Errors

image-20240823145721965

# BswM Interfaces and Ports

SW-Cs request modes from the BSW Mode Manager.

image-20240823150150269

When the RTE performs the mode switch, it informs all connected entities (BSW Modules or SW-Cs) that are connected via Mode Switch R-Ports to the providing port.

image-20240823150834103

Mode Request Ports

Mode Switch Ports

Notifications of Mode Switches

Component Type and Internal Behavior

# Ethernet switch port group switching

The current version of the SWS BswM supports Ethernet switch port group switching.

目前版本的 SWS BswM 支持以太网交换机端口组交换。

Based on the current requested PNC, BswM maps the PNC request to a configured EthIfSwitchPortGroup and calls EthIf_SwitchPortGroupRequestMode.

根据当前请求的 PNC,BSWM 将 PNC 请求映射到配置的 EthIfSwitchPortGroup , 并调用 EthIf_SwitchPortGroupRequestMode.

The BswM is indicated by the EthIf, if the accumulated link state has changed.

如果累积链路状态发生变化,则 BswM 由 Ethlf 指示。

The accumulated link state could be used to inform an application. This could be used to cover error scenarios where the requested and the current accumulated link state of EthIfSwitchPortGroups are contradicting and error handling needs to be initiated.

累积链路状态可以用于通知应用程序。这可以用于覆盖错误情况,其中请求的 EthIfSwitchPortGroups 的当前累积链路状态与当前累积链路状态相矛盾,并且需要启动错误处理。

The AUTOSAR_EXP_ModemanagementGuide document contains guidelines for the BswM configuration regarding Ethernet switch port group switching.

AUTOSAR_EXP_ModemanagementGuide 文档包含有关以太网交换机端口组交换的 BswM 配置指南。

# Service Discovery Control

General

image-20240823151826995

Following steps, fulfilled by configuration tools are neccessary:

  1. Analyze SWC descriptions to find the affected ports
  2. Analyze the ECUC to deduce the related entities in Service Discovery
  3. Create Rules and ActionLists to implement the desired behavior provided by BswM
  4. Create the BswMModeRequestSources for the notifications from Service Discovery Module(s)
  5. Create the BswM side of the required S/R ports serving as input for the rules
  6. Create the BswM side of the provided ModeSwitch ports for indications towards SWCs
  7. Connect the ports between BswM Service SWC and Applications SWCs based on the well-defined naming schema

Client Service/Event Subscription Request

A software-component that implements the client functionality acts as a mode requester and exposes a PPortPrototype typed by a SenderReceiverInterface.

实现客户端功能的软件组件充当模式请求器,并通过 SenderReceiverInterface 公开 PPortPrototype

By this means, the software-component can send mode requests towards the BswM in order to subscribe and stop subscribe of dedicated events and methods.

通过这种方式,软件组件可以向 BSWM 发送模式请求,以便订阅和停止订阅专用事件和方法

image-20240823152819401

Figure 7.7 shows the chain that builds up an event subscription request in case (SomeIP) Service Discovery is used. The elements in gray color are configured elements.

图 7.7 显示了在使用 (SomelP) Service Discovery 时生成事件订阅请求的链。灰色元素是配置元素。

The corresponding request port (SWC_P1_Req) can be deduced by evaluating the portgroup reference which references the application events (here Ev1).

通过评估引用应用程序事件的端口组引用 (这里 Ev1),可以推导出相应的请求端口 (SWC_P1_Req)

The relation between application events to the corresponding SD Events (here Ev1 in Eventgroup1) is available by means of the Ecu Configuration.

应用程序事件与对应的 SD 事件 (这里是 Eventgroup1) 中的 EV1) 之间的关系可以通过 Ecu 配置来实现。

Client Service/Event Subscription state notification

A software-component that acts as a client and is interested in the subscription status for the events and methods exposes an RPortPrototype typed by a ModeSwitchInterface.

作为客户端并对事件和方法的订阅状态感兴趣的软件组件通过 ModeSwitchInterface 公开 RPortPrototype .

By this means the software-component can be notified by the BswM whether a subscription is in place.

通过这种方式,BSwM 可以通知软件组件是否已订阅。

Server Service Offer Request

A software-component that implements the server functionality acts as a mode requester and exposes a PPortPrototype typed by a SenderReceiverInterface.

实现服务器功能的软件组件充当模式请求器,并公开由 SenderReceiverInterface 键入的 PPortPrototype.

By this means, the software-component can send mode requests towards the BswM in order to offer and stop offer that service instance.

通过这种方法,软件组件可以向 BsWM 发送模式请求,以提供和停止提供该服务实例。

On the side of the BswM, a RPortPrototypetyped by the same SenderReceiver-Interface is used to requests for mode switches.

在 BswM 的另一方面,一个 RPort 原型由相同的发送方接收方接口类型用于请求模式切换。

Unlike the client use cases, the server service offer is only allowed by one port, that means that per instance of a service only one single port is supported.

与客户端用例不同,服务器服务提供只允许一个端口,这意味着每个服务实例只支持一个单独的端口。

Server Service/Event Subscription State Notification

A server instance sending events or field notifications might not need to produce and send those events if there are no subscriptions for that server instance events.

如果没有对服务器实例事件的订阅,发送事件或字段通知的服务器实例可能不需要生成和发送这些事件。

In order to notify the server instance whether there is at least one subscriber interested in the server’s events a ModeSwitchInterface is available to receive the subscription notifications.

为了通知服务器实例是否至少有一个订阅者对服务器的事件感兴趣,ModeSwitchInterface 可用来接收订通知。

A software-component that acts as a server and is interested in the subscription status for the service instance events exposes an RPortPrototype typed by a ModeSwitch Interface.

作为服务器并感兴趣于服务实例事件的订阅状态的软件组件公开了由 ModeSwitch 接口类型化的 RPortPrototype .

By this means, the software-component can be notified by the BswM on subscription changes.

通过这种方式,BSWM 可以就订阅变更通知软件组件。

Connecting ports at configuration time

# 9 Sequence diagrams

Deferred operation of BswM

image-20240823161524797

Immediate operation of BswM

image-20240823161555207

结束啦宝!睡觉🛏️

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

flechazo 微信支付

微信支付

flechazo 支付宝

支付宝

flechazo 贝宝

贝宝