DEENESPTFRRUARHIKOZHNL

Memory Abstraction Interface (MemIf)

ModulMemIf (Memory Abstraction Interface)
BSW-Modul-ID22
Standard-Header#include "MemIf.h"
SWS-SpezifikationAUTOSAR_SWS_MemoryAbstractionInterface.pdf
ClusterMemory Services

Module guideAI-GENERATED

Forwards memory jobs of the NVRAM Manager via device index to Flash EEPROM Emulation or EEPROM Abstraction.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: 423eb9cf4c9b Provenance Open questions (5)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Forwards memory jobs of the NVRAM Manager via device index to Flash EEPROM Emulation or EEPROM Abstraction.

MemIf forwards the memory jobs of the NVRAM Manager to Fee or Ea modules and hides their number behind a uniform API SWS MemIf p. 7. The parameter DeviceIndex selects the module; if only one is configured, it is ignored and MemIf is implemented as a macro set SWS MemIf p. 17. The services accept jobs synchronously and pass the return value along, while the memory operation executes asynchronously underneath. Status and result are provided by MemIf_GetStatus and MemIf_GetJobResult. If development error detection is active, faulty calls return E_NOT_OK and MEMIF_JOB_FAILED, respectively.

The Memory Abstraction Interface replaces the former driver interface layers for Flash and EEPROM. It allows the NVRAM Manager to address multiple abstraction modules via a uniform API: the Flash EEPROM Emulation (Fee) and the EEPROM Abstraction (Ea) SRS MemHwAb p. 5. MemIf hides the number of these modules and provides virtual segmentation on a linear address space SWS MemIf p. 7.

kontext cluster_services Services Layer cluster_abstraktion Memory Hardware Abstraction cluster_treiber Memory Drivers NvM NvM (NVRAM Manager) MemIf MemIf (Memory Abstraction Interface) NvM->MemIf MemIf_Read / MemIf_Write / ... (DeviceIndex) Fee Fee (Flash EEPROM Emulation) MemIf->Fee Fee_* Ea Ea (EEPROM Abstraction) MemIf->Ea Ea_* Lib Herstellerspezifische Bibliothek (statt Fee/Ea + Treiber) MemIf->Lib Same API as Fee/Ea Det Det (optional) MemIf->Det Det_ReportError Fee->NvM NvM_JobEndNotification / NvM_JobErrorNotification Fls Flash Driver Fee->Fls Ea->NvM NvM_JobEndNotification / NvM_JobErrorNotification Eep EEPROM Driver Ea->Eep

Context diagram: MemIf mediates between NvM and Fee/Ea; completion notifications go directly from Fee/Ea to the NvM. Sources: SWS Fee p. 6, [SWS_MemIf_00047]

MemIf has no memory logic of its own. The parameter DeviceIndex selects the module; if only one is configured, it is ignored and MemIf is implemented as a macro set. If there are multiple modules, dispatching is performed, for example, via function pointer tables SWS MemIf p. 17. In R20-11, DeviceIndex is of type uint8 [SWS_MemIf_00039]; later versions use uint16.

The services accept jobs synchronously and pass the module's return value along [SWS_MemIf_00040]. The memory operation then runs asynchronously in the lower layer's main function. The NvM is notified of completion via callback from Fee/Ea or by polling MemIf_GetJobResult SWS Fee p. 48. MemIf_GetStatus reports UNINIT, IDLE, BUSY, or BUSY_INTERNAL [SWS_MemIf_00064]. The job result always refers to the last job and distinguishes, among others, canceled, inconsistent, and invalid blocks [SWS_MemIf_00065]. MemIf_SetMode affects all modules simultaneously [SWS_MemIf_00038].

