# E2E 转换器规范 (Specification of Module E2E Transformer) > **AUTOSAR CP Release 4.4.0** > **文档 ID 650: AUTOSAR_SWS_E2ETransformer** ## 元信息 | 项目 | 内容 | | --- | --- | | 文档标题 | E2E 转换器规范 | | 文档所有者 | AUTOSAR | | 文档责任方 | AUTOSAR | | 文档标识号 | 650 | | 文档状态 | Final | | 所属 AUTOSAR 标准 | Classic Platform | | 所属标准版本 | 4.4.0 | ## 文档变更历史 | 日期 | 版本 | 变更方 | 变更说明 | | --- | --- | --- | --- | | 2018-10-31 | 4.4.0 | AUTOSAR Release Management | E2E Profile P22 和 P44 支持 | | 2017-12-08 | 4.3.1 | AUTOSAR Release Management | 修正/澄清 | | 2016-11-30 | 4.3.0 | AUTOSAR Release Management | 增加更多 E2E Profile 支持 | | 2015-07-31 | 4.2.2 | AUTOSAR Release Management | 初始正式版本 | --- ## 目录 - [1. 介绍](#1-介绍) - [2. 缩略语](#2-缩略语) - [3. 相关文档](#3-相关文档) - [4. 约束与假设](#4-约束与假设) - [5. 与其他模块的依赖](#5-与其他模块的依赖) - [6. 需求可追溯性](#6-需求可追溯性) - [7. 功能规范](#7-功能规范) - [8. API 规范](#8-api-规范) - [9. 配置规范](#9-配置规范) --- ## 1. 介绍 E2E 转换器负责保护安全相关的数据元素。它由 RTE 调用。在发送端,E2E 转换器对数据进行 E2E 保护。在接收端,E2E 转换器对数据进行 E2E 检查,并通过 RTE 将检查结果提供给 SWC。 E2E 转换器是一种特殊类型的转换器,使用 E2E Library 提供的功能。 --- ## 2. 缩略语 | 缩略语 | 描述 | | --- | --- | | API | Application Programming Interface | | AUTOSAR | Automotive Open System Architecture | | BSW | Basic Software | | ComM | Communication Manager | | CRC | Cyclic Redundancy Check | | DET | Default Error Tracer | | E2E | End-to-End | | E2EXf | E2E Transformer | | ECU | Electronic Control Unit | | ISignal | Inter-ECU Signal | | LCfg | Link-time Configuration | | PBCfg | Post-build Configuration | | RTE | Runtime Environment | | SDU | Service Data Unit | | SWC | Software Component | --- ## 3. 相关文档 ### 3.1 输入文档 - [1] List of Basic Software Modules - [2] Layered Software Architecture - [3] General Specification of Basic Software Modules - [4] Specification of Standard Types - [5] Specification of E2E Library - [6] Specification of RTE - [7] System Template - [8] Specification of Communication Stack Types - [9] AUTOSAR Specification of Transformer General - [10] Specification of COM Based Transformer - [11] Software Component Template - [12] Requirements on E2E ### 3.2 相关标准 无。 ### 3.3 相关规范 AUTOSAR SWS BSW General [3] 适用。 --- ## 4. 约束与假设 ### 4.1 限制 E2E 转换器是无状态的(状态在调用者维护)。 ### 4.2 适用车域 E2E 转换器适用于安全相关通信。 --- ## 5. 与其他模块的依赖 E2E 转换器依赖 E2E Library。E2E Library 提供数据类型和虚拟(无状态)函数。E2E 转换器执行 E2E Library 例程,传递配置和状态作为函数参数。 ### 5.1 支持的配置变体 本文档规定两种配置变体: 1. **Link-time**:链接时配置 2. **Post-build-selectable**:后构建可选 二者很相似,数据结构相同。Link-time 仅实例化一次,Post-build-selectable 可多次实例化(值不同)。配置结构驻留在不同文件中(LCfg vs. PBCfg)。 目前无除 BSW General 和 ASWS TransformerGeneral 之外的显式 Pre-compile 时间配置设置。 --- ## 6. 需求可追溯性 | 需求 ID | 描述 | 满足者 | | --- | --- | --- | | SRS_BSW_00159 | 工具配置支持 | SWS_E2EXf_00156 | | SRS_E2E_08528 | E2E Library 应提供 E2E profile | SWS_E2EXf_00158, SWS_E2EXf_00159 | | SRS_E2E_08538 | 应提供 E2E 转换器 | SWS_E2EXf_00009 ~ SWS_E2EXf_00164 | > **[摘要]** 完整需求追溯表见原文 PDF 第 11 页。 --- ## 7. 功能规范 E2E 转换器负责保护安全相关数据元素。它由 RTE 调用。发送端 E2E 保护数据;接收端 E2E 检查数据,通过 RTE 将结果传给 SW-C。 如接收 SWC 不读取转换器返回码,数据是否在总线上 E2E 保护对 SWC 完全透明。 - **[SWS_E2EXf_00161]** ⌈本文档定义的 E2E 转换器在以下条件下使用: 1. TransformationTechnology 的 protocol 属性 = E2E 2. version 属性 = 1.0.0 3. transformerClass 属性 = safety⌋ (SRS_E2E_08538) ### 7.1 支持的 RTE 函数 目前支持以下 inter-ECU 通信函数: 1. Rte_Write/Rte_Read 2. Rte_IWrite/Rte_IRead 3. Rte_Send/Rte_Receive 未来将扩展到 client/server 函数。 ### 7.2 受 E2E 保护的函数和数据命名 E2E 转换器函数和结构使用 `` 后缀。该模式定义为每个转换器函数的唯一 ID。 ### 7.3 配置三阶段 - **EndToEndTransformationDescription**:定义 E2E 配置 profile,对多个 ISignal 有效 - **EndToEndTransformationISignalProps**:定义特定引用 ISignal 的配置选项 - **EndToEndTransformationComSpecProps**:定义 port 的覆盖配置选项 - **[SWS_E2EXf_00134]** ⌈EndToEndTransformationComSpecProps 中的配置选项应优先于 EndToEndTransformationDescription 和 EndToEndTransformationISignalProps。⌋ (SRS_E2E_08538) - **[SWS_E2EXf_00154]** ⌈如 EndToEndTransformationComSpecProps.disableEndToEndCheck 为某 transformerId 设置,E2E 转换器应跳过 E2E Library 调用。⌋ ### 7.4 支持的 E2E Profile E2E 转换器支持以下 E2E Profile: - Profile 01 (P01) — 8 位 CRC, CounterOffset - Profile 02 (P02) — 8 位 CRC, DataID rotation - Profile 04 (P04) — 32 位 CRC + 长度,源 ID - Profile 05 (P05) — 16 位 CRC, DataID - Profile 06 (P06) — 16 位 CRC + 长度 - Profile 07 (P07) — 64 位 CRC, ARXML 描述 - Profile 11 (P11) — 8 位 CRC, DataID - Profile 22 (P22) — 8 位 CRC + nibble - Profile 44 (P44) — 32 位 CRC + 长度,无源 ID ### 7.5 状态管理 E2E 转换器无状态(状态在内部静态变量维护)。每次调用前/后调用 E2E Library 时传入状态。 ### 7.6 错误分类 #### 7.6.1 转换器返回码 | 返回码 | 含义 | | --- | --- | | E_OK | 成功 | | E_SAFETY_HARD_RUNTIMEERROR | 严重运行时错误 | | E_SAFETY_SOFT_RUNTIMEERROR | 软运行时错误 | | E_NOT_OK | 失败 | #### 7.6.2 开发错误 | 错误名 | 错误码 | 含义 | | --- | --- | --- | | E2EXF_E_PARAM_POINTER | 0x01 | NULL 指针 | | E2EXF_E_INVALID_BUF | 0x02 | 缓冲区无效 | --- ## 8. API 规范 ### 8.1 转换器函数 #### 8.1.1 E2EXf_ ```c uint8 E2EXf_( uint8* buffer, uint32* bufferLength, const * dataElement ) ``` | 描述 | 发送端 E2E 保护,生成 CRC 等 | | --- | --- | | 返回 | E_OK / E_SAFETY_* / E_NOT_OK | #### 8.1.2 E2EXf_Inv_ ```c uint8 E2EXf_Inv_( const uint8* buffer, uint32 bufferLength, * dataElement ) ``` | 描述 | 接收端 E2E 检查,验证 CRC 等 | | --- | --- | ### 8.2 版本信息 #### 8.2.1 E2EXf_GetVersionInfo ```c void E2EXf_GetVersionInfo(Std_VersionInfoType* versioninfo) ``` --- ## 9. 配置规范 ### 9.1 配置容器 E2E 转换器无模块特定 ECU 配置,因其全部配置基于: - EndToEndTransformationDescription (SystemTemplate) - EndToEndTransformationISignalProps - EndToEndTransformationComSpecProps ASWS Transformer General [9] 的通用 ECU 配置足够。 ### 9.2 配置示例 #### Profile P01 示例 ``` profileName: PROFILE_01 counterOffset: 8 crcOffset: 0 dataId: 0x123 dataIdMode: E2E_P01_DATAID_BOTH dataLength: 64 maxDeltaCounterInit: 1 maxNoNewOrRepeatedData: 15 syncCounterInit: 0 ``` > **[摘要]** 完整配置详见原文 PDF 第 38-44 页。 --- ## 翻译说明 - 本译本基于 AUTOSAR CP 4.4.0 的 E2E 转换器规范 (Document ID 650,共 44 页) - 摘要标记位置:第 6 章需求追溯、第 9 章配置