# 内存抽象接口规范 > **文档标题**: Specification of Memory Abstraction Interface > **AUTOSAR CP Release**: 4.4.0 > **文档编号**: 285 > **文档类型**: SWS (Software Specification) --- ## 文档标识 | 项目 | 内容 | |------|------| | Document Title | Specification of Memory Abstraction Interface | | Document Owner | AUTOSAR | | Document Responsibility | AUTOSAR | | Document Identification No | 285 | | Document Status | Final | | Part of AUTOSAR Standard | Classic Platform | | Part of Standard Release | 4.4.0 | --- ## 文档变更历史 | 日期 | 版本 | 变更者 | 变更描述 | |------|------|--------|----------| | 2018-10-31 | 4.4.0 | AUTOSAR Release Management | 编辑性修订 | | 2017-12-08 | 4.3.1 | AUTOSAR Release Management | 编辑性修订 | | 2016-11-30 | 4.3.0 | AUTOSAR Release Management | 更新追溯信息;编辑性修订 | | 2015-07-31 | 4.2.2 | AUTOSAR Release Management | 块结果 MEMIF_BLOCK_INCONSISTENT 扩展为找不到的块;错误分类重做;增加需求链接 | | 2014-10-31 | 4.2.1 | AUTOSAR Release Management | 需求与特性、通用和模块特定需求关联 | | 2014-03-31 | 4.1.3 | AUTOSAR Release Management | 编辑性修订 | | 2013-10-31 | 4.1.2 | AUTOSAR Release Management | 移除模块主函数的时序需求;为 Fee_Write 函数原型增加 const 限定符;新增 FeeMainFunctionPeriod 配置参数 | | 2013-03-15 | 4.1.1 | AUTOSAR Administration | 按新的 SWS_BSWGeneral 重做;第 10 章表格中增加 Scope 属性;包含文件结构变更(清理);为类型定义增加需求 ID | | 2011-12-22 | 4.0.3 | AUTOSAR Administration | 模块简称变更;一致性检查重新表述 | | 2010-09-30 | 3.1.5 | AUTOSAR Administration | 增加 NULL 指针检查;模块间检查细化 | | 2010-02-02 | 3.1.4 | AUTOSAR Administration | 返回值描述扩充;文件包含结构变更;变体需求描述增加;法律免责声明修订 | | 2008-08-13 | 3.1.1 | AUTOSAR Administration | 法律免责声明修订 | | 2007-12-21 | 3.0.1 | AUTOSAR Administration | 文件包含结构更新;各种 API 返回类型适配;配置参数范围调整 | | 2006-05-16 | 2.0 | AUTOSAR Administration | 初始版本发布 | --- ## 目录 1. [介绍与功能概述](#1-介绍与功能概述) 2. [缩略语](#2-缩略语) 3. [相关文档](#3-相关文档) 4. [约束与假设](#4-约束与假设) 5. [模块依赖](#5-模块依赖) 6. [需求追溯](#6-需求追溯) 7. [功能规范](#7-功能规范) 8. [API 规范](#8-api-规范) 9. [时序图](#9-时序图) 10. [配置规范](#10-配置规范) 11. [不适用需求](#11-不适用需求) --- ## 1 介绍与功能概述 本规范描述 AUTOSAR 基础软件模块 "Memory Abstraction Interface" (MemIf) 的功能、API 和配置。本模块允许 NVRAM 管理器访问多个内存抽象模块(FEE 或 EA 模块)。 ``` NVRAM Manager │ ▼ Memory Hardware Abstraction ├── Memory Abstraction Interface (MemIf) │ │ │ ▼ ├── Flash EEPROM Emulation (FEE) ─── ▶ Flash Driver └── EEPROM Abstraction (EA) ─── ▶ EEPROM Driver ↕ Vendor Specific Library ``` *图 1:内存硬件抽象层模块概览* Memory Abstraction Interface (MemIf) 应抽象出底层 FEE 或 EA 模块的数量,并为上层提供统一线性地址空间上的虚拟分段。 --- ## 2 缩略语 | 缩写/缩略语 | 描述 | |--------|------| | EA | EEPROM Abstraction(EEPROM 抽象) | | EEPROM | 电可擦可编程只读存储器 | | FEE | Flash EEPROM Emulation(Flash EEPROM 仿真) | | LSB | 最低有效位/字节(根据上下文)。此处指位。 | | MemIf | Memory Abstraction Interface(内存抽象接口) | | MSB | 最高有效位/字节(根据上下文)。此处指位。 | | NvM | NVRAM Manager | | NVRAM | 非易失 RAM | | Fast Mode(快速模式) | 例如在启动/关机期间,底层驱动可切换到快速模式,以便在那些阶段进行快速读/写。
注:这是否可能取决于驱动的实现和底层设备的能力。是否这样做取决于 NVRAM 管理器的配置以及特定项目的需求。 | | Slow Mode(慢速模式) | 在正常运行期间,底层驱动可在慢速模式下使用,以减少运行时间或底层设备/通信媒体的阻塞时间方面的资源使用。 | | Vendor specific library(厂商特定库) | 厂商特定库分别是 FEE/FLS 和 EA/EEP 模块的 ICC-2 实现。它提供与相应 ICC-3 实现相同的上层接口(API)和功能。 | --- ## 3 相关文档 ### 3.1 输入文档 [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] General Requirements on SPAL — AUTOSAR_SRS_SPALGeneral.pdf [5] Requirements on Memory Hardware Abstraction Layer — AUTOSAR_SRS_MemoryHWAbstractionLayer [6] Specification of Default Error Tracer — AUTOSAR_SWS_DefaultErrorTracer.pdf [7] General Specification of Basic Software Modules — AUTOSAR_SWS_BSWGeneral.pdf ### 3.2 相关标准与规范 [7] Specification of NVRAM Manager — AUTOSAR_SWS_NVRAMManager [8] Specification of Flash EEPROM Emulation — AUTOSAR_SWS_FlashEEPROMEmulation.pdf [9] Specification of EEPROM Abstraction — AUTOSAR_SWS_EEPROMAbstraction.pdf ### 3.3 相关规范 AUTOSAR 提供基础软件模块的通用规范(SWS BSW General),也适用于 Memory Abstraction Interface。 --- ## 4 约束与假设 ### 4.1 限制 无限制。 ### 4.2 适用车型领域 无限制。 --- ## 5 模块依赖 (无具体描述) --- ## 6 需求追溯 | 需求 | 描述 | 满足者 | |------|------|--------| | RS_BRF_01472 | AUTOSAR 应支持模式 | SWS_MemIf_00038 | | RS_BRF_02272 | AUTOSAR 应提供应用软件行为的追踪 | SWS_MemIf_00042 | | SRS_BSW_00323 | 所有 AUTOSAR BSW 模块应检查传入的 API 参数有效性 | SWS_MemIf_00022 | | SRS_BSW_00327 | 错误值命名规范 | SWS_MemIf_00006 | | SRS_BSW_00386 | 公约的产品错误代码 | SWS_MemIf_00023 | | SRS_BSW_00392 | 模块特定类型定义 | SWS_MemIf_00037, 00064, 00065, 00066 | | SRS_BSW_00407 | 版本信息 API | SWS_MemIf_00045 | | SRS_MemHwAb_14010 | FEE 与 EA 模块应提供仅操作完整已配置逻辑块的写服务 | SWS_MemIf_00040 | | SRS_MemHwAb_14019 | 内存抽象接口应提供对底层内存抽象模块 API 服务的统一访问 | SWS_MemIf_00017 | | SRS_MemHwAb_14020 | 内存抽象接口应允许使用设备索引选择底层内存抽象模块 | SWS_MemIf_00011, 00018, 00035 | | SRS_MemHwAb_14021 | 内存抽象接口应允许预编译时配置底层内存抽象模块的数量 | SWS_MemIf_00018, 00019, 00020, 00022 | | SRS_MemHwAb_14022 | 内存抽象接口应保留底层内存抽象模块的功能 | SWS_MemIf_00010, 00017, 00038, 00039, 00040, 00041, 00042, 00043, 00044, 00046 | | SRS_MemHwAb_14023 | 内存抽象接口应仅检查接口本身内使用的参数 | SWS_MemIf_00022 | | SRS_MemHwAb_14028 | FEE 与 EA 模块应提供使逻辑块无效化的服务 | SWS_MemIf_00044 | | SRS_MemHwAb_14029 | FEE 与 EA 模块应提供允许读取逻辑块全部或部分的读服务 | SWS_MemIf_00039 | | SRS_MemHwAb_14031 | FEE 与 EA 模块应提供允许取消正在进行的异步操作的服务 | SWS_MemIf_00041 | | SRS_MemHwAb_14032 | FEE 与 EA 模块应提供仅操作包含立即数据的完整逻辑块的擦除服务 | SWS_MemIf_00046 | | SRS_SPAL_12078 | 驱动应以内存和运行时资源最有效的方式编码 | SWS_MemIf_00019, 00020 | | SRS_SPAL_12448 | 所有驱动模块在检测到开发错误后应有特定行为 | SWS_MemIf_00023 | 更多 SRS_BSW_* 与 SRS_SPAL_* 需求由 SWS_MemIf_00999(不适用)满足,详见第 11 章。 --- ## 7 功能规范 ### 7.1 错误分类 #### 7.1.1 开发错误 [SWS_MemIf_00006] ⌈Memory Abstraction Interface 应根据其配置(开发/生产)能够检测以下错误和异常: | 错误类型 | 相关性 | 相关错误代码 | 值[hex] | |---------|--------|--------------|---------| | 用错误设备索引参数调用 API 服务 | Development | MEMIF_E_PARAM_DEVICE | 0x01 | | 用 NULL 指针参数调用 API 服务 | Development | MEMIF_E_PARAM_POINTER | 0x02 | ⌋ (SRS_BSW_00337, SRS_BSW_00386, SRS_BSW_00327) #### 7.1.2 运行时错误 无此类错误。 #### 7.1.3 瞬态故障 无此类错误。 #### 7.1.4 生产错误 无此类错误。 #### 7.1.5 扩展生产错误 无此类错误。 --- ## 8 API 规范 ### 8.1 导入的类型 #### 8.1.1 标准类型 [SWS_MemIf_00037] ⌈ | 模块 | 头文件 | 导入类型 | |------|--------|----------| | Std_Types | StandardTypes.h | Std_ReturnType | | Std_Types | StandardTypes.h | Std_VersionInfoType | ⌋ (SRS_BSW_00392) ### 8.2 类型定义 [SWS_MemIf_00010] ⌈本章规定的类型不应针对特定内存抽象模块或硬件平台被更改或扩展。⌋ (SRS_MemHwAb_14022) [SWS_MemIf_00011] ⌈内存设备索引的数据类型应为 uint8。此设备索引使用的最低值应为 0。因此允许的索引范围应为 `0..MEMIF_NUMBER_OF_DEVICES-1`。⌋ (SRS_MemHwAb_14020) #### 8.2.1 MemIf_StatusType [SWS_MemIf_00064] ⌈ | 项 | 内容 | |-----|------| | Name | MemIf_StatusType | | Type | Enumeration | | Range | MEMIF_UNINIT — 底层抽象模块或设备驱动尚未初始化
MEMIF_IDLE — 底层抽象模块或设备驱动当前空闲
MEMIF_BUSY — 底层抽象模块或设备驱动当前忙
MEMIF_BUSY_INTERNAL — 底层抽象模块正忙于内部管理操作。底层设备驱动可以忙或空闲。 | | Description | 表示底层抽象模块和设备驱动的当前状态。 | | Available via | MemIf.h | ⌋ (SRS_BSW_00392) #### 8.2.2 MemIf_JobResultType [SWS_MemIf_00065] ⌈ | 项 | 内容 | |-----|------| | Name | MemIf_JobResultType | | Type | Enumeration | | Range | MEMIF_JOB_OK — 作业已成功完成
MEMIF_JOB_FAILED — 作业未成功完成
MEMIF_JOB_PENDING — 作业尚未完成
MEMIF_JOB_CANCELED — 作业已被取消
MEMIF_BLOCK_INCONSISTENT — 1. 请求的块不一致,可能包含损坏数据;2. 块未找到
MEMIF_BLOCK_INVALID — 请求的块已被标记为无效,无法执行请求的操作 | | Description | 表示上次作业的结果。 | | Available via | MemIf.h | ⌋ (SRS_BSW_00392) #### 8.2.3 MemIf_ModeType [SWS_MemIf_00066] ⌈ | 项 | 内容 | |-----|------| | Name | MemIf_ModeType | | Type | Enumeration | | Range | MEMIF_MODE_SLOW — 底层内存抽象模块和驱动工作于慢速模式
MEMIF_MODE_FAST — 底层内存抽象模块和驱动工作于快速模式 | | Description | 表示底层抽象模块和设备驱动的操作模式。 | | Available via | MemIf.h | ⌋ (SRS_BSW_00392) ### 8.3 函数定义 [SWS_MemIf_00017] ⌈本章规定的 API 应映射到底层内存抽象模块的 API。功能行为请分别参考那些模块的规范或底层内存驱动的规范。⌋ (SRS_MemHwAb_14019, SRS_MemHwAb_14022) [SWS_MemIf_00018] ⌈参数 DeviceIndex 应用于选择内存抽象模块(从而选择内存设备)。如果仅配置了一个内存抽象模块,参数 DeviceIndex 应被忽略。⌋ (SRS_MemHwAb_14020, SRS_MemHwAb_14021) [SWS_MemIf_00019] ⌈如果仅配置了一个内存抽象模块,Memory Abstraction Interface 应实现为一组宏,将 Memory Abstraction Interface API 映射到相应内存抽象模块的 API。⌋ (SRS_SPAL_12078, SRS_MemHwAb_14021) **示例:** ```c #define MemIf_Write(DeviceIndex, BlockNumber, DataPtr) \ Fee_Write(BlockNumber, DataPtr) ``` [SWS_MemIf_00020] ⌈如果配置了多个内存抽象模块,Memory Abstraction Interface 应使用高效机制将 API 调用映射到适当的内存抽象模块。⌋ (SRS_SPAL_12078, SRS_MemHwAb_14021) **注**:一种解决方案是使用函数指针表,以参数 DeviceIndex 作为数组索引。 **示例:** ```c #define MemIf_Write(DeviceIndex, BlockNumber, DataPtr) \ MemIf_WriteFctPtr[DeviceIndex](BlockNumber,DataPtr) ``` [SWS_MemIf_00022] ⌈如果配置了多个内存抽象模块且为此模块启用了开发错误检测,Memory Abstraction Interface API 的函数应在模块的服务内检查参数 DeviceIndex 是否为现有设备或广播标识符。⌋ (SRS_BSW_00323, SRS_MemHwAb_14021, SRS_MemHwAb_14023) [SWS_MemIf_00023] ⌈Memory Abstraction Interface API 的函数应将归因于非法参数 DeviceIndex 的检测错误以错误码 `MEMIF_E_PARAM_DEVICE` 报告给 Default Error Tracer (DET),且不应执行被调用的服务。⌋ (SRS_BSW_00386, SRS_SPAL_12448) [SWS_MemIf_00024] ⌈如果 Memory Abstraction Interface API 的被调用函数检测到归因于非法参数 DeviceIndex 的错误且具有返回值,应设置如下: - `MemIf_GetStatus`: `MEMIF_UNINIT` - `MemIf_GetJobResult`: `MEMIF_JOB_FAILED` - 所有其他函数: `E_NOT_OK`⌋ (SRS_BSW_00369) #### 8.3.1 MemIf_SetMode [SWS_MemIf_00038] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_SetMode | | Syntax | `void MemIf_SetMode(MemIf_ModeType Mode)` | | Service ID[hex] | 0x01 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | Mode | | Return value | None | | Description | 调用所有底层内存抽象模块的 "SetMode" 函数。 | | Available via | MemIf.h | ⌋ (RS_BRF_01472, SRS_MemHwAb_14022) **注**:上面函数中故意省略了设备索引,即 Memory Interface 应将所有底层模块切换到请求的模式。在这种情况下,不需要额外的"广播"参数,因为设备不应单独切换到不同的模式。 #### 8.3.2 MemIf_Read [SWS_MemIf_00039] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_Read | | Syntax | `Std_ReturnType MemIf_Read(uint8 DeviceIndex, uint16 BlockNumber, uint16 BlockOffset, uint8* DataBufferPtr, uint16 Length)` | | Service ID[hex] | 0x02 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex, BlockNumber, BlockOffset, Length | | Parameters (out) | DataBufferPtr | | Return value | Std_ReturnType — 如果开发错误检测被启用且检测到开发错误(根据 SWS_MemIf_00022),则函数应返回 E_NOT_OK,否则应返回所调用底层模块函数的返回值。 | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "Read" 函数。 | | Available via | MemIf.h | ⌋ (SRS_MemHwAb_14029, SRS_MemHwAb_14022) #### 8.3.3 MemIf_Write [SWS_MemIf_00040] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_Write | | Syntax | `Std_ReturnType MemIf_Write(uint8 DeviceIndex, uint16 BlockNumber, const uint8* DataBufferPtr)` | | Service ID[hex] | 0x03 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex, BlockNumber, DataBufferPtr | | Return value | Std_ReturnType — 如开发错误检测启用且检测到开发错误,返回 E_NOT_OK,否则返回底层模块函数的返回值。 | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "Write" 函数。 | | Available via | MemIf.h | ⌋ (SRS_MemHwAb_14010, SRS_MemHwAb_14022) #### 8.3.4 MemIf_Cancel [SWS_MemIf_00041] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_Cancel | | Syntax | `void MemIf_Cancel(uint8 DeviceIndex)` | | Service ID[hex] | 0x04 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex | | Return value | None | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "Cancel" 函数。 | | Available via | MemIf.h | ⌋ (SRS_MemHwAb_14031, SRS_MemHwAb_14022) #### 8.3.5 MemIf_GetStatus [SWS_MemIf_00042] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_GetStatus | | Syntax | `MemIf_StatusType MemIf_GetStatus(uint8 DeviceIndex)` | | Service ID[hex] | 0x05 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex | | Return value | MemIf_StatusType | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "GetStatus" 函数。 | | Available via | MemIf.h | ⌋ (RS_BRF_02272, SRS_MemHwAb_14022) [SWS_MemIf_00035] ⌈如果以广播到所有配置设备的设备索引(`MEMIF_BROADCAST_ID`)调用 `MemIf_GetStatus`,Memory Abstraction Interface 模块应依次调用所有底层设备的 "GetStatus" 函数。它应返回以下值: - `MEMIF_IDLE` — 如果所有底层设备都返回此状态 - `MEMIF_UNINIT` — 如果至少一个设备返回此状态,所有其他返回状态应被忽略 - `MEMIF_BUSY` — 如果至少一个已配置设备返回此状态且没有其他设备返回 MEMIF_UNINIT - `MEMIF_BUSY_INTERNAL` — 如果至少一个已配置设备返回此状态且没有其他设备返回 MEMIF_BUSY 或 MEMIF_UNINIT ⌋ (SRS_MemHwAb_14020) **注**:`MemIf_GetStatus` 调用中的特殊"广播"设备 ID 用于查询所有设备是否空闲以关闭 ECU。 #### 8.3.6 MemIf_GetJobResult [SWS_MemIf_00043] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_GetJobResult | | Syntax | `MemIf_JobResultType MemIf_GetJobResult(uint8 DeviceIndex)` | | Service ID[hex] | 0x06 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex | | Return value | MemIf_JobResultType — 如开发错误检测启用且检测到开发错误,返回 MEMIF_JOB_FAILED,否则返回底层模块函数的返回值。 | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "GetJobResult" 函数。 | | Available via | MemIf.h | ⌋ (SRS_MemHwAb_14022) #### 8.3.7 MemIf_InvalidateBlock [SWS_MemIf_00044] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_InvalidateBlock | | Syntax | `Std_ReturnType MemIf_InvalidateBlock(uint8 DeviceIndex, uint16 BlockNumber)` | | Service ID[hex] | 0x07 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex, BlockNumber | | Return value | Std_ReturnType | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "InvalidateBlock" 函数。 | | Available via | MemIf.h | ⌋ (SRS_MemHwAb_14028, SRS_MemHwAb_14022) #### 8.3.8 MemIf_GetVersionInfo [SWS_MemIf_00045] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_GetVersionInfo | | Syntax | `void MemIf_GetVersionInfo(Std_VersionInfoType* VersionInfoPtr)` | | Service ID[hex] | 0x08 | | Sync/Async | Synchronous | | Reentrancy | Reentrant | | Parameters (out) | VersionInfoPtr — 指向标准版本信息结构的指针。 | | Description | 返回版本信息。 | | Available via | MemIf.h | ⌋ (SRS_BSW_00407) #### 8.3.9 MemIf_EraseImmediateBlock [SWS_MemIf_00046] ⌈ | 项 | 内容 | |-----|------| | Service name | MemIf_EraseImmediateBlock | | Syntax | `Std_ReturnType MemIf_EraseImmediateBlock(uint8 DeviceIndex, uint16 BlockNumber)` | | Service ID[hex] | 0x09 | | Sync/Async | Synchronous | | Reentrancy | Non Reentrant | | Parameters (in) | DeviceIndex, BlockNumber | | Return value | Std_ReturnType | | Description | 调用由参数 DeviceIndex 选择的底层内存抽象模块的 "EraseImmediateBlock" 函数。 | | Available via | MemIf.h | ⌋ (SRS_MemHwAb_14032, SRS_MemHwAb_14022) ### 8.4 回调通知 无。NVRAM 管理器应为底层内存抽象模块提供回调例程。 ### 8.5 调度函数 无,本模块无异步函数。 ### 8.6 期望接口 #### 8.6.1 强制接口 本章定义实现模块核心功能所需的所有接口。 [SWS_MemIf_00047] ⌈ | API 函数 | 头文件 | 描述 | |----------|--------|------| | Ea_Cancel | Ea.h | 取消正在进行的异步操作。 | | Ea_EraseImmediateBlock | Ea.h | 擦除 BlockNumber 块。 | | Ea_GetJobResult | Ea.h | 返回 JobResult 的服务。 | | Ea_GetStatus | Ea.h | 返回状态的服务。 | | Ea_InvalidateBlock | Ea.h | 使 BlockNumber 块无效。 | | Ea_Read | Ea.h | 从 BlockNumber 块的 BlockOffset 偏移读取 Length 字节到缓冲区 DataBufferPtr。 | | Ea_SetMode | Ea.h | 切换底层 EEPROM 驱动模式的函数。 | | Ea_Write | Ea.h | 将 DataBufferPtr 内容写入 BlockNumber 块。 | | Fee_Cancel | Fee.h | 调用底层 Flash 驱动的取消函数。 | | Fee_EraseImmediateBlock | Fee.h | 擦除逻辑块的服务。 | | Fee_GetJobResult | Fee.h | 查询上层软件发起的上次已接受作业的结果。 | | Fee_GetStatus | Fee.h | 返回状态的服务。 | | Fee_InvalidateBlock | Fee.h | 使逻辑块无效的服务。 | | Fee_Read | Fee.h | 启动读作业的服务。 | | Fee_SetMode | Fee.h | 切换底层 Flash 驱动模式的函数。 | | Fee_Write | Fee.h | 启动写作业的服务。 | ⌋ (SRS_BSW_00384) #### 8.6.2 可选接口 本章定义实现模块可选功能所需的所有接口。 [SWS_MemIf_00048] ⌈ | API 函数 | 头文件 | 描述 | |----------|--------|------| | Det_ReportError | Det.h | 报告开发错误的服务。 | ⌋ (SRS_BSW_00385) #### 8.6.3 可配置接口 本章列出可配置目标函数的所有接口。目标函数通常是回调函数。 本模块没有可配置接口。 --- ## 9 时序图 参考各内存抽象模块的规范。 --- ## 10 配置规范 ### 10.1 容器与配置参数 以下章节汇总所有配置参数。参数的详细含义在第 7 章和第 8 章中描述。 #### 10.1.1 MemIf | 项 | 内容 | |-----|------| | SWS Item | ECUC_MemIf_00025 | | Module Name | MemIf | | Module Description | MemIf (Memory Abstraction Interface) 模块的配置。 | | Post-Build Variant Support | false | | Supported Config Variants | VARIANT-PRE-COMPILE | **包含容器:** | 容器名 | 多重性 | 范围/依赖 | |--------|--------|-----------| | MemIfGeneral | 1 | Memory Abstraction Interface (MemIf) 模块的配置。 | #### 10.1.2 MemIfGeneral | 项 | 内容 | |-----|------| | SWS Item | ECUC_MemIf_00034 | | Container Name | MemIfGeneral | | Description | Memory Abstraction Interface (MemIf) 模块的配置。 | **配置参数:** ##### MemIfDevErrorDetect | 项 | 内容 | |-----|------| | SWS Item | ECUC_MemIf_00035 | | Name | MemIfDevErrorDetect | | Parent Container | MemIfGeneral | | Description | 开启或关闭开发错误检测与通知。
true:启用检测与通知;
false:禁用检测与通知。 | | Multiplicity | 1 | | Type | EcucBooleanParamDef | | Default value | false | | Value Configuration Class | Pre-compile time(所有变体) | ##### MemIfNumberOfDevices | 项 | 内容 | |-----|------| | SWS Item | ECUC_MemIf_00033 | | Name | MemIfNumberOfDevices | | Parent Container | MemIfGeneral | | Description | 底层内存抽象模块的具体数量。
计算公式:计算已配置 EA 和 FEE 模块的数量。 | | Multiplicity | 1 | | Type | EcucIntegerParamDef | | Range | 1..2 | | Value Configuration Class | Pre-compile time(所有变体) | ##### MemIfVersionInfoApi | 项 | 内容 | |-----|------| | SWS Item | ECUC_MemIf_00032 | | Name | MemIfVersionInfoApi | | Parent Container | MemIfGeneral | | Description | 预处理器开关,启用/禁用读取模块版本信息的 API。
true:启用版本信息 API;
false:禁用版本信息 API。 | | Multiplicity | 1 | | Type | EcucBooleanParamDef | | Default value | false | --- ## 11 不适用需求 [SWS_MemIf_00999] ⌈以下需求不适用于本规范。⌋ (SRS_BSW_00404, SRS_BSW_00405, SRS_BSW_00159, SRS_BSW_00170, SRS_BSW_00380, SRS_BSW_00412, SRS_BSW_00398, SRS_BSW_00399, SRS_BSW_00400, SRS_BSW_00375, SRS_BSW_00101, SRS_BSW_00416, SRS_BSW_00406, SRS_BSW_00168, SRS_BSW_00423~00429, 00432, 00433, 00336, 00339, 00422, 00417, 00161, 00162, 00005, 00415, 00164, 00325, 00342, 00343, 00160, 00007, 00300, 00413, 00347, 00307, 00373, 00314, 00348, 00353, 00361, 00302, 00328, 00312, 00006, 00304, 00378, 00306, 00308, 00309, 00371, 00358, 00414, 00359, 00360, 00330, 00009, 00401, 00172, 00010, 00333, 00321, 00341, 00334, SRS_SPAL_12263, 12056, 12267, 12057, 12125, 12163, 12461, 12462, 12463, 12068, 12069, 00157, 12063, 12075, 12129, 12064, 12067, 12077, 12092, 12265) --- ## 翻译说明 - 本文档完整翻译自 AUTOSAR_SWS_MemoryAbstractionInterface v4.4.0(Document ID 285)。 - 保留所有需求 ID(SWS_MemIf_xxxxx、SRS_xxx_xxxxx、ECUC_MemIf_xxxxx)。 - 保留 AUTOSAR 方框符 ⌈⌋。 - 模块缩写(MemIf、Fee、Ea、NvM、Fls 等)和 API 函数名保持英文。 - 完整 SWS_MemIf_00999 不适用需求列表见原文 PDF。