Write job via MemIf (example Ea/Eep)NvMMemIfEaEepBSW task (OS task or cyclic call)Use Case: Auftragsannahme (synchron)MemIf_Write(DeviceIndex,BlockNumber, DataBufferPtr)Select module via DeviceIndexEa_Write(BlockNumber, DataBufferPtr)Eep_Write(EepromAddress,DataBufferPtr, Length)Std_ReturnTypeStd_ReturnTypeStd_ReturnType (unchanged)Use Case: Execution (asynchronous)Until finished, GetJobResult returnsMEMIF_JOB_PENDINGloopUntil the job is completedEep_MainFunction()altBenachrichtigung konfiguriertEa_JobEndNotification()NvM_JobEndNotification()Polling-BetriebMemIf_GetJobResult(DeviceIndex)Ea_GetJobResult()MEMIF_JOB_OKMEMIF_JOB_OK

Sequence diagram: synchronous acceptance via MemIf, asynchronous execution in the driver, completion via callback or polling. Sources: SWS Ea p. 41, [SWS_MemIf_00040]

In case of error, MemIf reports invalid device indices and NULL pointers as development errors [SWS_MemIf_00006]. The services then return E_NOT_OK, and MemIf_GetJobResult returns MEMIF_JOB_FAILED SWS MemIf p. 21. Runtime errors of the memory are detected by Fee or Ea; the NvM reads them in polling mode as MEMIF_JOB_FAILED and is responsible for rectification ErrorDescription p. 58.

Role in the Memory Stack: Switch between NvM and Fee/Ea

The Memory Abstraction Interface (MemIf) replaces the former driver interface layers for Flash and EEPROM. It allows the NVRAM Manager (NvM) to address multiple memory abstraction modules via a single API: the Flash EEPROM Emulation (Fee) and the EEPROM Abstraction (Ea) SRS MemHwAb p. 5. Towards upper layers, MemIf hides how many Fee and Ea modules lie underneath. It provides virtual segmentation on a uniform linear address space SWS MemIf p. 7. Fee and Ea provide block-based addressing and a "virtually unlimited" number of erase-write cycles. Therefore, the NvM does not need to be modified when the driver or device changes SRS MemHwAb p. 5.

MemIf itself contains no memory logic. Its API must be mapped to the API of the abstraction modules, and the functional behavior is defined by their specifications or those of the memory drivers SWS MemIf p. 17. Accordingly, MemIf requires the services of the abstraction modules, for Ea such as Ea_Read, Ea_Cancel, Ea_GetStatus, and Ea_GetJobResult [SWS_MemIf_00047]. Optionally, it uses Det_ReportError [SWS_MemIf_00048]. The types MemIf_StatusType, MemIf_JobResultType, and MemIf_ModeType defined in MemIf.h form the shared vocabulary of the stack [SWS_MemIf_00064] [SWS_MemIf_00065] [SWS_MemIf_00066]. For instance, Fls_GetJobResult directly returns MemIf_JobResultType SWS Fls p. 36.

The figures of more recent releases additionally show the modules MemAcc and Mem below Ea and Fee SWS Ea p. 42. For R20-11, the older overview is presumably authoritative, in which Fee builds on the Flash driver and Ea on the EEPROM driver SWS Fee p. 6. For MemIf, the difference is irrelevant because it only forwards up to the abstraction level SWS MemIf p. 17. Question Q-3c74a6029dd0d159 (open)

kontext cluster_services Services Layer cluster_abstraktion Memory Hardware Abstraction cluster_treiber Memory Drivers NvM NvM (NVRAM Manager) MemIf MemIf (Memory Abstraction Interface) NvM->MemIf MemIf_Read / MemIf_Write / ... (DeviceIndex) Fee Fee (Flash EEPROM Emulation) MemIf->Fee Fee_* Ea Ea (EEPROM Abstraction) MemIf->Ea Ea_* Lib Herstellerspezifische Bibliothek (statt Fee/Ea + Treiber) MemIf->Lib Same API as Fee/Ea Det Det (optional) MemIf->Det Det_ReportError Fee->NvM NvM_JobEndNotification / NvM_JobErrorNotification Fls Flash Driver Fee->Fls Ea->NvM NvM_JobEndNotification / NvM_JobErrorNotification Eep EEPROM Driver Ea->Eep

