1 介绍与功能概述(Introduction and functional overview)
本规范描述了默认错误追踪器(Default Error Tracer,DET)的 API。所有在基础软件中检测到的开发错误和运行时错误都会被报告至该模块。API 参数允许追溯错误的来源和类型:
- 检测到错误的模块(Module)
- 检测到错误的函数(Function)
- 错误类型(Type of error)
本模块 API 背后的具体功能实现不在本规范范围之内。软件开发者与软件集成者可根据其特定的应用与测试环境选择最优的策略。可能的实现功能包括:
- 在错误报告 API 内设置调试器断点
- 对所报告错误进行计数
- 通过使用默认值处理运行时错误
- 将调用及其传入参数记录至 RAM 缓冲区
- 通过通信接口将所报告错误发送至外部记录器
注:默认错误追踪器的软件需求在 SRS Diagnostics 文档中规范。
2 缩略语与缩写(Acronyms and abbreviations)
DET:默认错误追踪器(Default Error Tracer)。
3 相关文档(Related documentation)
3.1 输入文档(Input documents)
- [1] List of Basic Software Modules,
AUTOSAR_TR_BSWModuleList.pdf - [2] Layered Software Architecture,
AUTOSAR_EXP_LayeredSoftwareArchitecture.pdf - [3] General Requirements on Basic Software Modules,
AUTOSAR_SRS_BSWGeneral.pdf - [4] Basic Software Module Description Template,
AUTOSAR_TPS_BSWModuleDescriptionTemplate.pdf - [5] Specification of ECU Configuration,
AUTOSAR_TPS_ECUConfiguration.pdf - [6] General Requirements on Basic Software Modules,
AUTOSAR_SRS_BSWGeneral.pdf - [7] General Specification of Basic Software Modules,
AUTOSAR_SWS_BSWGeneral.pdf
3.2 相关标准与规范(Related standards and norms)
不适用(Not applicable)。
3.3 相关规范(Related specification)
DET 的功能需求包含在 SRS BSW [6] 的 "Fault Operation and Error Detection" 一节中。
AUTOSAR 在 [7](SWS BSW General)"Error Classification" 一节中提供了关于 BSW 模块的通用规范,其中包含如何设计错误处理的信息。
4 约束与假设(Constraints and assumptions)
4.1 限制(Limitations)
本规范不定义错误报告 API 背后的具体功能实现。不考虑操作系统的内存保护机制。
4.2 在汽车领域的适用性(Applicability to car domains)
无限制。
5 与其他模块的依赖(Dependencies to other modules)
5.1 文件结构(File structure)
[SWS_Det_00037] ⌈ Det.h 应包含通过其服务报告错误时进行错误追踪所需的全部用户相关信息。⌋(SRS_BSW_00346)
6 需求追溯(Requirements traceability)
本章将 SRS_BSW_* 与 SRS_Diag_* 中的需求映射到本规范中的 SWS_Det_* 需求。SRS_BSW_00300-SRS_BSW_00499(部分)以及 SRS_Diag_04xxx 中列出的与 DET 相关需求被映射如下(按来源分组):
| 需求(Requirement) | 描述(Description) | 由满足(Satisfied by) |
|---|---|---|
| SRS_BSW_00004 | 所有基础软件模块应对所导入 include 文件的版本进行预处理器检查 | SWS_Det_00999 |
| SRS_BSW_00005 | MCAL 层模块不得硬编码横向接口 | SWS_Det_00999 |
| SRS_BSW_00006 | MCAL 层之上模块的源码不得与处理器和编译器相关 | SWS_Det_00999 |
| SRS_BSW_00007 | 所有 C 语言编写的 BSW 模块应符合 MISRA C 2012 标准 | SWS_Det_00999 |
| SRS_BSW_00009 | 所有 BSW 模块应按统一标准进行文档化 | SWS_Det_00999 |
| SRS_BSW_00010 | 所有 BSW 模块的内存消耗应对所有支持平台在已定义配置下文档化 | SWS_Det_00999 |
| SRS_BSW_00101 | BSW 模块应能在单独的初始化函数中初始化变量和硬件 | SWS_Det_00019, SWS_Det_00020 |
| SRS_BSW_00158 | — | SWS_Det_00999 |
| SRS_BSW_00159 | AUTOSAR 基础软件的所有模块应支持基于工具的配置 | SWS_Det_00018 |
| SRS_BSW_00160 | AUTOSAR BSW 模块的配置文件应可被人类阅读 | SWS_Det_00999 |
| SRS_BSW_00161 | AUTOSAR 基础软件应提供面向更高软件层的标准化 MCU 抽象层 | SWS_Det_00999 |
| SRS_BSW_00162 | AUTOSAR 基础软件应提供硬件抽象层 | SWS_Det_00999 |
| SRS_BSW_00164 | ISR 的实现应由 OS、复杂驱动或模块完成 | SWS_Det_00999 |
| SRS_BSW_00167 | 所有 AUTOSAR BSW 模块应提供配置规则和约束以支持合理性检查 | SWS_Det_00035 |
| SRS_BSW_00168 | SW 组件应通过基础软件中通用 API 定义的函数进行测试 | SWS_Det_00999 |
| SRS_BSW_00170 | AUTOSAR SW 组件应提供其对故障、信号质量、驱动请求的依赖信息 | SWS_Det_00999 |
| SRS_BSW_00171 | ECU 上不需要的 BSW 组件可选功能应在预编译时可配置 | SWS_Det_00015 |
| SRS_BSW_00172 | BSW 模块内建的调度策略应与系统中所用策略兼容 | SWS_Det_00999 |
| SRS_BSW_00301 | 所有 AUTOSAR BSW 模块应只导入必要信息 | SWS_Det_00999 |
| SRS_BSW_00304 | 所有 AUTOSAR BSW 模块应使用 AUTOSAR 标准数据类型代替原生 C 类型 | SWS_Det_00999 |
| SRS_BSW_00305 | 数据类型命名约定 | SWS_Det_00999 |
| SRS_BSW_00306 | AUTOSAR BSW 模块应与编译器和平台无关 | SWS_Det_00999 |
| SRS_BSW_00307 | 全局变量命名约定 | SWS_Det_00999 |
| SRS_BSW_00308 | AUTOSAR BSW 模块不应在头文件中定义全局数据,而应在 C 文件中定义 | SWS_Det_00999 |
| SRS_BSW_00309 | 所有 AUTOSAR BSW 模块应为只读用途的全局数据显式指定 const 关键字 | SWS_Det_00999 |
| SRS_BSW_00310 | API 命名约定 | SWS_Det_00008, SWS_Det_00009, SWS_Det_00010, SWS_Det_00011, SWS_Det_01001, SWS_Det_01003 |
| SRS_BSW_00312 | 共享代码应可重入 | SWS_Det_00039 |
| SRS_BSW_00314 | 所有内部驱动模块应将中断帧定义与中断服务例程分离 | SWS_Det_00999 |
| SRS_BSW_00318 | 每个 AUTOSAR BSW 模块文件应在头文件中提供版本号 | SWS_Det_00011 |
| SRS_BSW_00323 | 所有 AUTOSAR BSW 模块应检查传入的 API 参数有效性 | SWS_Det_00999 |
| SRS_BSW_00325 | 中断服务例程和中断上下文中函数的运行时间应保持简短 | SWS_Det_00999 |
| SRS_BSW_00328 | 所有 AUTOSAR BSW 模块应避免代码重复 | SWS_Det_00999 |
| SRS_BSW_00330 | 当使用源码且对运行时间敏感时,允许使用宏代替函数 | SWS_Det_00999 |
| SRS_BSW_00331 | 所有 BSW 模块应严格区分错误和状态信息 | SWS_Det_00999 |
| SRS_BSW_00334 | 所有 BSW 模块应提供包含元数据的 XML 文件 | SWS_Det_00999 |
| SRS_BSW_00335 | 状态值命名约定 | SWS_Det_00999 |
| SRS_BSW_00336 | BSW 模块应能关闭 | SWS_Det_00999 |
| SRS_BSW_00337 | 开发错误分类 | SWS_Det_00026, SWS_Det_00301 |
| SRS_BSW_00339 | 报告生产相关的错误状态 | SWS_Det_00999 |
| SRS_BSW_00341 | 模块文档应包含所有必要信息 | SWS_Det_00999 |
| SRS_BSW_00342 | 应能将源码模块与目标码模块(甚至混合)组合为 AUTOSAR ECU | SWS_Det_00999 |
| SRS_BSW_00343 | BSW 模块规范与配置的时间单位应优先使用物理时间单位 | SWS_Det_00999 |
| SRS_BSW_00344 | BSW 模块应支持链接时配置 | SWS_Det_00999 |
| SRS_BSW_00345 | BSW 模块应支持预编译配置 | SWS_Det_00014 |
| SRS_BSW_00346 | 所有 AUTOSAR BSW 模块应至少提供一组基本模块文件 | SWS_Det_00037 |
| SRS_BSW_00347 | 应对 BSW 驱动的不同实例进行命名分离 | SWS_Det_00999 |
| SRS_BSW_00348 | 所有 AUTOSAR 标准类型与常量应放置并组织在标准类型头文件中 | SWS_Det_00999 |
| SRS_BSW_00350 | 所有 AUTOSAR BSW 模块应允许启用/禁用开发错误的检测与报告 | SWS_Det_00025, SWS_Det_00999 |
| SRS_BSW_00353 | 目标与编译器特定范围的整型定义应放置并组织在单一类型头文件中 | SWS_Det_00999 |
| SRS_BSW_00357 | API 调用的成功/失败应定义标准返回类型 | SWS_Det_00999 |
| SRS_BSW_00358 | AUTOSAR BSW 模块实现的 init() 函数返回类型应为 void | SWS_Det_00008 |
| SRS_BSW_00359 | 所有 AUTOSAR BSW 模块的回调函数应尽可能避免 void 以外的返回类型 | SWS_Det_00999 |
| SRS_BSW_00360 | AUTOSAR BSW 模块的回调函数允许带有参数 | SWS_Det_00999 |
| SRS_BSW_00361 | 编译器特定范围中非标准化关键字的映射应放置在编译器特定类型与关键字头文件中 | SWS_Det_00999 |
| SRS_BSW_00369 | 所有 AUTOSAR BSW 模块不应通过 API 返回特定的开发错误码 | SWS_Det_00999 |
| SRS_BSW_00371 | 所有 AUTOSAR BSW 模块禁止将函数指针作为 API 参数传递 | SWS_Det_00999 |
| SRS_BSW_00373 | 每个 AUTOSAR BSW 模块的主处理函数应按已定义约定命名 | SWS_Det_00999 |
| SRS_BSW_00375 | BSW 模块应报告唤醒原因 | SWS_Det_00999 |
| SRS_BSW_00377 | BSW 模块可返回模块特定类型 | SWS_Det_00999 |
| SRS_BSW_00378 | AUTOSAR 应提供布尔类型 | SWS_Det_00999 |
| SRS_BSW_00379 | 所有软件模块应在头文件及模块 XML 描述文件中提供模块标识符 | SWS_Det_00999 |
| SRS_BSW_00380 | 存储于内存中的配置参数应放置在独立的 C 文件中 | SWS_Det_00999 |
| SRS_BSW_00381 | — | SWS_Det_00999 |
| SRS_BSW_00383 | BSW 模块规范应描述其至少使用了哪些其他模块的配置文件 | SWS_Det_00999 |
| SRS_BSW_00385 | 列出可能的错误通知 | SWS_Det_00999 |
| SRS_BSW_00386 | BSW 应规范错误检测的配置 | SWS_Det_00999 |
| SRS_BSW_00388 | 应使用容器对同一对象的配置参数进行分组 | SWS_Det_00999 |
| SRS_BSW_00389 | 容器应具有名称 | SWS_Det_00999 |
| SRS_BSW_00390 | 参数内容在模块内应唯一 | SWS_Det_00999 |
| SRS_BSW_00392 | 参数应具有类型 | SWS_Det_00035 |
| SRS_BSW_00393 | 参数应具有范围 | SWS_Det_00999 |
| SRS_BSW_00394 | BSW 模块规范应规范配置参数的作用域 | SWS_Det_00035, SWS_Det_00180 |
| SRS_BSW_00395 | BSW 模块规范应列出所有配置参数依赖 | SWS_Det_00999 |
| SRS_BSW_00396 | BSW 模块规范应规定每个参数/容器所支持的可变值与可变多实例的配置类 | SWS_Det_00999 |
| SRS_BSW_00397 | 预编译时配置参数在编译开始前已固定 | SWS_Det_00999 |
| SRS_BSW_00398 | 链接时配置在编译后、链接前以目标码为基础完成 | SWS_Det_00999 |
| SRS_BSW_00399 | 参数集应位于独立段并在代码之后加载 | SWS_Det_00999 |
| SRS_BSW_00400 | 参数应在代码加载启动后从多组参数中选择 | SWS_Det_00999 |
| SRS_BSW_00401 | 应提供多实例配置参数的文档 | SWS_Det_00999 |
| SRS_BSW_00403 | BSW 模块规范应规定每个参数/容器是否支持不同配置集下不同值或多实例 | SWS_Det_00018 |
| SRS_BSW_00404 | BSW 模块应支持 post-build 配置 | SWS_Det_00999 |
| SRS_BSW_00405 | BSW 模块应支持多配置集 | SWS_Det_00999 |
| SRS_BSW_00406 | 标识 BSW 模块是否初始化的静态状态变量在 BSW 模块任何 API 被调用前应初始化为 0 | SWS_Det_00024, SWS_Det_00999 |
| SRS_BSW_00407 | 每个 BSW 模块应提供读取特定模块实现版本信息的函数 | SWS_Det_00999 |
| SRS_BSW_00409 | 所有生产码错误 ID 符号由 Dem 模块定义,并由其他 BSW 模块从 Dem 配置中获取 | SWS_Det_00999 |
| SRS_BSW_00410 | 编译器开关应具有已定义值 | SWS_Det_00999 |
| SRS_BSW_00412 | — | SWS_Det_00999 |
| SRS_BSW_00413 | 对 BSW 模块实例的访问应基于索引 | SWS_Det_00999 |
| SRS_BSW_00414 | Init 函数应以配置结构指针作为唯一参数 | SWS_Det_00008, SWS_Det_00210 |
| SRS_BSW_00415 | 专供一个模块的接口应分离至专用头文件 | SWS_Det_00999 |
| SRS_BSW_00416 | 模块的初始化顺序应可配置 | SWS_Det_00999 |
| SRS_BSW_00417 | 不属于 SW-C 的软件仅在 DEM 完全运行后才应报告错误事件 | SWS_Det_00999 |
| SRS_BSW_00419 | 若预编译时配置参数以 const 实现,应放置在独立 C 文件中 | SWS_Det_00999 |
| SRS_BSW_00422 | 错误状态信息的预去抖由 DEM 完成 | SWS_Det_00999 |
| SRS_BSW_00423 | 具有 AUTOSAR 接口的 BSW 模块应可用 SW-C 模板描述 | SWS_Det_00999 |
| SRS_BSW_00424 | BSW 模块主处理函数不应进入等待状态 | SWS_Det_00999 |
| SRS_BSW_00425 | BSW 模块描述模板应提供建模可调度对象触发条件的方式 | SWS_Det_00999 |
| SRS_BSW_00426 | BSW 模块应保证 BSW 模块间共享数据的一致性 | SWS_Det_00999 |
| SRS_BSW_00427 | ISR 函数应在 BSW 模块描述中定义并文档化 | SWS_Det_00999 |
| SRS_BSW_00428 | BSW 模块应说明其主处理函数是否需按特定顺序或序列执行 | SWS_Det_00999 |
| SRS_BSW_00429 | 对 OS 的访问受限 | SWS_Det_00999 |
| SRS_BSW_00432 | 模块应对读/接收与写/发送数据路径提供独立的主处理函数 | SWS_Det_00999 |
| SRS_BSW_00433 | 主处理函数仅允许由 BSW 调度器提供的任务体调用 | SWS_Det_00999 |
| SRS_BSW_00437 | 内存映射应提供定义启动时不初始化的 RAM 段的能力 | SWS_Det_00999 |
| SRS_BSW_00438 | 配置数据应定义在结构体中 | SWS_Det_00999 |
| SRS_BSW_00439 | 使能 BSW 模块处理中断 | SWS_Det_00999 |
| SRS_BSW_00440 | BSW 模块对回调函数的调用应遵循 RTE 通过 Rte_Call API 调用 server 的签名 | SWS_Det_00999 |
| SRS_BSW_00441 | 类型、宏与函数的命名约定 | SWS_Det_00999 |
| SRS_BSW_00458 | 生产错误分类 | SWS_Det_00999 |
| SRS_BSW_00463 | 回调原型的命名约定 | SWS_Det_00180, SWS_Det_00181, SWS_Det_00184, SWS_Det_00187 |
| SRS_BSW_00466 | 扩展生产错误分类 | SWS_Det_00999 |
| SRS_BSW_00480 | 空指针错误应遵循命名规则 | SWS_Det_00052 |
| SRS_Diag_04085 | — | SWS_Det_00009 |
| SRS_Diag_04086 | — | SWS_Det_00009, SWS_Det_01001, SWS_Det_01003 |
| SRS_Diag_04087 | — | SWS_Det_00200, SWS_Det_00202, SWS_Det_00203, SWS_Det_00204, SWS_Det_00205, SWS_Det_00206 |
| SRS_Diag_04089 | — | SWS_Det_00207 |
| SRS_Diag_04101 | — | SWS_Det_00034 |
| SRS_Diag_04143 | — | SWS_Det_01001 |
| SRS_Diag_04144 | — | SWS_Det_01003 |
7 功能规范(Functional specification)
默认错误追踪器提供在软件组件和其他基础软件模块的开发与运行期间支持错误检测与追踪的功能。为此,DET 接收并评估来自这些组件和模块的错误消息。
由于对错误情形下的功能实现总是存在具体(非通用)需求,DET 的实现没有显式的规范,但以下方面除外:
- 错误报告时可执行的可配置错误钩子列表
- 将提供报告错误、允许 reset 后可选的错误恢复、处理可选错误恢复信息以及获取版本信息的接口
7.1 初始化(Initialization)
[SWS_Det_00019] ⌈ DET 应提供初始化函数 Det_Init(参见 SWS_Det_00008)。⌋(SRS_BSW_00101)
[SWS_Det_00020] ⌈ 每次调用 Det_Init 函数应将默认错误追踪器设置为已定义的初始状态(例如通过移除可选的错误恢复信息)。⌋(SRS_BSW_00101)
注:SWS_Det_00020 在没有关于非规范功能以及可能使用的可选错误恢复信息的知识下不可测试。
注:错误恢复信息的使用与含义是可选的,未作规范。
[SWS_Det_00025] ⌈ 默认错误追踪器应提供函数 Det_Start(参见 SWS_Det_00010)。⌋(SRS_BSW_00350)
注:默认错误追踪器的环境可在 NVRAM 初始化完成、用于持久错误存储时,使用 Det_Start 触发 DET 模块运行(如需要)。
注:若默认错误追踪器不需要启动调用,Det_Start 函数可以为空。
注:集成者可由 EcuM 的配置决定 Det_Init 被调用的时机。
注:集成者可由 EcuM 或 ModeM 的配置决定 Det_Start 被调用的时机和是否调用。
7.2 错误钩子(Error Hooks)
[SWS_Det_00207] ⌈ 为支持开发与运行期间的调试与错误追踪,默认错误追踪器提供对所接收错误报告进行通知的功能。因此可配置所谓的错误钩子(error hooks)。错误钩子用于转发错误通知。如果至少配置了一个错误钩子,则 DET 将在每次收到错误报告时调用所配置的错误钩子。错误钩子的配置由第 10 章所描述的 AUTOSAR 配置方法完成。⌋(SRS_Diag_04089)
[SWS_Det_00035] ⌈ 每个 Error_Hook 应使用与对应函数 Det_ReportError、Det_ReportTransientFault 和 Det_ReportRuntimeError 相同的参数集进行调用。所配置的回调函数为 ECU 配置(参见 ECUC_DET_00005、ECUC_DET_00010 与 ECUC_DET_00011)。⌋(SRS_BSW_00167,SRS_BSW_00392,SRS_BSW_00394)
7.3 错误报告(Error Reporting)
[SWS_Det_00024] ⌈ 如果在调用 DET 报告函数之前默认错误追踪器未被初始化,报告函数应立即返回,不执行任何其他操作(不使用 Error_Hook,不执行实现者特定函数,也不报告任何错误)。⌋(SRS_BSW_00406)
[SWS_Det_00014] ⌈ 错误报告函数 Det_ReportError、Det_ReportTransientFault 与 Det_ReportRuntimeError 应立即调用所有配置的 Error_Hooks(参见 ECUC_Det_00010、ECUC_Det_00011)。⌋(SRS_BSW_00345)
[SWS_Det_00018] ⌈ 默认错误追踪器应按配置所给顺序执行所配置的 DetErrorHook 列表(参见 ECUC_Det_00005)。⌋(SRS_BSW_00403,SRS_BSW_00159)
[SWS_Det_00015] ⌈ 可选的实现特定功能应仅在所有配置的 Error_Hook(参见 ECUC_Det_00010、ECUC_Det_00011)被调用之后才执行。此外该功能应支持预编译时配置。⌋(SRS_BSW_00171)
[SWS_Det_00034] ⌈ 对 Det_ReportError、Det_ReportTransientFault 与 Det_ReportRuntimeError 函数的每次调用应在 DLT 模块可用/已配置时转发至 DLT 模块。⌋(SRS_Diag_04101)
[SWS_Det_00039] ⌈ Det_ReportError、Det_ReportTransientFault 与 Det_ReportRuntimeError 函数应可重入。⌋(SRS_BSW_00312)
[SWS_Det_00026] ⌈ Det_ReportError 应停止执行。应确保 DET 运行时错误和 DET 瞬态故障的处理方式使得 DET 不会被递归调用。⌋(SRS_BSW_00337)
注:这种递归调用可能发生在通过 Error_Hook 调用了未初始化的模块时,将导致堆栈溢出。
7.4 版本信息(Version Information)
无与 BSW_General 中规范处理相偏离的内容。
7.5 错误分类(Error Classification)
默认错误追踪器具有以下 AUTOSAR 错误:
- 开发错误,参见 7.5.1
- 运行时错误:不适用
- 瞬态故障:不适用
- 生产错误:不适用
- 扩展生产错误:不适用
7.5.1 开发错误(Development Errors)
DET 自身不能报告开发错误,唯一的例外是 Det_GetVersionInfo 中的 DET_E_PARAM_POINTER:
[SWS_Det_00301] 开发错误类型(Development Error Types)⌈
| 错误类型(Type of error) | 相关错误码(Related error code) | 值(Value [hex]) |
|---|---|---|
Det_GetVersionInfo 被以空参数指针调用 | DET_E_PARAM_POINTER | 0x01 |
7.5.2 运行时错误(Runtime Errors)
DET 不能报告运行时错误。
7.5.3 瞬态故障(Transient Faults)
DET 不能报告瞬态故障。
7.5.4 生产错误(Production Errors)
DET 中无生产错误。
7.5.5 扩展生产错误(Extended Production Errors)
DET 中无扩展生产错误。
7.6 错误检测(Error detection)
默认错误函数的调用将触发对所有已配置回调函数的调用(参见参数 DetErrorHook、DetReportTransientFault 与 DetReportRuntimeError)。
[SWS_Det_00501] ⌈ Det_ReportError 的调用应调用 DetErrorHook 中配置的所有回调函数(参见参数 DetErrorHook、ECUC_Det_00005)。⌋(SRS_BSW_00345)
[SWS_Det_00502] ⌈ Det_ReportTransientFault 的调用应调用 DetReportTransientFaultCallout(ECUC_Det_00011)中配置的所有回调函数。⌋(SRS_BSW_00345)
[SWS_Det_00503] ⌈ Det_ReportRuntimeError 的调用应调用 DetReportRuntimeErrorCallout(ECUC_Det_00010)中配置的所有回调函数。⌋(SRS_BSW_00345)
注:若未配置任何 Error_Hook,则不会再调用其他函数。但若已配置,向 DLT 的转发(参见 DET0340 和 SWS_Det_00006_Conf)仍然有效。
7.7 错误通知(Error notification)
[SWS_Det_00052] ⌈ 当 Det_GetVersionInfo 出现空指针错误时,DET 应将错误 DET_E_PARAM_POINTER 通知给所有已配置的回调函数。⌋(SRS_BSW_00480)
8 API 规范(API specification)
本章给出默认错误追踪器 API 的规范。
8.1 API
8.1.1 导入类型(Imported types)
本节列出 API 所使用的所有导入类型。即使 DET 不要求新类型,一些 RTE 或组件类型也可用于钩子函数的配置。因此 DET 也具有针对服务接口模块的标准化 include 结构(参见 SRS_BSW_00447)。
| 模块(Module) | 头文件(Header File) | 导入类型(Imported Type) |
|---|---|---|
| Std_Types | StandardTypes.h | Std_ReturnType |
| StandardTypes.h | Std_VersionInfoType |
8.1.2 类型定义(Type definitions)
8.1.2.1 Det_ConfigType
[SWS_Det_00210] ⌈
| Name | Det_ConfigType |
| Type | Structure |
| Range | implementation specific |
| Description | Det 模块的配置数据结构 |
| Available via | Det.h |
8.1.3 函数定义(Function definitions)
8.1.3.1 Det_Init
[SWS_Det_00008] ⌈
| Service name | Det_Init | |
| Syntax | void Det_Init(const Det_ConfigType* ConfigPtr) | |
| Service ID [hex] | 0x00 | |
| Sync/Async | Synchronous | |
| Reentrancy | Non Reentrant | |
| Parameters (in) | ConfigPtr | 所选配置集的指针 |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | None | |
| Description | 默认错误追踪器的初始化服务 | |
| Available via | Det.h | |
8.1.3.2 Det_ReportError
[SWS_Det_00009] ⌈
| Service name | Det_ReportError | |
| Syntax | Std_ReturnType Det_ReportError(uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId) | |
| Service ID [hex] | 0x01 | |
| Sync/Async | Not Applicable: The function never returns | |
| Reentrancy | Reentrant | |
| Parameters (in) | ModuleId | 调用模块的模块 ID |
InstanceId | 模块基于索引的实例标识符,从 0 开始;若为单实例模块则传 0 | |
ApiId | 检测到错误的 API 服务 ID(在调用模块的 SWS 中定义) | |
ErrorId | 检测到的开发错误 ID(在调用模块的 SWS 中定义) | |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | Std_ReturnType | 从不返回值,但保留返回类型以兼容服务和钩子 |
| Description | 用于报告开发错误的服务 | |
| Available via | Det.h | |
注:Det_ReportError 可能在中断上下文中被调用。由于 DET 可在正常模式或中断上下文(从堆栈或集成)中调用,钩子函数的实现必须考虑:Det_ReportError 可能在中断上下文中被调用;在挂起系统时应予以考虑。
8.1.3.3 Det_Start
[SWS_Det_00010] ⌈
| Service name | Det_Start |
| Syntax | void Det_Start(void) |
| Service ID [hex] | 0x02 |
| Sync/Async | Synchronous |
| Reentrancy | Non Reentrant |
| Parameters (in) | None |
| Parameters (inout) | None |
| Parameters (out) | None |
| Return value | None |
| Description | 用于启动默认错误追踪器的服务 |
| Available via | Det.h |
8.1.3.4 Det_ReportRuntimeError
[SWS_Det_01001] ⌈
| Service name | Det_ReportRuntimeError | |
| Syntax | Std_ReturnType Det_ReportRuntimeError(uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId) | |
| Service ID [hex] | 0x04 | |
| Sync/Async | Synchronous | |
| Reentrancy | Reentrant | |
| Parameters (in) | ModuleId | 调用模块的模块 ID |
InstanceId | 模块基于索引的实例标识符,从 0 开始;若为单实例模块则传 0 | |
ApiId | 检测到错误的 API 服务 ID(在调用模块的 SWS 中定义) | |
ErrorId | 检测到的运行时错误 ID(在调用模块的 SWS 中定义) | |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | Std_ReturnType | 始终返回 E_OK(服务所需) |
| Description | 用于报告运行时错误的服务。若已配置回调,则会调用该回调 | |
| Available via | Det.h | |
注:Det_ReportRuntimeError 可能在中断上下文中被调用。DET 可在正常模式或中断上下文(从堆栈或集成)中调用,钩子函数的实现必须考虑:Det_ReportRuntimeError 可能在中断上下文中被调用;该钩子应可重入且具有足够的性能。
8.1.3.5 Det_ReportTransientFault
[SWS_Det_01003] ⌈
| Service name | Det_ReportTransientFault | |
| Syntax | Std_ReturnType Det_ReportTransientFault(uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 FaultId) | |
| Service ID [hex] | 0x05 | |
| Sync/Async | Synchronous | |
| Reentrancy | Reentrant | |
| Parameters (in) | ModuleId | 调用模块的模块 ID |
InstanceId | 模块基于索引的实例标识符,从 0 开始;若为单实例模块则传 0 | |
ApiId | 检测到瞬态故障的 API 服务 ID(在调用模块的 SWS 中定义) | |
FaultId | 检测到的瞬态故障 ID(在调用模块的 SWS 中定义) | |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | Std_ReturnType | 若不存在回调则返回 E_OK;否则返回所配置回调的返回值。若配置了多个回调,则返回各回调返回值的逻辑或(求和)。理由:由于 E_OK=0,只有所有回调都为 E_OK 时才会返回 E_OK;多个错误码场景下也有较大概率能检测到多个错误 |
| Description | 用于报告瞬态故障的服务。若已配置回调,则调用该回调并返回其返回值;否则直接返回 E_OK | |
| Available via | Det.h | |
注:Det_ReportTransientFault 可能在中断上下文中被调用。DET 可在正常模式或中断上下文(从堆栈或集成)中调用,钩子函数的实现必须考虑:Det_ReportTransientFault 可能在中断上下文中被调用;该钩子应可重入且具有足够的性能。
8.1.3.6 Det_GetVersionInfo
[SWS_Det_00011] ⌈
| Service name | Det_GetVersionInfo |
| Syntax | void Det_GetVersionInfo(Std_VersionInfoType* versioninfo) |
| Service ID [hex] | 0x03 |
| Sync/Async | Synchronous |
| Reentrancy | Reentrant |
| Parameters (in) | None |
| Parameters (inout) | None |
| Parameters (out) | versioninfo:存储本模块版本信息的指针 |
| Return value | None |
| Description | 返回本模块的版本信息 |
| Available via | Det.h |
若传入空指针,则返回 DET_E_PARAM_POINTER,参见 SWS_Det_00052。
8.1.4 期望接口(Expected Interfaces)
本节规范 DET 所要求的所有其他模块接口。
8.1.4.1 强制接口(Mandatory Interfaces)
没有强制期望接口,但所有被使用且被配置为回调的 <User_ErrorHooks> API 必须被包含。
注:用户 API 的名称不会被规范,<User_ErrorHook> 仅作为同义词。
注:可定义一个 User_ErrorHook 列表。
8.1.4.2 可选接口(Optional Interfaces)
本节定义完成默认错误追踪器可选功能所需的接口。
[SWS_Det_00211] ⌈
| API 函数 | 头文件 | 描述 |
|---|---|---|
Dlt_DetForwardErrorTrace | Dlt_Det.h | 用于将 DET 的错误报告转发至 DLT |
⌋
8.1.5 回调函数 / 可配置接口(Callout Functions / Configurable Interfaces)
[SWS_Det_00180] ⌈ 如果配置了回调函数,它们应具有与对应函数相同的签名。如果为同一服务定义了多个回调,它们应具有相同的 ID。⌋(SRS_BSW_00463,SRS_BSW_00394)
当 Det_ReportError 函数被调用时,所有配置的回调函数都将被调用(参见 SWS_Det_00501)。User_ErrorHooks 函数的 Service ID 应为 0x10。
[SWS_Det_00181] ⌈
| Service name | <User_Error_Hooks> | |
| Syntax | Std_ReturnType <User_Error_Hooks>(uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId) | |
| Service ID [hex] | 0x10 | |
| Sync/Async | Synchronous | |
| Reentrancy | Reentrant | |
| Parameters (in) | ModuleId | 调用模块的模块 ID |
InstanceId | 模块基于索引的实例标识符,从 0 开始;若为单实例模块则传 0 | |
ApiId | 检测到错误的 API 服务 ID(在调用模块的 SWS 中定义) | |
ErrorId | 检测到的开发错误 ID(在调用模块的 SWS 中定义) | |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | Std_ReturnType | 始终返回 E_OK(服务所需) |
| Description | — | |
| Available via | Det_Externals.h | |
当 Det_ReportRuntimeError 函数被调用时,所有配置的回调函数都将被调用(参见 SWS_Det_00503)。DetReportRuntimeErrorCallout 函数的 Service ID 应为 0x11。
[SWS_Det_00184] ⌈
| Service name | <DetReportRuntimeErrorCallout> | |
| Syntax | Std_ReturnType <DetReportRuntimeErrorCallout>(uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId) | |
| Service ID [hex] | 0x11 | |
| Sync/Async | Synchronous | |
| Reentrancy | Reentrant | |
| Parameters (in) | ModuleId | 调用模块的模块 ID |
InstanceId | 模块基于索引的实例标识符,从 0 开始;若为单实例模块则传 0 | |
ApiId | 检测到错误的 API 服务 ID(在调用模块的 SWS 中定义) | |
ErrorId | 检测到的运行时错误 ID(在调用模块的 SWS 中定义) | |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | Std_ReturnType | 始终返回 E_OK(服务所需) |
| Description | — | |
| Available via | Det_Externals.h | |
当 Det_ReportTransientFault 函数被调用时,所有配置的回调函数都将被调用(参见 SWS_Det_00502)。DetReportTransientFaultCallout 函数的 Service ID 应为 0x12。
[SWS_Det_00187] ⌈
| Service name | <DetReportTransientFaultCallout> | |
| Syntax | Std_ReturnType <DetReportTransientFaultCallout>(uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 FaultId) | |
| Service ID [hex] | 0x12 | |
| Sync/Async | Synchronous | |
| Reentrancy | Reentrant | |
| Parameters (in) | ModuleId | 调用模块的模块 ID |
InstanceId | 模块基于索引的实例标识符,从 0 开始;若为单实例模块则传 0 | |
ApiId | 检测到瞬态故障的 API 服务 ID(在调用模块的 SWS 中定义) | |
FaultId | 检测到的瞬态故障 ID(在调用模块的 SWS 中定义) | |
| Parameters (inout) | None | |
| Parameters (out) | None | |
| Return value | Std_ReturnType | 值将传播给 Det_ReportTransientFault 的调用者 |
| Description | — | |
| Available via | Det_Externals.h | |
8.2 服务接口(Service Interfaces)
8.2.1 端口与端口接口规范(Specification of the Ports and Port Interfaces)
本节规范通过 VFB 操作默认错误追踪器功能所需的端口与端口接口。
每个使用该服务的 AUTOSAR SW-C 必须在自身 SW-C 描述中包含"服务端口"(service ports),这些端口由相同的接口类型化,并必须与默认错误追踪器的端口相连,以便能生成 RTE、相应 ID 与所需符号。
8.2.1.1 通用方法(General Approach)
由于需要传递多个参数,使用客户端-服务器范式(client-server paradigm)。
为复用 BSW 模块 DET 中已定义的 C API,DET 服务使用与 C API 相同的参数名称,即便这些名称不能直接映射到 SW-C 世界。"Module ID" 最好被解释为组件或可运行实体之一,但这由 SW-C 的实现者决定。
DET 服务需要 "Module ID" 作为 C 函数的第一个参数。
为使客户端代码独立于客户端数量的配置,"Module ID" 不由客户端传递给 DET,而是被建模为 DET 侧 Provide 端口的"port defined argument value"。其结果是"Module ID"不会作为 client-server 接口操作的参数出现。进一步结果是为每个 "Module ID" 在客户端和服务器侧都会有独立的端口。
Module ID 类型的范围为 0…65535。范围 0…255 内的值预留给 BSW 模块,其他值可用于应用软件组件。
8.2.1.2 数据类型(Data Types)
[SWS_Det_00200] ⌈ 对于默认错误追踪器服务的端口接口,需要 uint8 和 uint16,它们引用 AUTOSAR 数据类型。⌋(SRS_Diag_04087)
8.2.1.3 端口接口(Port Interface)
[SWS_Det_00202] ⌈
| Name | DETService | |
| Comment | 默认错误追踪器的服务 | |
| IsService | true | |
| Variation | -- | |
| Possible Errors | 0 | E_OK |
Operations
| ReportError | ||
| Comments | 使用端口的 Module ID 调用 Det_ReportError | |
| Variation | -- | |
| Parameters | ApiId | Comment:检测到错误的 API 服务 ID(在调用模块的 SWS 中定义) |
Type:uint8 | ||
| Variation:-- | ||
| Direction:IN | ||
ErrorId | Comment:检测到的开发错误 ID(在调用模块的 SWS 中定义) | |
Type:uint8 | ||
| Variation:-- | ||
| Direction:IN | ||
| Possible Errors | E_OK | 成功报告错误 |
| ReportRuntimeError | ||
| Comments | 使用端口的 Module ID 调用 ReportRuntimeError | |
| Variation | -- | |
| Parameters | ApiId | Comment:检测到错误的 API 服务 ID(在调用模块的 SWS 中定义) |
Type:uint8 | ||
| Variation:-- | ||
| Direction:IN | ||
ErrorId | Comment:检测到的运行时错误 ID(在调用模块的 SWS 中定义) | |
Type:uint8 | ||
| Variation:-- | ||
| Direction:IN | ||
| Possible Errors | E_OK | 成功报告错误 |
8.2.2 服务定义(Definition of the Service)
[SWS_Det_00203] ⌈ C-API 的参数 ModuleId 和 InstanceId 用于通过"port defined argument value"标识组件和组件实例。ApiId 和 ErrorId 参数在 AUTOSAR 中对软件组件未作标准化。其语义由 SW-C 实现者决定。然而,ApiId 通常对应可报告错误的操作,ErrorId 对应所报告错误的类型。ApiId 和 ErrorId 的编号范围为 0x00..0xFF,无特定顺序。注意返回值始终为 true(E_OK),因为所有服务都需要 Std_ReturnType。⌋(SRS_Diag_04087)
[SWS_Det_00204] ⌈ Provide Port 与 DET 的内部行为存在一定关系:每次调用时,"Module ID" 由 RTE 作为额外参数传递给实现相关可运行实体的 C 函数("port defined argument value" 特性)。⌋(SRS_Diag_04087)
DET 应为每个配置的 SWC 模块按如下名称提供一个 Port:
[SWS_Det_00205] ⌈
| Name | Det_{Name} | ||
| Kind | ProvidedPort | Interface | DETService |
| Description | -- | ||
| Port Defined Argument Value(s) | Type | uint16 | |
| Value | {ecuc(Det/DetConfigSet/DetModule/DetModuleId.value)} | ||
| Type | uint8 | ||
| Value | {ecuc(Det/DetConfigSet/DetModule/DetModuleInstance/DetInstanceId.value)} | ||
| Variation | Name = {ecuc(Det/DetConfigSet/DetModule.SHORT-NAME)}_{ecuc(Det/DetConfigSet/DetModule/DetModuleInstance.SHORT-NAME)} | ||
8.2.3 DET 的配置(Configuration of the DET)
[SWS_Det_00206] ⌈ DET 服务的 "Module ID" 被建模为 "port defined argument value"。因此这些值的配置属于 RTE 配置的一部分。预编译配置可通过修改客户端(SW-C)或服务(即 DET)侧端口的 XML 规范完成。⌋(SRS_Diag_04087)
9 序列图(Sequence diagrams)
9.1 初始化(Initialization)
图 1:DET 初始化与启动序列
┌──────┐ ┌──────┐ │EcuM │ │ Det │ └──┬───┘ └──┬───┘ │ Det_Init() │ │─────────────────────────────────────►│ │ Det_Init() │ │◄─────────────────────────────────────│ │ Det_Start() │ │─────────────────────────────────────►│ │ Det_Start() │ │◄─────────────────────────────────────│ 注释:默认错误追踪器的初始化以同步方式执行
9.2 错误报告(Error Reporting)
存在不同的场景:每个错误类(DevelopmentError、RuntimeError 与 TransientFault)各一个;每种配置(未配置钩子、至少配置一个钩子)各一个。
图 2:Det_ReportError 配已配置钩子(流程:Det User → Det → Integrator Code;<Det_Notification> 已配置 → 调用 <User_ErrorHooks>(return, ModuleId, InstanceId, ApiId, ErrorId) → 返回 E_OK → HALT)
图 3:Det_ReportError 未配置钩子(<Det_Notification> 未配置 → 直接 HALT)
图 4:Det_ReportRuntimeError 配已配置钩子(<Det_General> configured RuntimeError callouts → 调用 <Det_ReportRuntimeErrorCallout> → 返回 E_OK)
图 5:Det_ReportRuntimeError 未配置钩子(<Det_Notification> RuntimeError callouts NOT configured → 直接返回 E_OK)
图 6:Det_ReportTransientFault 配已配置钩子(<Det_Notification> configured TransientFault callouts → 调用 <Det_ReportTransientFaultCallout> → 返回 X → 传播给调用者)
图 7:Det_ReportTransientFault 未配置钩子(<Det_Notification> TransientFault callouts NOT configured → 直接返回 E_OK)
10 配置规范(Configuration specification)
10.1 容器与配置参数(Containers and configuration parameters)
DET 的参数在以下小节中描述。
图 8:DET 参数的容器结构概览(参见 PDF 第 35-36 页的 UML 类图)。
容器结构(简化):
Det (EcucModuleDef, 0..1)
├── DetGeneral (1..1)
│ ├── DetVersionInfoApi (EcucBooleanParamDef, default=false)
│ └── DetForwardToDlt (EcucBooleanParamDef, 0..1)
├── DetNotification (0..1)
│ ├── DetErrorHook (EcucFunctionNameDef, 0..*)
│ ├── DetReportRuntimeErrorCallout (EcucFunctionNameDef, 0..*)
│ └── DetReportTransientFaultCallout (EcucFunctionNameDef, 0..*)
└── DetConfigSet (0..1)
└── DetModule (0..*)
├── DetModuleId (EcucIntegerParamDef, 1, range 4096..65535)
└── DetModuleInstance (1..*)
└── DetInstanceId (EcucIntegerParamDef, 1, range 0..255, default=0)
10.1.1 Det
| SWS Item | ECUC_Det_00001 | |
| Module Name | Det | |
| Module Description | DET 配置包含通知时要调用的函数。应用函数在某侧被规范,通常可以决定每次 DET 调用时是否调用 Dlt | |
| Post-Build Variant Support | false | |
| Supported Config Variants | VARIANT-PRE-COMPILE | |
Included Containers:
| Container Name | Multiplicity | Scope / Dependency |
|---|---|---|
DetConfigSet | 0..1 | Det 的配置集容器 |
DetGeneral | 1 | Det 模块的通用配置参数 |
DetNotification | 0..1 | 通知函数的配置 |
10.1.2 DetGeneral
| SWS Item | ECUC_Det_00002 |
| Container Name | DetGeneral |
| Description | Det 模块的通用配置参数 |
Configuration Parameters:
| SWS Item | ECUC_Det_00006 | |
| Name | DetForwardToDlt | |
| Parent Container | DetGeneral | |
| Description | 仅当该参数存在且设置为 true 时,Det 需要 Dlt 接口并将其调用转发至函数 Dlt_DetForwardErrorTrace。在这种情况下需要 Dlt_Det 的可选接口 | |
| Multiplicity | 0..1 | |
| Type | EcucBooleanParamDef | |
| Default value | -- | |
| Post-Build Variant Multiplicity | false | |
| Post-Build Variant Value | false | |
| Multiplicity Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
| SWS Item | ECUC_Det_00003 | |
| Name | DetVersionInfoApi | |
| Parent Container | DetGeneral | |
| Description | 用于启用/禁用读取模块版本信息 API 的预处理器开关。 — true:启用版本信息 API — false:禁用版本信息 API | |
| Multiplicity | 1 | |
| Type | EcucBooleanParamDef | |
| Default value | false | |
| Post-Build Variant Value | false | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
10.1.3 DetNotification
| SWS Item | ECUC_Det_00004 |
| Container Name | DetNotification |
| Description | 通知函数的配置 |
Configuration Parameters:
| SWS Item | ECUC_Det_00005 | |
| Name | DetErrorHook | |
| Parent Container | DetNotification | |
| Description | 在每次调用 Det_ReportError 上下文中由默认错误追踪器调用的可选函数列表。这些函数的类型应与 Det_ReportError 自身相同:Std_ReturnType (*f)(uint16, uint8, uint8, uint8) | |
| Multiplicity | 0..* | |
| Type | EcucFunctionNameDef | |
| Default value | -- | |
| maxLength | -- | |
| minLength | -- | |
| regularExpression | -- | |
| Post-Build Variant Multiplicity | false | |
| Post-Build Variant Value | false | |
| Multiplicity Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
| SWS Item | ECUC_Det_00010 | |
| Name | DetReportRuntimeErrorCallout | |
| Parent Container | DetNotification | |
| Description | 该参数定义相应运行时错误处理器回调函数的存在性及其名称。这些函数的类型应与 Det_ReportRuntimeError 自身相同:Std_ReturnType (*f)(uint16, uint8, uint8, uint8) | |
| Multiplicity | 0..* | |
| Type | EcucFunctionNameDef | |
| Default value | -- | |
| maxLength | -- | |
| minLength | -- | |
| regularExpression | -- | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
| SWS Item | ECUC_Det_00011 | |
| Name | DetReportTransientFaultCallout | |
| Parent Container | DetNotification | |
| Description | 该参数定义相应瞬态故障处理器回调函数的存在性及其名称。这些函数的类型应与 Det_ReportTransientFault 自身相同:Std_ReturnType (*f)(uint16, uint8, uint8, uint8) | |
| Multiplicity | 0..* | |
| Type | EcucFunctionNameDef | |
| Default value | -- | |
| maxLength | -- | |
| minLength | -- | |
| regularExpression | -- | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
No Included Containers
10.1.4 DetConfigSet
| SWS Item | ECUC_Det_00007 |
| Container Name | DetConfigSet |
| Description | Det 的配置集容器 |
Included Containers:
| Container Name | Multiplicity | Scope / Dependency |
|---|---|---|
DetModule | 0..* | 该容器描述了通过 Service Interface 使用 Det 的非 BSW 模块 |
10.1.5 DetModule
| SWS Item | ECUC_Det_00008 |
| Container Name | DetModule |
| Description | 该容器描述了通过 Service Interface 使用 Det 的非 BSW 模块 |
Configuration Parameters:
| SWS Item | ECUC_Det_00009 | |
| Name | DetModuleId | |
| Parent Container | DetModule | |
| Description | 错误报告组件的唯一标识符。向 DET 报告错误时,必须使用从 moduleID 派生的符号名来标识报告者 | |
| Multiplicity | 1 | |
| Type | EcucIntegerParamDef(为此参数生成符号名) | |
| Range | 4096 .. 65535 | |
| Default value | -- | |
| Post-Build Variant Value | false | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
Included Containers:
| Container Name | Multiplicity | Scope / Dependency |
|---|---|---|
DetModuleInstance | 1..* | 描述相应 Service Port 使用的实例;用于在使用多实例化时区分软件组件实例 |
10.1.6 DetModuleInstance
| SWS Item | ECUC_Det_00013 | |
| Container Name | DetModuleInstance | |
| Description | 描述相应 Service Port 使用的实例。用于在使用多实例化时区分软件组件实例 | |
| Post-Build Variant Multiplicity | true | |
| Multiplicity Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- |
Configuration Parameters:
| SWS Item | ECUC_Det_00012 | |
| Name | DetInstanceId | |
| Parent Container | DetModuleInstance | |
| Description | 描述相应 Service Port 使用的 InstanceId。用于在使用多实例化时区分软件组件实例。否则应设置为 0 | |
| Multiplicity | 1 | |
| Type | EcucIntegerParamDef | |
| Range | 0 .. 255 | |
| Default value | 0 | |
| Post-Build Variant Value | false | |
| Value Configuration Class | Pre-compile time | X All Variants |
| Link time | -- | |
| Post-build time | -- | |
| Scope / Dependency | scope: local | |
No Included Containers
10.2 发布信息(Published Information)
如适用,会列出附加的模块特定发布参数。本 DET 规范中无附加发布参数。
11 不适用的需求(Not applicable requirements)
[SWS_Det_00999] ⌈ 这些需求不适用于本规范。⌋(SRS_BSW_00301,SRS_BSW_00304,SRS_BSW_00305,SRS_BSW_00306,SRS_BSW_00307,SRS_BSW_00308,SRS_BSW_00309,SRS_BSW_00439,SRS_BSW_00314,SRS_BSW_00325,SRS_BSW_00328,SRS_BSW_00330,SRS_BSW_00331,SRS_BSW_00334,SRS_BSW_00335,SRS_BSW_00341,SRS_BSW_00342,SRS_BSW_00343,SRS_BSW_00347,SRS_BSW_00441,SRS_BSW_00353,SRS_BSW_00350,SRS_BSW_00359,SRS_BSW_00360,SRS_BSW_00440,SRS_BSW_00361,SRS_BSW_00371,SRS_BSW_00373,SRS_BSW_00377,SRS_BSW_00378,SRS_BSW_00379,SRS_BSW_00401,SRS_BSW_00410,SRS_BSW_00413,SRS_BSW_00415,SRS_BSW_00005,SRS_BSW_00006,SRS_BSW_00007,SRS_BSW_00009,SRS_BSW_00010,SRS_BSW_00158,SRS_BSW_00160,SRS_BSW_00161,SRS_BSW_00162,SRS_BSW_00164,SRS_BSW_00172,SRS_BSW_00344,SRS_BSW_00404,SRS_BSW_00405,SRS_BSW_00170,SRS_BSW_00380,SRS_BSW_00419,SRS_BSW_00381,SRS_BSW_00412,SRS_BSW_00383,SRS_BSW_00388,SRS_BSW_00389,SRS_BSW_00390,SRS_BSW_00393,SRS_BSW_00395,SRS_BSW_00396,SRS_BSW_00397,SRS_BSW_00398,SRS_BSW_00399,SRS_BSW_00400,SRS_BSW_00438,SRS_BSW_00375,SRS_BSW_00416,SRS_BSW_00406,SRS_BSW_00437,SRS_BSW_00168,SRS_BSW_00407,SRS_BSW_00423,SRS_BSW_00424,SRS_BSW_00425,SRS_BSW_00426,SRS_BSW_00427,SRS_BSW_00428,SRS_BSW_00429,SRS_BSW_00432,SRS_BSW_00433,SRS_BSW_00336,SRS_BSW_00369,SRS_BSW_00339,SRS_BSW_00348,SRS_BSW_00357,SRS_BSW_00422,SRS_BSW_00417,SRS_BSW_00323,SRS_BSW_00004,SRS_BSW_00409,SRS_BSW_00385,SRS_BSW_00386,SRS_BSW_00458,SRS_BSW_00466)
📋 校对记录
L1 量化校对:
- 需求 ID 总数:35 个 SWS_Det_* 需求(含 SWS_Det_00008/00009/00010/00011/00014/00015/00018/00019/00020/00024/00025/00026/00034/00035/00037/00039/00052/00180/00181/00184/00187/00200/00202/00203/00204/00205/00206/00207/00210/00211/00301/00501/00502/00503/00999/01001/01003 — 实际 36 个,全部在 HTML 中保留原 ID 与章节锚点)
- SRS 追溯总数:100 行(SRS_BSW_* + SRS_Diag_*,第 6 章表格全部保留)
- API 函数:6 个(Det_Init、Det_ReportError、Det_Start、Det_ReportRuntimeError、Det_ReportTransientFault、Det_GetVersionInfo)
- Callout 接口:3 个(<User_Error_Hooks>、<DetReportRuntimeErrorCallout>、<DetReportTransientFaultCallout>)
- ECUC 配置参数:13 个(ECUC_Det_00001-00013)
- 错误码:1 个(DET_E_PARAM_POINTER = 0x01)
- Service ID:6 个(0x00-0x05)+ 3 个 Callout(0x10/0x11/0x12)
- 配置容器层级:3 级(Det → DetModule → DetModuleInstance)
保留原文项目:术语 DET/Det、EcuM、ModeM、NVRAM、Dem、DLT、SW-C、VFB、port defined argument value、pre/post-compile、pre/post-build、link-time、ECUC_*/SRS_*/SWS_Det_*、Service ID、uint8/uint16/Std_ReturnType/Std_VersionInfoType、EcucBooleanParamDef、EcucFunctionNameDef、EcucIntegerParamDef、EcucModuleDef、EcucParamConfContainerDef、EcucModuleDef、VARIANT-PRE-COMPILE、Det.h/Det_Externals.h/Dlt_Det.h、symbolic name、E_OK、HALT、NOTE、Default。
翻译日期:2026-06-13 · 校对人:opencode translator · 页数:42 页 · 评级:A 级(结构与原文 1:1 完整对应)