Memory Abstraction Interface (MemIf)
Abstracts underlying Flash and EEPROM memory drivers.
Funktionen — Übersicht
void MemIf_SetMode (MemIf_ModeType Mode);Invokes the "Set Mode" functions of all underlying memory abstraction modules.Std_ReturnType MemIf_Read (uint8 DeviceIndex, uint16 BlockNumber, uint16 BlockOffset, uint8* DataBufferPtr, uint16 Length);Invokes the "Read" function of the underlying memory abstraction module selected by the parameter Device Index.Std_ReturnType MemIf_Write (uint8 DeviceIndex, uint16 BlockNumber, const uint8* DataBufferPtr);Invokes the "Write" function of the underlying memory abstraction module selected by the parameter Device Index.void MemIf_Cancel (uint8 DeviceIndex);Invokes the "Cancel" function of the underlying memory abstraction module selected by the parameter Device Index.MemIf_StatusType MemIf_GetStatus (uint8 DeviceIndex);Invokes the "Get Status" function of the underlying memory abstraction module selected by the parameter Device Index.MemIf_JobResultType MemIf_GetJobResult (uint8 DeviceIndex);Invokes the "Get Job Result" function of the underlying memory abstraction module selected by the parameter Device Index.Std_ReturnType MemIf_InvalidateBlock (uint8 DeviceIndex, uint16 BlockNumber);Invokes the "Invalidate Block" function of the underlying memory abstraction modulevoid MemIf_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);Returns version information.Std_ReturnType MemIf_EraseImmediateBlock (uint8 DeviceIndex, uint16 BlockNumber);Invokes the "Erase Immediate Block" function of the underlying memory abstraction module selected by the parameter Device Index.
Typen — Übersicht
enum MemIf_StatusTypeDenotes the current status of the underlying abstraction module and device drive.enum MemIf_JobResultTypeDenotes the result of the last job.enum MemIf_ModeTypeDenotes the operation mode of the underlying abstraction mod ules and device drivers.
Funktionen & Typen — Detailansicht
function MemIf_SetMode [SWS_MemIf_00038] 📄 PDF
void MemIf_SetMode (MemIf_ModeType Mode);
Invokes the "Set Mode" functions of all underlying memory abstraction modules.
The function MemIf_SetMode serves to synchronously switch the operation mode via the memory interface [SWS_MemIf_00038]. When called, it forwards the requested mode to the individual "Set Mode" functions of all underlying memory abstraction modules [SWS_MemIf_00038]. The target mode Mode is passed as a parameter, while the function does not provide a return value [SWS_MemIf_00038]. The interface is defined with the service ID 0x01 in header MemIf.h [SWS_MemIf_00038].
Regarding concurrency, MemIf_SetMode is specified as non-reentrant (Non Reentrant) [SWS_MemIf_00038]. Interpretation: Callers presumably must not call the function concurrently or preemptively from multiple tasks or interrupt service routines, which is why concurrent access would likely need to be coordinated via external protection mechanisms if required. Question Q-02b14e9cb4b05dc9 (open)
Due to the synchronous execution semantics, the call returns to the caller only after the request has been forwarded to the memory abstraction modules [SWS_MemIf_00038]. Specific return values for error indication or separate DET or DEM error notifications are not provided for this function in the element specification [SWS_MemIf_00038].
This usage note was generated automatically and is based exclusively on the specifications of AUTOSAR R20-11.
Implementer's Guide to follow (complexity I1)
function MemIf_Read [SWS_MemIf_00039] 📄 PDF
Std_ReturnType MemIf_Read (uint8 DeviceIndex, uint16 BlockNumber, uint16 BlockOffset, uint8* DataBufferPtr, uint16 Length);
Invokes the "Read" function of the underlying memory abstraction module selected by the parameter Device Index.
The function MemIf_Read forwards a read request synchronously to the underlying memory abstraction module selected via parameter DeviceIndex [SWS_MemIf_00039]. It is declared in header MemIf.h and serves to read data from a logical memory block.
Parameters and Interface
The call to MemIf_Read comprises the following input and output parameters [SWS_MemIf_00039]:
DeviceIndex: Index of the target device for selecting the target module.BlockNumber: Logical block number of the memory block to be read.BlockOffset: Byte offset within the logical block from which reading starts.DataBufferPtr: Pointer to the buffer for storing the read data.Length: Number of data bytes to be read.
Error Handling and Return Values
If development error detection (Development Error Detection) is active and a development error is detected, the function returns E_NOT_OK [SWS_MemIf_00039]. Otherwise, the return value of the called read function of the underlying module is forwarded as Std_ReturnType [SWS_MemIf_00039].
Concurrency and Limitations
The function is specified as synchronous and non-reentrant (Non Reentrant) [SWS_MemIf_00039]. A call is therefore typically expected to occur in task context; parallel or nested calls must be avoided or serialized by the caller. Question Q-b774bf07a69e28af (open)
This usage note was generated by an AI and is based on the AUTOSAR specification R20-11.
function MemIf_Write [SWS_MemIf_00040] 📄 PDF
Std_ReturnType MemIf_Write (uint8 DeviceIndex, uint16 BlockNumber, const uint8* DataBufferPtr);
Invokes the "Write" function of the underlying memory abstraction module selected by the parameter Device Index.
Usage and Call Context
The interface function MemIf_Write serves as an abstraction layer and calls the Write function of the underlying memory abstraction module, which is selected via parameter DeviceIndex [SWS_MemIf_00040]. Upon synchronous invocation, three input parameters are passed: the device index DeviceIndex for selecting the target driver, the logical block number BlockNumber, and the pointer DataBufferPtr to the buffer with the data to be written [SWS_MemIf_00040]. The function is specified under Service ID 0x03 and is available via header file MemIf.h [SWS_MemIf_00040].
Error Handling and Return Values
The return value is of type Std_ReturnType [SWS_MemIf_00040]. If development error detection is active for the Memory Abstraction Interface and a development error is detected according to [SWS_MemIf_00022], MemIf_Write returns the error code E_NOT_OK [SWS_MemIf_00040]. If no error is present, the function forwards the return value of the called lower-layer module unchanged to the caller [SWS_MemIf_00040].
Concurrency and Constraints
With regard to concurrency behavior, MemIf_Write is defined as synchronous and non-reentrant (Non Reentrant) [SWS_MemIf_00040].
This usage note was generated by an AI based on the AUTOSAR Classic R20-11 specification.
function MemIf_Cancel [SWS_MemIf_00041] 📄 PDF
void MemIf_Cancel (uint8 DeviceIndex);
Invokes the "Cancel" function of the underlying memory abstraction module selected by the parameter Device Index.
The synchronous function MemIf_Cancel serves to call the cancel function of the underlying memory abstraction module selected via the parameter Device Index [SWS_MemIf_00041]. The service has no return value and forwards the cancellation request directly to the addressed abstraction instance [SWS_MemIf_00041].
The following technical properties apply to the call and integration:
- Call context and concurrency: The function is defined as non-reentrant (
Non Reentrant) [SWS_MemIf_00041]. Callers must ensure that execution does not occur concurrently or preemptively by other contexts. - Signature and identification: The interface
void MemIf_Cancel (uint8 Device Index)has the service ID0x04and is provided via the header fileMemIf.h[SWS_MemIf_00041]. - Parameters: The input parameter
Device Index(typeuint8) selects the target module; input/output or return parameters are not present [SWS_MemIf_00041]. - Error handling: The specification does not describe any specific error codes, return values or DET messages for this function [SWS_MemIf_00041] (Interpretation: Checking for invalid device indices is likely left to the higher-level system architecture or the underlying module). Question Q-4a5d989ce611ba89 (open)
This usage note was generated by an AI based on the AUTOSAR specification R20-11.
function MemIf_GetStatus [SWS_MemIf_00042] 📄 PDF
MemIf_StatusType MemIf_GetStatus (uint8 DeviceIndex);
Invokes the "Get Status" function of the underlying memory abstraction module selected by the parameter Device Index.
function MemIf_GetJobResult [SWS_MemIf_00043] 📄 PDF
MemIf_JobResultType MemIf_GetJobResult (uint8 DeviceIndex);
Invokes the "Get Job Result" function of the underlying memory abstraction module selected by the parameter Device Index. Available v ia Mem If.h
function MemIf_InvalidateBlock [SWS_MemIf_00044] 📄 PDF
Std_ReturnType MemIf_InvalidateBlock (uint8 DeviceIndex, uint16 BlockNumber);
Invokes the "Invalidate Block" function of the underlying memory abstraction module AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_MemoryAbstractionInterface selected by the parameter Device Index.
The synchronous function MemIf_InvalidateBlock forwards the request to invalidate a logical block to the underlying memory abstraction module selected via parameter DeviceIndex [SWS_MemIf_00044]. The interface is provided via header MemIf.h and has the service ID 0x07 [SWS_MemIf_00044].
Usage and Parameters
The call is synchronous and passes the following input parameters to the addressing target [SWS_MemIf_00044]:
DeviceIndex: Numeric index of the underlying memory abstraction module [SWS_MemIf_00044].BlockNumber: Unique identifier of the memory block to be invalidated [SWS_MemIf_00044].
Error Handling and Return Values
The function returns a status value of type Std_ReturnType [SWS_MemIf_00044]:
- If development error detection is enabled for the Memory Abstraction Interface and an error according to
SWS_MemIf_00022occurs, the function returnsE_NOT_OK[SWS_MemIf_00044]. - If no development error is detected, the interface returns the result of the called function of the underlying module [SWS_MemIf_00044].
Concurrency
The function is specified as non-reentrant (Non Reentrant) [SWS_MemIf_00044].
This usage note was generated automatically based on the AUTOSAR Classic Release R20-11 specification.
function MemIf_GetVersionInfo [SWS_MemIf_00045] 📄 PDF
void MemIf_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);
Returns version information.
function MemIf_EraseImmediateBlock [SWS_MemIf_00046] 📄 PDF
Std_ReturnType MemIf_EraseImmediateBlock (uint8 DeviceIndex, uint16 BlockNumber);
Invokes the "Erase Immediate Block" function of the underlying memory abstraction module selected by the parameter Device Index.
use
The synchronous function MemIf_EraseImmediateBlock initiates the erasure of a block classified as immediate in the underlying memory abstraction module [SWS_MemIf_00046]. The call is provided via header MemIf.h and has the service ID 0x09 [SWS_MemIf_00046]. The input parameters are DeviceIndex to address the specific memory device or abstraction module and BlockNumber to identify the target block [SWS_MemIf_00046]. Additional inout or out parameters do not exist [SWS_MemIf_00046].
Return Values and Error Handling
The function returns a status value of type Std_ReturnType [SWS_MemIf_00046]. If development error detection is enabled for the Memory Abstraction Interface and a corresponding error according to [SWS_MemIf_00022] is detected, the call returns the fixed return value E_NOT_OK [SWS_MemIf_00046]. If no such error occurs, the immediate result of the called function of the underlying module is passed through to the caller [SWS_MemIf_00046].
Concurrency and Limitations
The execution of MemIf_EraseImmediateBlock is synchronous and specified as non-reentrant (Non Reentrant) [SWS_MemIf_00046]. Interpretation: Since concurrent calls to the interface are not permitted, the function in the overall system would presumably only be called from a synchronized context at task level in order to prevent data inconsistencies in the underlying memory drivers. Question Q-4fce518bab0115db (open)
This usage note was generated automatically based on the specification AUTOSAR CP R20-11.
type MemIf_StatusType [SWS_MemIf_00064] 📄 PDF
Denotes the current status of the underlying abstraction module and device drive. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_MemoryAbstractionInterface
The enumeration type MemIf_StatusType indicates the current operational and execution status of the underlying memory abstraction module and the associated device driver according to [SWS_MemIf_00064]. This type is defined in the Memory Abstraction Interface and is available to callers via the header file MemIf.h [SWS_MemIf_00064].
The enumeration comprises four distinct states to represent operational readiness [SWS_MemIf_00064]:
MEMIF_UNINIT: The underlying abstraction module or the associated device driver is not (yet) initialized [SWS_MemIf_00064].MEMIF_IDLE: The abstraction module or device driver is operational and currently not executing any jobs [SWS_MemIf_00064].MEMIF_BUSY: The underlying module or device driver is currently processing an operation [SWS_MemIf_00064].MEMIF_BUSY_INTERNAL: The abstraction module is handling internal management operations, while the driver can be idle or busy [SWS_MemIf_00064].
Calling layers use this status to synchronously determine before issuing jobs whether the memory layers are operational or internal management operations are in progress [SWS_MemIf_00064]. Since MemIf_StatusType is a pure data type definition, functional aspects such as DET or DEM notifications, reentrancy rules, or call contexts are not separately specified in the specification element.
This text was generated by an AI based on the AUTOSAR specification.
Implementer's Guide to follow (complexity I1)
type MemIf_JobResultType [SWS_MemIf_00065] 📄 PDF
Denotes the result of the last job.
The enumeration type MemIf_JobResultType describes the result of the most recently processed job to the memory interface and is provided via the header file MemIf.h [SWS_MemIf_00065].
The enumeration defines states for execution as well as specific error and block states [SWS_MemIf_00065]:
MEMIF_JOB_OK: The requested job was completed successfully [SWS_MemIf_00065].MEMIF_JOB_PENDING: The job has not yet been completed [SWS_MemIf_00065]. Interpretation: This indicates that jobs are processed asynchronously and the caller determines completion via this intermediate state. Question Q-31078cf25506334e (open)MEMIF_JOB_FAILED: The job was not completed successfully [SWS_MemIf_00065].MEMIF_JOB_CANCELED: The job was canceled [SWS_MemIf_00065].MEMIF_BLOCK_INCONSISTENT: The requested block is inconsistent, potentially contains corrupted data, or was not found [SWS_MemIf_00065].MEMIF_BLOCK_INVALID: The requested block has been marked as invalid, so that the desired operation cannot be performed [SWS_MemIf_00065].
When evaluating the job result, the type serves to differentiate between general execution errors (MEMIF_JOB_FAILED) and block-related issues (MEMIF_BLOCK_INCONSISTENT, MEMIF_BLOCK_INVALID) [SWS_MemIf_00065].
This text was generated by an AI and serves as guidance.
type MemIf_ModeType [SWS_MemIf_00066] 📄 PDF
Denotes the operation mode of the underlying abstraction mod ules and device drivers.
The enumeration type MemIf_ModeType defines the operation mode of the underlying memory abstraction modules and device drivers [SWS_MemIf_00066]. It is provided via the header file MemIf.h and serves to control the speed and operating behavior of memory accesses [SWS_MemIf_00066].
The range of values comprises two states according to [SWS_MemIf_00066]:
MEMIF_MODE_SLOW: The underlying abstraction modules and device drivers operate in slow mode (Slow Mode) [SWS_MemIf_00066].MEMIF_MODE_FAST: The underlying abstraction modules and device drivers operate in fast mode (Fast Mode) [SWS_MemIf_00066].
Regarding error handling, reentrancy, or specific call contexts, the specification of the type contains no separate specifications; passing and evaluating the mode takes place synchronously via the corresponding interfaces of the memory interface or the underlying drivers [SWS_MemIf_00066].
This text was generated by an AI and serves for technical orientation.
Implementer's Guide to follow (complexity I1)
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_MemIf- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_MemIf@rel:R20-11#3e8e3bed- Content hash
3e8e3bed- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_MemoryAbstractionInterface.pdf#nameddest=SWS_MemIf_00038
gemini-3.8-flash-low· 2026-10-13 · German original