Context diagram: MemIf lies between NvM and the abstraction modules Fee/Ea; completion notifications reach the NvM directly from Fee/Ea. Sources: SWS Fee p. 6, SRS MemHwAb p. 5, [SWS_MemIf_00047], [SWS_MemIf_00048]

Device Selection via DeviceIndex: Macros or Dispatch Table

The parameter DeviceIndex selects the abstraction module and thus the memory device. If only one module is configured, it is ignored SWS MemIf p. 17. In this case, MemIf must be implemented as a set of macros, for example #define MemIf_Write(DeviceIndex, BlockNumber, DataPtr) Fee_Write(BlockNumber, DataPtr). If there are multiple modules, the calls must be dispatched via efficient mechanisms; the specification cites tables of function pointers indexed via DeviceIndex as one solution SWS MemIf p. 17. If a vendor-specific library replaces all required Fee and Ea modules, MemIf consists solely of macros SRS MemHwAb p. 5.

In R20-11, DeviceIndex is of type uint8 [SWS_MemIf_00039] [SWS_MemIf_00041]. Later versions of the specification list it as uint16 SWS MemIf p. 18. Normative for this release is uint8.

abbildung start Konfiguration von MemIf q0 Does a vendor library replace all Fee and Ea modules? start->q0 lib MemIf consists only of macros to the library API q0->lib yes q1 How many abstraction modules are configured? q0->q1 no ende Module function is called, return value is passed through lib->ende ein Macros map the MemIf API (e.g., MemIf_Write -> Fee_Write) q1->ein Exactly one mehr Effiziente Verteilung, z. B. Funktionszeigertabelle q1->mehr mehrere ign DeviceIndex is ignored ein->ign ign->ende idx DeviceIndex selects the module (Fee or Ea) mehr->idx idx->ende

Activity diagram: The number of configured abstraction modules decides between macro mapping and dispatching via DeviceIndex. Sources: SWS MemIf p. 17, SRS MemHwAb p. 5

Job Sequence: Synchronous Acceptance, Asynchronous Execution

All MemIf services are specified as synchronous. Each calls the identically named function of the selected module and returns its return value, such as Read, Write, and InvalidateBlock [SWS_MemIf_00039] [SWS_MemIf_00040] [SWS_MemIf_00044]. The actual memory operation then runs asynchronously in the cyclically invoked main function of the lower layer. For this, the Ea sequence shows a loop via Eep_MainFunction in the BSW task SWS Ea p. 41. According to the Fee specification, this pattern also applies to the other asynchronous services SWS Fee p. 48.

Depending on the stack configuration, the NvM learns of the job completion in one of two ways. Either the abstraction module calls a callback such as NvM_JobEndNotification or NvM_JobErrorNotification, or the NvM polls MemIf_GetJobResult SWS Fee p. 48 EXP ErrorDescription p. 45. MemIf itself provides no callback function; its API consists of the following services [SWS_MemIf_00038] [SWS_MemIf_00046].

ServiceService IDreturnEffect
MemIf_SetMode0x01–calls SetMode of all abstraction modules [SWS_MemIf_00038]
MemIf_Read0x02Std_ReturnTypereads Length bytes of the block starting at BlockOffset into DataBufferPtr [SWS_MemIf_00039]
MemIf_Write0x03Std_ReturnTypewrites a block [SWS_MemIf_00040]
MemIf_Cancel0x04–cancels the running job [SWS_MemIf_00041]
MemIf_GetStatus0x05MemIf_StatusTypemodule status [SWS_MemIf_00042]
MemIf_GetJobResult0x06MemIf_JobResultTyperesult of the last job [SWS_MemIf_00043]
MemIf_InvalidateBlock0x07Std_ReturnTypeinvalidates a block [SWS_MemIf_00044]
MemIf_GetVersionInfo0x08–version information, reentrant [SWS_MemIf_00045]
MemIf_EraseImmediateBlock0x09Std_ReturnTypeerases a block [SWS_MemIf_00046]
Write job via MemIf (example Ea/Eep)NvMMemIfEaEepBSW task (OS task or cyclic call)Use Case: Auftragsannahme (synchron)MemIf_Write(DeviceIndex,BlockNumber, DataBufferPtr)Select module via DeviceIndexEa_Write(BlockNumber, DataBufferPtr)Eep_Write(EepromAddress,DataBufferPtr, Length)Std_ReturnTypeStd_ReturnTypeStd_ReturnType (unchanged)Use Case: Execution (asynchronous)Until finished, GetJobResult returnsMEMIF_JOB_PENDINGloopUntil the job is completedEep_MainFunction()altBenachrichtigung konfiguriertEa_JobEndNotification()NvM_JobEndNotification()Polling-BetriebMemIf_GetJobResult(DeviceIndex)Ea_GetJobResult()MEMIF_JOB_OKMEMIF_JOB_OK

