AUTOSAR_SWS_MemoryAbstractionInterface

Specification of Memory Abstraction Interface


Introduction and functional overview 


This specification describes the functionality, API and configuration of the AUTOSAR Basic Software Module "Memory Abstraction Interface" (MemIf). This module allows the NVRAM manager to access several memory abstraction modules (FEE or EA modules) (see Figure 1).


The Memory Abstraction Interface (MemIf) shall abstract from the number of underlying FEE or EA modules and provide upper layers with a virtual segmentation on a uniform linear address space.

Acronyms and abbreviations 


Acronyms and abbreviations which have a local scope and therefore are not contained in the AUTOSAR glossary must appear in a local glossary.


Related documentation 


Input documents 

[1] List of Basic Software Modules 
  • AUTOSAR_TR_BSWModuleList

[2] Layered Software Architecture 
  • AUTOSAR_EXP_LayeredSoftwareArchitecture

[3] General Requirements on Basic Software Modules 
  • AUTOSAR_SRS_BSWGeneral

[4] General Requirements on SPAL 
  • AUTOSAR_SRS_SPALGeneral

[5] Requirements on Memory Hardware Abstraction Layer 
  • AUTOSAR_SRS_MemoryHWAbstractionLayer

[6] Specification of Default Error Tracer 
  • AUTOSAR_SWS_DefaultErrorTracer

[7] General Specification of Basic Software Modules 
  • AUTOSAR_SWS_BSWGeneral

Related standards and norms 

[7] Specification of NVRAM Manager 
  • AUTOSAR_SWS_NVRAMManager

[8] Specification of Flash EEPROM Emulation 
  • AUTOSAR_SWS_FlashEEPROMEmulation

[9] Specification of EEPROM Abstraction 
  • AUTOSAR_SWS_EEPROMAbstraction

Requirements traceability



Functional specification 


Error classification 

The 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. 

Based on this foundation, the following section specifies particular errors arranged in the respective subsections below. 

Development Errors

[SWS_MemIf_00006]
[SRS_BSW_00337]
[SRS_BSW_00386]
[SRS_BSW_00327]

API specification 


Imported types 

Standard types 

In this chapter, all types included from the following modules are listed:

[SWS_MemIf_00037]
[SRS_BSW_00392]

Type definitions

[SWS_MemIf_00010]
[SRS_MemHwAb_14022]
  • The types specified in this chapter shall not be changed or extended for a specific memory abstraction module or hardware platform. 

[SWS_MemIf_00011]
[SRS_MemHwAb_14020]
  • The data type for the memory device index shall be uint8. The lowest value to be used for this device index shall be 0. The allowed range of indices thus shall be 0..MEMIF_NUMBER_OF_DEVICES-1. 

MemIf_StatusType 

[SWS_MemIf_00064]
[SRS_BSW_00392]

MemIf_JobResultType

[SWS_MemIf_00065]{OBSOLETE}
[SRS_BSW_00392]

Function definitions

[SWS_MemIf_00017]
[SRS_MemHwAb_14019]
[SRS_MemHwAb_14022]
  • The API specified in this chapter shall be mapped to the API of the underlying memory abstraction modules. For functional behavior refer to the specification of those modules respectively to that of the underlying memory drivers. 

[SWS_MemIf_00018]
[SRS_MemHwAb_14020]
[SRS_MemHwAb_14021]
  • The parameter DeviceIndex shall be used for selection of memory abstraction modules (and thus memory devices). If only one memory abstraction module is configured, the parameter DeviceIndex shall be ignored. 

[SWS_MemIf_00019]
[SRS_SPAL_12078]
[SRS_MemHwAb_14021]
  • If only one memory abstraction module is configured, the Memory Abstraction Interface shall be implemented as a set of macros mapping the Memory Abstraction Interface API to the API of the corresponding memory abstraction module. 

Example:

#define MemIf_Write(DeviceIndex, BlockNumber, DataPtr) Fee_Write(BlockNumber, DataPtr)

[SWS_MemIf_00020]
[SRS_SPAL_12078]
[SRS_MemHwAb_14021]
  • If more than one memory abstraction module is configured, the Memory Abstraction Interface shall use efficient mechanisms to map the API calls to the appropriate memory abstraction module. 

Note: 

One solution is to use tables of pointers to functions where the parameter DeviceIndex is used as array index.

Example:

#define MemIf_Write(DeviceIndex, BlockNumber, DataPtr) MemIf_WriteFctPtr[DeviceIndex](BlockNumber,DataPtr)

Note: 

The service IDs given in this interface specification are related to the service IDs of the underlying memory abstraction module(s). For that reason, they may not start with 0.

[SWS_MemIf_00022]
[SRS_BSW_00323]
[SRS_MemHwAb_14021]
[SRS_MemHwAb_14023]
  • If more than one memory abstraction module is configured and development error detection is enabled for this module, the functions of the Memory Abstraction Interface API shall check the parameter DeviceIndex for being an existing device or the broadcast identifier within the module's services. 

[SWS_MemIf_00023]
[SRS_BSW_00386]
[SRS_SPAL_12448]
  • The functions of the Memory Abstraction Interface API shall report detected errors attributed to an illegal parameter DeviceIndex to the Default Error Tracer (DET) with the error code MEMIF_E_PARAM_DEVICE and the called service shall not be executed. 

[SWS_MemIf_00024]
[SRS_BSW_00369]
  • If a called function of the Memory Abstraction Interface API has detected an error attributed to an illegal parameter DeviceIndex and has a return value, it shall be set as follows: 
    • MemIf_GetStatus: MEMIF_UNINIT 
    • MemIf_GetJobResult: MEMIF_JOB_FAILED 
    • All other functions: E_NOT_OK. 

MemIf_Read 

[SWS_MemIf_00039]
[SRS_MemHwAb_14029]
[SRS_MemHwAb_14022]

MemIf_Write 

[SWS_MemIf_00040]
[SRS_MemHwAb_14010]
[SRS_MemHwAb_14022]

MemIf_Cancel 

[SWS_MemIf_00041]
[SRS_MemHwAb_14031]
[SRS_MemHwAb_14022]

MemIf_GetStatus 

[SWS_MemIf_00042]
[RS_BRF_02272]
[SRS_MemHwAb_14022]

[SWS_MemIf_00035]
[SRS_MemHwAb_14020]
  • If the function MemIf_GetStatus is called with the device index denoting a broadcast to all configured devices (MEMIF_BROADCAST_ID), the Memory Abstraction Interface module shall call the "GetStatus" functions of all underlying devices in turn. It shall return the value 
    • MEMIF_IDLE - if all underlying devices have returned this state 
    • MEMIF_UNINIT - if at least one device returned this state, all other returned states shall be ignored 
    • MEMIF_BUSY - if at least one configured device returned this state and no other device returned MEMIF_UNINIT 
    • MEMIF_BUSY_INTERNAL - if at least one configured device returned this state and no other device returned MEMIF_BUSY or MEMIF_UNINIT

Note: 

The special "broadcast" device ID in the call to MemIf_GetStatus is used to query whether all devices are idle in order to shut down the ECU. 

MemIf_GetJobResult

[SWS_MemIf_00043]
[SRS_MemHwAb_14022]

MemIf_InvalidateBlock 

[SWS_MemIf_00044]
[SRS_MemHwAb_14028]
[SRS_MemHwAb_14022]

MemIf_GetVersionInfo 

[SWS_MemIf_00045]
[SRS_BSW_00407]

MemIf_EraseImmediateBlock 

[SWS_MemIf_00046]
[SRS_MemHwAb_14032]
[SRS_MemHwAb_14022]

Call-back notifications 

None, the NVRAM manager shall provide the callback routines for the underlying memory abstraction modules.

Expected Interfaces 

Mandatory Interfaces 

This chapter defines all interfaces which are required to fulfill the core functionality of the module. 

[SWS_MemIf_00047]
[SRS_BSW_00384]

Optional Interfaces 

This chapter defines all interfaces which are required to fulfill an optional functionality of the module. 

[SWS_MemIf_00048]
[SRS_BSW_00385]

Configuration specification 


Containers and configuration parameters 

The following chapters summarize all configuration parameters. The detailed meaning of the parameters are described in Chapter 7 and Chapter 8. 

MemIf




MemIfGeneral





评论

此博客中的热门博文

ISO 14229-1-2020

AUTOSAR_SWS_CANDriver

Linux Driver Char Device 笔记

AUTOSAR_SWS_PWMDriver

AUTOSAR_SWS_PortDriver

AUTOSAR_SWS_ECUStateManager

EB - MCAL - MCU

AUTOSAR_SWS_ICUDriver

EB - MCAL - PWM