Sequence diagram: A write job is accepted synchronously via MemIf, executed asynchronously in the driver, and completed via callback or polling. Sources: SWS Ea p. 41, SWS Fee p. 48, ErrorDescription p. 60, [SWS_MemIf_00040]

Status, Job Result, and Operating Mode

MemIf_GetStatus returns the status of the selected module [SWS_MemIf_00042]. Possible are MEMIF_UNINIT, MEMIF_IDLE, MEMIF_BUSY, and MEMIF_BUSY_INTERNAL. In case of MEMIF_BUSY_INTERNAL, the abstraction module is busy with internal management, while the driver can be busy or idle [SWS_MemIf_00064]. The Fee specification substantiates the conditions and cites the reorganization of the flash (garbage collection) as an example of internal management SWS Fee p. 30. For the flash driver, the status may already be queried prior to initialization and is then MEMIF_UNINIT SWS Fls p. 35.

status start Start UNINIT MEMIF_UNINIT start->UNINIT IDLE MEMIF_IDLE UNINIT->IDLE Modul initialisiert BUSY MEMIF_BUSY IDLE->BUSY Upper-layer job in progress BUSYINT MEMIF_BUSY_INTERNAL IDLE->BUSYINT interne Verwaltung (z. B. Garbage Collection) BUSY->IDLE Auftrag beendet BUSYINT->IDLE interne Verwaltung beendet

State diagram: Lifecycle of the module status visible via MemIf_GetStatus. Sources: [SWS_MemIf_00064], SWS Fee p. 30

MemIf_GetJobResult returns the result of the last job [SWS_MemIf_00043] [SWS_MemIf_00065]. Read, write, and erase share a single job result, so that only that of the last job can be queried. Upon acceptance of a new job, it is set to MEMIF_JOB_PENDING SWS Fls p. 36; Fee refers to the last accepted job SWS Fee p. 31. In addition to OK, FAILED, and CANCELED, there are two block-related results. MEMIF_BLOCK_INCONSISTENT means that the block is corrupt or not found; MEMIF_BLOCK_INVALID means that it is marked as invalid [SWS_MemIf_00065].

jobergebnis neu Neuer Auftrag angenommen PENDING MEMIF_JOB_PENDING neu->PENDING OK MEMIF_JOB_OK PENDING->OK erfolgreich beendet FAILED MEMIF_JOB_FAILED PENDING->FAILED Unsuccessful CANCELED MEMIF_JOB_CANCELED PENDING->CANCELED abgebrochen INCONS MEMIF_BLOCK_INCONSISTENT PENDING->INCONS Block corrupt or not found INVALID MEMIF_BLOCK_INVALID PENDING->INVALID Block marked as invalid OK->neu Next job FAILED->neu Next job CANCELED->neu Next job INCONS->neu Next job INVALID->neu Next job

State diagram: An accepted job is in state PENDING and terminates in exactly one of the final results. Sources: [SWS_MemIf_00065], SWS Fls p. 36, SWS Fee p. 31

MemIf_SetMode is the only service that does not have a DeviceIndex and calls SetMode of all abstraction modules [SWS_MemIf_00038]. The modes are MEMIF_MODE_SLOW and MEMIF_MODE_FAST [SWS_MemIf_00066]. For the drivers, this represents slow read access or normal SPI access on the one hand, and fast read access or SPI burst on the other hand. Eep_SetMode must not be called during an ongoing operation SWS Eep p. 34. If checking is active, Fls_SetMode rejects a request in the busy state SWS Fls p. 42. Interpretation: Since MemIf_SetMode reaches all modules, it should only be called if all devices report MEMIF_IDLE. Question Q-d6ee630fca619042 (open)

Canceling Running Jobs

MemIf_Cancel calls the cancel function of the selected module [SWS_MemIf_00041]. The cancellation itself is synchronous, but asynchronous with respect to the hardware: The hardware may still continue running when the call has already returned SWS Fee p. 45 SWS Ea p. 44. The job result is then MEMIF_JOB_CANCELED [SWS_MemIf_00065], which Fee explicitly evaluates as a failure SWS Fee p. 31.

For the Flash path, the driver specification shows the chain MemIf_Cancel → Fee_Cancel → Fls_Cancel with subsequent error notifications. It also requires that Fls_Cancel not be called during a running Fls_MainFunction. There are two ways to achieve this: The job functions of NvM and Flash driver are synchronized, or the task of Fls_MainFunction is not interrupted SWS Fls p. 58.

Cancellation of an ongoing flash jobNvMMemIfFeeFlsMemIf_Cancel(DeviceIndex)Fee_Cancel()Fls_Cancel()Fls_Cancel not duringlaufender Fls_MainFunctionReturnReturnReturn (synchronous)Cancellation is asynchronousTo the hardwareoptFehlerbenachrichtigung konfiguriertFee_JobErrorNotification()NvM_JobErrorNotification()MemIf_GetJobResult(DeviceIndex)Fee_GetJobResult()MEMIF_JOB_CANCELEDMEMIF_JOB_CANCELED

Sequence diagram: The cancellation runs synchronously through all layers, the error notification follows, after which GetJobResult reports CANCELED. Sources: SWS Fls p. 58, SWS Fee p. 45, [SWS_MemIf_00041]

Call Rules, Reentrancy, and Embedding into the BSW

With the exception of MemIf_GetVersionInfo, all services are non-reentrant [SWS_MemIf_00045] [SWS_MemIf_00040]. Parallel calls from multiple contexts must therefore be excluded. Since status and job result per module only reflect the last job, the caller should only issue a new job after completion of the previous one SWS Fls p. 36.

The memory mapping example of an ICC2 cluster "MEM" lists MemIf together with the NvM. There, MemIf_SetMode is modeled as BswCalledEntity, and MemIf has the section prefix MEMIF SWS MemoryMapping p. 50. The BSW Distribution Guide names MEMIF alongside FLS and FEE as an example of "Type I"; the validity range can be restricted to one core via SwAddrMethod with local scope EXP BSWDistributionGuide p. 31. Presumably, MemIf is thus to be operated core-locally in multi-core systems. Question Q-d998fdc58e0bcddd (open)

Behavior in the event of an error

MemIf distinguishes two development errors. MEMIF_E_PARAM_DEVICE (0x01) stands for an incorrect DeviceIndex, MEMIF_E_PARAM_POINTER (0x02) for a NULL pointer [SWS_MemIf_00006]. They are reported via the optional Det_ReportError [SWS_MemIf_00048]. According to the tracing table, specific error codes are not returned via the API SWS MemIf p. 12.

If development error detection is active and an error is detected, Read, Write, InvalidateBlock, and EraseImmediateBlock return E_NOT_OK [SWS_MemIf_00039] [SWS_MemIf_00040] [SWS_MemIf_00044] [SWS_MemIf_00046]. In this case, MemIf_GetJobResult returns MEMIF_JOB_FAILED SWS MemIf p. 21. Otherwise, the value of the module is passed through unchanged.

fehlerpruefung aufruf Call of a MemIf service (DeviceIndex, pointer if applicable) q1 Entwicklungsfehlererkennung aktiviert? aufruf->q1 q2 parameter valid? q1->q2 yes weiter Call function of module selected via DeviceIndex q1->weiter no det Det_ReportError with MEMIF_E_PARAM_DEVICE (0x01) or MEMIF_E_PARAM_POINTER (0x02) q2->det no q2->weiter yes fehl Return E_NOT_OK (MemIf_GetJobResult: MEMIF_JOB_FAILED) det->fehl rueck Return module return value unchanged weiter->rueck

Activity diagram: Parameter check when development error detection is active and passing through of the module result. Sources: [SWS_MemIf_00006], [SWS_MemIf_00048], SWS MemIf p. 18, SWS MemIf p. 21

Memory runtime errors are not detected by MemIf, but by Fee or Ea; MemIf itself does not react to them ("N/A"). In polling mode, the NvM reads the error via MemIf_GetJobResult as MEMIF_JOB_FAILED, and rectification lies with the NvM ErrorDescription p. 58 ErrorDescription p. 60. A more recent version describes this rectification in more detail. According to it, the NvM increments a retry counter for write jobs, aborts after exceeding it, and reports NVM_E_REQ_FAILED to the DEM EXP ErrorDescription p. 45. For R20-11, this detail is not normatively substantiated here.

Further detailed evidence

AI-generated guide based on the specification excerpts provided in the prompt. Normative are the referenced requirements of release R20-11. Interpretations are marked as such.

Memory Abstraction Interface (MemIf)

Abstracts underlying Flash and EEPROM memory drivers.

Funktionen — Übersicht

Typen — Übersicht

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e9d6121ccdfc Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9f6882978f36 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 88682d2af3e3 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: fa67da25152e Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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 ID 0x04 and is provided via the header file MemIf.h [SWS_MemIf_00041].
  • Parameters: The input parameter Device Index (type uint8) 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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 65e4894eca9b Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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_00022 occurs, the function returns E_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_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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e3fb9cffcdad Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: a0c9a4a73b28 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 975aee2541ba Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 00926ceab163 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

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

Initialization and status

Invokes the "Get Status" function of the underlying memory abstraction module selected by the parameter Device Index.

MemIf_StatusType MemIf_GetStatus (uint8 DeviceIndex);

Returns version information.

void MemIf_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);

Services

MemIf_Cancel function

Invokes the "Cancel" function of the underlying memory abstraction module selected by the parameter Device Index.

void MemIf_Cancel (uint8 DeviceIndex);

Invokes the "Erase Immediate Block" function of the underlying memory abstraction module selected by the parameter Device Index.

Std_ReturnType MemIf_EraseImmediateBlock (uint8 DeviceIndex, uint16 BlockNumber);

Invokes the "Get Job Result" function of the underlying memory abstraction module selected by the parameter Device Index. Available v ia Mem If.h

MemIf_JobResultType MemIf_GetJobResult (uint8 DeviceIndex);

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.

Std_ReturnType MemIf_InvalidateBlock (uint8 DeviceIndex, uint16 BlockNumber);
MemIf_Read function

Invokes the "Read" function of the underlying memory abstraction module selected by the parameter Device Index.

Std_ReturnType MemIf_Read (uint8 DeviceIndex, uint16 BlockNumber, uint16 BlockOffset, uint8* DataBufferPtr, uint16 Length);
MemIf_SetMode function

Invokes the "Set Mode" functions of all underlying memory abstraction modules.

void MemIf_SetMode (MemIf_ModeType Mode);
MemIf_Write function

Invokes the "Write" function of the underlying memory abstraction module selected by the parameter Device Index.

Std_ReturnType MemIf_Write (uint8 DeviceIndex, uint16 BlockNumber, const uint8* DataBufferPtr);

Types

Denotes the result of the last job.

Denotes the operation mode of the underlying abstraction mod ules and device drivers.

Denotes the current status of the underlying abstraction module and device drive. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_MemoryAbstractionInterface