DEENESPTFRRUARHIKOZHNL

Memory Driver (Mem)

ModulMem (Memory Driver)
BSW-Modul-ID91
Standard-Header#include "Mem.h"
SWS-SpezifikationAUTOSAR_CP_SWS_MemoryDriver.pdf, AUTOSAR_SWS_MemoryDriver.pdf
Umfang100 Records · 2 Snippets
ClusterSpeicher-Stack (Memory)

Memory Driver (Mem)

AUTOSAR Classic Memory Drivers-Modul Memory Driver (Mem, Spezifikation: AUTOSAR_CP_SWS_MemoryDriver.pdf, AUTOSAR_SWS_MemoryDriver.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

functie Mem_Init [SWS_Mem_10008] 📄 PDF

void Mem_Init(const Mem_ConfigType* configPtr);

Initialization function - initializes all variables and sets the module state to initialized.

functie Mem_MainFunction [SWS_Mem_10010] 📄 PDF

void Mem_MainFunction(void);

Service to handle the requested jobs and the internal management operations.

functie Mem_GetJobResult [SWS_Mem_10011] 📄 PDF

Mem_JobResultType Mem_GetJobResult(Mem_InstanceIdType instanceId);

Service to return results of the most recent job.

functie Mem_Read [SWS_Mem_10012] 📄 PDF

Std_ReturnType Mem_Read(Mem_InstanceIdType instanceId, Mem_AddressType sourceAddress, Mem_DataType* destinationDataPtr, Mem_LengthType length);

Triggers a read job to copy the from the source address into the referenced destination data buffer. The result of this service can be retrieved using the Mem_GetJobResult API. If the read operation was successful, the result of the job is MEM_JOB_OK. If the read operation failed, the result of the job is either MEM_JOB_FAILED in case of a general error or MEM_ECC_ CORRECTED/MEM_ECC_UNCORRECTED in case of a correctable/uncorrectable ECC error.

functie Mem_Write [SWS_Mem_10013] 📄 PDF

Std_ReturnType Mem_Write(Mem_InstanceIdType instanceId, Mem_AddressType targetAddress, const Mem_DataType* sourceDataPtr, Mem_LengthType length);

Triggers a write job to store the passed data to the provided address area with given address and length. The result of this service can be retrieved using the Mem_GetJobResult API. If the write operation was successful, the job result is MEM_JOB_OK. If there was an issue writing the data, the result is MEM_FAILED.

functie Mem_Erase [SWS_Mem_10014] 📄 PDF

Std_ReturnType Mem_Erase(Mem_InstanceIdType instanceId, Mem_AddressType targetAddress, Mem_LengthType length);

Triggers an erase job of the given sector/sector batch defined by targetAddress and length. The result of this service can be retrieved using the Mem_GetJobResult API. If the erase operation was successful, the result of the job is MEM_JOB_OK. If the erase operation failed, e.g. due to a hardware issue, the result of the job is MEM_JOB_FAILED.

functie Mem_PropagateError [SWS_Mem_10015] 📄 PDF

void Mem_PropagateError(Mem_InstanceIdType instanceId);

This service can be used to report an access error in case the Mem driver cannot provide the access error information - typically for ECC faults. It is called by the system ECC handler to propagate an ECC error to the memory upper layers..

functie Mem_BlankCheck [SWS_Mem_10016] 📄 PDF

Std_ReturnType Mem_BlankCheck(Mem_InstanceIdType instanceId, Mem_AddressType targetAddress, Mem_LengthType length);

Triggers a job to check the erased state of the page which is referenced by targetAddress. The result of this service can be retrieved using the Mem_GetJobResult API. If the checked page is blank, the result of the job is MEM_JOB_OK. Otherwise, if the page is not blank, the result is MEM_INCONSISTENT.

functie Mem_HwSpecificService [SWS_Mem_10017] 📄 PDF

Std_ReturnType Mem_HwSpecificService(Mem_InstanceIdType instanceId, Mem_HwServiceIdType hwServiceId, Mem_DataType* dataPtr, Mem_LengthType* lengthPtr);

Triggers a hardware specific memory driver job. dataPtr can be used to pass and return data to/ from this service. This service is just a dispatcher to the hardware specific service implementation referenced by hwServiceId. The result of this service can be retrieved using the Mem_GetJobResult API. If the hardware specific operation was successful, the result of the job is MEM_JOB_OK. If the hardware specific operation failed, the result of the job is MEM_JOB_ FAILED. Tags: atp.Status=draft

functie Mem_DeInit [SWS_Mem_10018] 📄 PDF

void Mem_DeInit(void);

De-initialize module. If there is still an access job pending, it is immediately terminated (using hardware cancel operation) and the Mem driver module state is set to unitialized. Therefore, Mem must be re-initialized before it will accept any new job requests after this service is processed.

functie Mem_Suspend [SWS_Mem_10024] 📄 PDF

void Mem_Suspend(Mem_InstanceIdType instanceId);

Suspend active memory operation using hardware mechanism. Tags: atp.Status=draft

functie Mem_Resume [SWS_Mem_10025] 📄 PDF

void Mem_Resume(Mem_InstanceIdType instanceId);

Resume suspended memory operation using hardware mechanism. Tags: atp.Status=draft

type Mem_InstanceIdType [SWS_Mem_10004] 📄 PDF

Job end notification function called by Mem in case the job processing is configured for job end notification.

requirement SWS_Mem_00001 [SWS_Mem_00001] 📄 PDF

The service Mem_Init shall initialize the Mem driver internal states and set the Mem driver job processing state to MEM_JOB_OK .

requirement SWS_Mem_00002 [SWS_Mem_00002] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_GetVersionInfo shall raise the development er- ror MEM_E_PARAM_POINTER if the versionInfoPtr argument is a NULL pointer.

requirement SWS_Mem_00003 [SWS_Mem_00003] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Read shall check that the Mem driver has been initialized. If this check fails, Mem_Read shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00004 [SWS_Mem_00004] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Read shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_Read shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00005 [SWS_Mem_00005] 📄 PDF

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Read shall raise the development error MEM_E_PARAM_POINTER if the destinationDataPtr argument is a NULL pointer.

requirement SWS_Mem_00006 [SWS_Mem_00006] 📄 PDF

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Read shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by sourceAddress is invalid.

requirement SWS_Mem_00007 [SWS_Mem_00007] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Read shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

requirement SWS_Mem_00008 [SWS_Mem_00008] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Write shall check that the Mem driver has been initialized. If this check fails, Mem_Write shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00009 [SWS_Mem_00009] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_Write shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_Write shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00010 [SWS_Mem_00010] 📄 PDF

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Write shall raise the development error MEM_E_PARAM_POINTER if the sourceDataPtr argument is a NULL pointer.

requirement SWS_Mem_00011 [SWS_Mem_00011] 📄 PDF

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Write shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by targetAddress is invalid.

requirement SWS_Mem_00012 [SWS_Mem_00012] 📄 PDF

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Write shall raise the development error MEM_E_PARAM_LENGTH if the write length defined by length is invalid.

requirement SWS_Mem_00013 [SWS_Mem_00013] 📄 PDF

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Write shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

requirement SWS_Mem_00014 [SWS_Mem_00014] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Erase shall check that the Mem driver has been initialized. If this check fails, Mem_Erase shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00015 [SWS_Mem_00015] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_Erase shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_Erase shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00016 [SWS_Mem_00016] 📄 PDF

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Erase shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by targetAddress is invalid.

requirement SWS_Mem_00017 [SWS_Mem_00017] 📄 PDF

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Erase shall raise the development error MEM_E_PARAM_LENGTH if the read length defined by length is invalid.

requirement SWS_Mem_00018 [SWS_Mem_00018] 📄 PDF

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Erase shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

requirement SWS_Mem_00019 [SWS_Mem_00019] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_PropagateError shall check that the Mem driver has been initialized. If this check fails, Mem_PropagateError shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00020 [SWS_Mem_00020] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_PropagateError shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_PropagateError shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00021 [SWS_Mem_00021] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_BlankCheck shall check that the Mem driver has been initialized. If this check fails, Mem_BlankCheck shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00022 [SWS_Mem_00022] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_BlankCheck shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_BlankCheck shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00023 [SWS_Mem_00023] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_BlankCheck shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by targetAddress is invalid.

requirement SWS_Mem_00024 [SWS_Mem_00024] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_BlankCheck shall raise the development error MEM_E_PARAM_LENGTH if the read length defined by length is invalid.

requirement SWS_Mem_00025 [SWS_Mem_00025] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_BlankCheck shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

requirement SWS_Mem_00026 [SWS_Mem_00026] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_HwSpecificService shall check that the provided instan- ceId is consistent with the configuration. If this check fails, Mem_HwSpecificSer- vice shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00027 [SWS_Mem_00027] 📄 PDF

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_HwSpecificService shall raise the development error MEM_E_PARAM_POINTER if the dataPtr or lengthPtr argument is a NULL pointer.

requirement SWS_Mem_00029 [SWS_Mem_00029] 📄 PDF

The Mem driver shall keep track of the job processing and the result of the last processed job.

requirement SWS_Mem_00030 [SWS_Mem_00030] 📄 PDF

Once a job request is accepted, the job processing status shall be set to MEM_JOB_PENDING .

requirement SWS_Mem_00031 [SWS_Mem_00031] 📄 PDF

In case a pending job was not able to complete, the job processing status shall be set to MEM_JOB_FAILED .

requirement SWS_Mem_00033 [SWS_Mem_00033] 📄 PDF

The Mem driver shall check static configuration parameters statically (at the latest during compile time) for correctness.

requirement SWS_Mem_00035 [SWS_Mem_00035] 📄 PDF

The Mem driver shall not perform any sort of address or length alignment in case physical segmentation needs to be considered, e.g. for flash mem- ory.

requirement SWS_Mem_00036 [SWS_Mem_00036] 📄 PDF

The Mem driver shall inherit the size of Mem_AddressType from MemAcc_AddressType to support memories larger than 4GBytes.

requirement SWS_Mem_00037 [SWS_Mem_00037] 📄 PDF

If the maximum physical memory size of a device does not ex- ceed 4GBytes, the Mem driver shall perform an explicit cast and work internally with a 32-Bit address type.

requirement SWS_Mem_00038 [SWS_Mem_00038] 📄 PDF

The Mem driver shall provide two ways for the service function invocation: • Direct service invocation • Indirect service invocation by a function pointer table

requirement SWS_Mem_00039 [SWS_Mem_00039] 📄 PDF

If built as a separate image, the Mem driver shall be completely self contained, i.e. it must not call any library or any other external functions.

requirement SWS_Mem_00040 [SWS_Mem_00040] 📄 PDF

Since Mem drivers are always hardware/CPU specific, the byte order of data fields and address information within the Mem driver binary shall follow the standard CPU byte order.

requirement SWS_Mem_00041 [SWS_Mem_00041] 📄 PDF

The header part of the Mem driver binary shall follow the struc- ture defined in table 7.1. The size of the address information depends on the configured MemAcc_AddressType (4 or 8 bytes).

requirement SWS_Mem_00042 [SWS_Mem_00042] 📄 PDF

The unique identifier is used for unique identification of Mem drivers. The format of the unique identifier shall follow the structure defined in table 7.2.

requirement SWS_Mem_00043 [SWS_Mem_00043] 📄 PDF

The ABI version of a Mem driver following this specification shall be 0001.

requirement SWS_Mem_00044 [SWS_Mem_00044] 📄 PDF

The header address is used for development error checks to verify the consistency of the linked Mem driver binary image with the location of the RAM buffer which is used for execution of the Mem driver. In case of a relocatable/position independent Mem driver binary, the header address shall be set to zero, otherwise, the header address shall hold the physical start address of the Mem driver binary.

requirement SWS_Mem_00045 [SWS_Mem_00045] 📄 PDF

The flag part of the Mem driver header is a bit-field which holds additional information for develop error checks. The format of the flag bit-field shall follow the structure defined in table 7.3.

requirement SWS_Mem_00046 [SWS_Mem_00046] 📄 PDF

The delimiter address part of the Mem driver header is used for development error checks to verify that the Mem driver binary is complete by checking the delimiter pattern linked to the end of the Mem driver binary. In case of a relocatable/position independent Mem driver binary, the delimiter address shall be set to zero, otherwise, the delimiter address shall hold the physical address of the delimiter pattern.

requirement SWS_Mem_00048 [SWS_Mem_00048] 📄 PDF

The size of the Mem driver function pointers shall be ma- chine/CPU specific.

requirement SWS_Mem_00051 [SWS_Mem_00051] 📄 PDF

The value of the delimiter field shall be the ones' complement of the unique identifier value.

requirement SWS_Mem_00052 [SWS_Mem_00052] 📄 PDF

Development Error Types The development error types defined for Mem are listed in table Table 7.5.

requirement SWS_Mem_00053 [SWS_Mem_00053] 📄 PDF

All hardware specific routines shall be accessed by the Mem_HwSpecificService() service.

requirement SWS_Mem_00057 [SWS_Mem_00057] 📄 PDF

A Mem driver instance shall allow only one job request at a time.

requirement SWS_Mem_00059 [SWS_Mem_00059] 📄 PDF

If the Mem driver is not able to process a job request, e.g. due to a pending request or due to an invalid parameter, the job request shall be rejected by an E_NOT_OK return code.

requirement SWS_Mem_00060 [SWS_Mem_00060] 📄 PDF

The Mem driver implementation shall support multiple instances of the same memory device.

requirement SWS_Mem_00061 [SWS_Mem_00061] 📄 PDF

If the Mem_PropagateError service is called, the Mem driver shall set the job result code to MEM_ECC_UNCORRECTED and cancel the current job processing.

requirement SWS_Mem_00062 [SWS_Mem_00062] 📄 PDF

⌊ DRAFT g If the memory hardware provides ECC information, the Mem driver shall check for correctable ECC errors and set the job result code to MEM_ECC_CORRECTED and proceed with the current job processing.

requirement SWS_Mem_00063 [SWS_Mem_00063] 📄 PDF

If the memory hardware provides ECC information, the Mem driver shall check for uncorrectable ECC errors and set the job result code to MEM_ECC_UNCORRECTED and abort the current job processing.

requirement SWS_Mem_00065 [SWS_Mem_00065] 📄 PDF

{DRAFT} The Mem driver does not use transient faults. In case the memory device supports extended error checks, the Mem driver shall indicate them to the upper layer using the normal fault handling.

requirement SWS_Mem_00066 [SWS_Mem_00066] 📄 PDF

All job requests triggered by asynchronous Mem driver services shall be executed within the Mem_MainFunction .

requirement SWS_Mem_00067 [SWS_Mem_00067] 📄 PDF

After a job was successfully processed, the job processing status shall be set to MEM_JOB_OK .

requirement SWS_Mem_00068 [SWS_Mem_00068] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_HwSpecificService shall check that the Mem driver has been initialized. If this check fails, Mem_HwSpecificService shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00070 [SWS_Mem_00070] 📄 PDF

In case a service is not relevant for a specific memory device technology, the service shall always return E_MEM_SERVICE_NOT_AVAIL .

requirement SWS_Mem_00072 [SWS_Mem_00072] 📄 PDF

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Read shall raise the development error MEM_E_PARAM_LENGTH if the read length defined by length is invalid.

requirement SWS_Mem_00073 [SWS_Mem_00073] 📄 PDF

The function pointer table is a standardized structure used to reference the Mem driver service functions. The format of function pointer table shall follow the structure defined in table 7.4.

requirement SWS_Mem_00074 [SWS_Mem_00074] 📄 PDF

The Mem driver API names, type definitions and file naming scheme shall follow the standard AUTOSAR BSW Module implementation prefix with vendorId and vendorApiInfix .

requirement SWS_Mem_00076 [SWS_Mem_00076] 📄 PDF

In case the job processing was completed but the results of the last Mem job didn't meet the expected result, e.g. a blank check operation was applied on a non-blank memory area, the job result shall be set to MEM_INCONSISTENT .

requirement SWS_Mem_00077 [SWS_Mem_00077] 📄 PDF

If the memory hardware supplies ECC information, the Mem driver shall check for correctable ECC errors and, in the case of correctable ECC errors, continue with the job processing. After completion of the job, the job result shall be set to MEM_ECC_CORRECTED .

requirement SWS_Mem_00078 [SWS_Mem_00078] 📄 PDF

In case the last memory operation didn't complete due to an un- correctable ECC error, the job result shall be set to MEM_ECC_UNCORRECTED .

requirement SWS_Mem_00079 [SWS_Mem_00079] 📄 PDF

The service Mem_DeInit shall cancel any ongoing flash oper- ations in the hardware and de-initialize the Mem driver internal states.

requirement SWS_Mem_00080 [SWS_Mem_00080] 📄 PDF

The service Mem_Suspend shall suspend any ongoing flash operations using an according hardware mechanism.

requirement SWS_Mem_00081 [SWS_Mem_00081] 📄 PDF

The service Mem_Resume shall resume a flash operations that was suspended by the service Mem_Suspend .

requirement SWS_Mem_00082 [SWS_Mem_00082] 📄 PDF

In case a memory device provides a hardware-based sus- pend/resume mechanism, the Mem driver shall utilize the hardware capabilities to implement the Mem_Suspend and Mem_Resume services. If no hardware suspend/re- sume support is available, the Mem_Suspend and Mem_Resume services shall return E_MEM_SERVICE_NOT_AVAIL .

requirement SWS_Mem_00083 [SWS_Mem_00083] 📄 PDF

In case a suspend operation is already in pending, Mem_- Suspend shall reject the request by returning E_NOT_OK without further actions.

requirement SWS_Mem_00084 [SWS_Mem_00084] 📄 PDF

In case no suspend operation is pending, Mem_Resume shall reject the request by returning E_NOT_OK without further actions.

requirement SWS_Mem_00085 [SWS_Mem_00085] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Suspend shall check that the Mem driver has been initialized. If this check fails, Mem_Suspend shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00086 [SWS_Mem_00086] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Resume shall check that the Mem driver has been initialized. If this check fails, Mem_Resume shall raise the development error MEM_E_UNINIT .

requirement SWS_Mem_00087 [SWS_Mem_00087] 📄 PDF

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Init shall raise the development error MEM_E_PARAM_POINTER if the configPtr argument is not a NULL pointer.

requirement SWS_Mem_00088 [SWS_Mem_00088] 📄 PDF

The Mem driver shall not verify the result of a write or erase operation.

requirement SWS_Mem_00090 [SWS_Mem_00090] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_GetJobResult shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_GetJobResult shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00091 [SWS_Mem_00091] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Suspend shall check that the provided instanceId is con- sistent with the configuration. If this check fails, Mem_Suspend shall raise the develop- ment error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_00092 [SWS_Mem_00092] 📄 PDF

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Resume shall check that the provided instanceId is consis- tent with the configuration. If this check fails, Mem_Resume shall raise the development error MEM_E_PARAM_INSTANCE_ID .

requirement SWS_Mem_10020 [SWS_Mem_10020] 📄 PDF

Module Header File Imported Type MemAcc MemAcc_GeneralTypes.h MemAcc_AddressType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Mem
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Mem@rel:R20-11#be194491
Content hash
be194491
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_MemoryDriver.pdf#nameddest=SWS_Mem_10008

Initialisatie en status

Mem_DeInit functie

De-initialize module. If there is still an access job pending, it is immediately terminated (using hardware cancel operation) and the Mem driver module state is set to unitialized. Therefore, Mem must be re-initialized before it will accept any new job requests after this service is processed.

void Mem_DeInit(void);

Service to return the version information of the Mem module.

void Mem_GetVersionInfo(Std_VersionInfoType* versionInfoPtr);
Mem_Init functie

Initialization function - initializes all variables and sets the module state to initialized.

void Mem_Init(const Mem_ConfigType* configPtr);

Diensten

Triggers a job to check the erased state of the page which is referenced by targetAddress. The result of this service can be retrieved using the Mem_GetJobResult API. If the checked page is blank, the result of the job is MEM_JOB_OK. Otherwise, if the page is not blank, the result is MEM_INCONSISTENT.

Std_ReturnType Mem_BlankCheck(Mem_InstanceIdType instanceId, Mem_AddressType targetAddress, Mem_LengthType length);
Mem_Erase functie

Triggers an erase job of the given sector/sector batch defined by targetAddress and length. The result of this service can be retrieved using the Mem_GetJobResult API. If the erase operation was successful, the result of the job is MEM_JOB_OK. If the erase operation failed, e.g. due to a hardware issue, the result of the job is MEM_JOB_FAILED.

Std_ReturnType Mem_Erase(Mem_InstanceIdType instanceId, Mem_AddressType targetAddress, Mem_LengthType length);

Service to return results of the most recent job.

Mem_JobResultType Mem_GetJobResult(Mem_InstanceIdType instanceId);

Triggers a hardware specific memory driver job. dataPtr can be used to pass and return data to/ from this service. This service is just a dispatcher to the hardware specific service implementation referenced by hwServiceId. The result of this service can be retrieved using the Mem_GetJobResult API. If the hardware specific operation was successful, the result of the job is MEM_JOB_OK. If the hardware specific operation failed, the result of the job is MEM_JOB_ FAILED. Tags: atp.Status=draft

Std_ReturnType Mem_HwSpecificService(Mem_InstanceIdType instanceId, Mem_HwServiceIdType hwServiceId, Mem_DataType* dataPtr, Mem_LengthType* lengthPtr);

This service can be used to report an access error in case the Mem driver cannot provide the access error information - typically for ECC faults. It is called by the system ECC handler to propagate an ECC error to the memory upper layers..

void Mem_PropagateError(Mem_InstanceIdType instanceId);
Mem_Read functie

Triggers a read job to copy the from the source address into the referenced destination data buffer. The result of this service can be retrieved using the Mem_GetJobResult API. If the read operation was successful, the result of the job is MEM_JOB_OK. If the read operation failed, the result of the job is either MEM_JOB_FAILED in case of a general error or MEM_ECC_ CORRECTED/MEM_ECC_UNCORRECTED in case of a correctable/uncorrectable ECC error.

Std_ReturnType Mem_Read(Mem_InstanceIdType instanceId, Mem_AddressType sourceAddress, Mem_DataType* destinationDataPtr, Mem_LengthType length);
Mem_Resume functie

Resume suspended memory operation using hardware mechanism. Tags: atp.Status=draft

void Mem_Resume(Mem_InstanceIdType instanceId);
Mem_Suspend functie

Suspend active memory operation using hardware mechanism. Tags: atp.Status=draft

void Mem_Suspend(Mem_InstanceIdType instanceId);
Mem_Write functie

Triggers a write job to store the passed data to the provided address area with given address and length. The result of this service can be retrieved using the Mem_GetJobResult API. If the write operation was successful, the job result is MEM_JOB_OK. If there was an issue writing the data, the result is MEM_FAILED.

Std_ReturnType Mem_Write(Mem_InstanceIdType instanceId, Mem_AddressType targetAddress, const Mem_DataType* sourceDataPtr, Mem_LengthType length);

Cyclisch

Service to handle the requested jobs and the internal management operations.

void Mem_MainFunction(void);

Typen

Physical memory device address type

Postbuild configuration structure type

Read data user buffer type

Hardware specific service request identifier type

Job end notification function called by Mem in case the job processing is configured for job end notification.

Asynchronous job result type

Physical memory device length type

Eisen

SWS_Mem_00001 requirement

The service Mem_Init shall initialize the Mem driver internal states and set the Mem driver job processing state to MEM_JOB_OK .

SWS_Mem_00002 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_GetVersionInfo shall raise the development er- ror MEM_E_PARAM_POINTER if the versionInfoPtr argument is a NULL pointer.

SWS_Mem_00003 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Read shall check that the Mem driver has been initialized. If this check fails, Mem_Read shall raise the development error MEM_E_UNINIT .

SWS_Mem_00004 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Read shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_Read shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00005 requirement

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Read shall raise the development error MEM_E_PARAM_POINTER if the destinationDataPtr argument is a NULL pointer.

SWS_Mem_00006 requirement

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Read shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by sourceAddress is invalid.

SWS_Mem_00007 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Read shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

SWS_Mem_00008 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Write shall check that the Mem driver has been initialized. If this check fails, Mem_Write shall raise the development error MEM_E_UNINIT .

SWS_Mem_00009 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_Write shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_Write shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00010 requirement

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Write shall raise the development error MEM_E_PARAM_POINTER if the sourceDataPtr argument is a NULL pointer.

SWS_Mem_00011 requirement

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Write shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by targetAddress is invalid.

SWS_Mem_00012 requirement

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Write shall raise the development error MEM_E_PARAM_LENGTH if the write length defined by length is invalid.

SWS_Mem_00013 requirement

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Write shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

SWS_Mem_00014 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Erase shall check that the Mem driver has been initialized. If this check fails, Mem_Erase shall raise the development error MEM_E_UNINIT .

SWS_Mem_00015 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_Erase shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_Erase shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00016 requirement

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Erase shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by targetAddress is invalid.

SWS_Mem_00017 requirement

If development error detection is enabled by MemDev- ErrorDetect , the service Mem_Erase shall raise the development error MEM_E_PARAM_LENGTH if the read length defined by length is invalid.

SWS_Mem_00018 requirement

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Erase shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

SWS_Mem_00019 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_PropagateError shall check that the Mem driver has been initialized. If this check fails, Mem_PropagateError shall raise the development error MEM_E_UNINIT .

SWS_Mem_00020 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_PropagateError shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_PropagateError shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00021 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_BlankCheck shall check that the Mem driver has been initialized. If this check fails, Mem_BlankCheck shall raise the development error MEM_E_UNINIT .

SWS_Mem_00022 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_BlankCheck shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_BlankCheck shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00023 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_BlankCheck shall raise the development error MEM_E_PARAM_ADDRESS if the address defined by targetAddress is invalid.

SWS_Mem_00024 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_BlankCheck shall raise the development error MEM_E_PARAM_LENGTH if the read length defined by length is invalid.

SWS_Mem_00025 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_BlankCheck shall raise the development error MEM_E_JOB_PENDING if a previous Mem job is still being processed.

SWS_Mem_00026 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_HwSpecificService shall check that the provided instan- ceId is consistent with the configuration. If this check fails, Mem_HwSpecificSer- vice shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00027 requirement

If development error detection is enabled by MemDevEr- rorDetect , the service Mem_HwSpecificService shall raise the development error MEM_E_PARAM_POINTER if the dataPtr or lengthPtr argument is a NULL pointer.

SWS_Mem_00029 requirement

The Mem driver shall keep track of the job processing and the result of the last processed job.

SWS_Mem_00030 requirement

Once a job request is accepted, the job processing status shall be set to MEM_JOB_PENDING .

SWS_Mem_00031 requirement

In case a pending job was not able to complete, the job processing status shall be set to MEM_JOB_FAILED .

SWS_Mem_00033 requirement

The Mem driver shall check static configuration parameters statically (at the latest during compile time) for correctness.

SWS_Mem_00035 requirement

The Mem driver shall not perform any sort of address or length alignment in case physical segmentation needs to be considered, e.g. for flash mem- ory.

SWS_Mem_00036 requirement

The Mem driver shall inherit the size of Mem_AddressType from MemAcc_AddressType to support memories larger than 4GBytes.

SWS_Mem_00037 requirement

If the maximum physical memory size of a device does not ex- ceed 4GBytes, the Mem driver shall perform an explicit cast and work internally with a 32-Bit address type.

SWS_Mem_00038 requirement

The Mem driver shall provide two ways for the service function invocation: • Direct service invocation • Indirect service invocation by a function pointer table

SWS_Mem_00039 requirement

If built as a separate image, the Mem driver shall be completely self contained, i.e. it must not call any library or any other external functions.

SWS_Mem_00040 requirement

Since Mem drivers are always hardware/CPU specific, the byte order of data fields and address information within the Mem driver binary shall follow the standard CPU byte order.

SWS_Mem_00041 requirement

The header part of the Mem driver binary shall follow the struc- ture defined in table 7.1. The size of the address information depends on the configured MemAcc_AddressType (4 or 8 bytes).

SWS_Mem_00042 requirement

The unique identifier is used for unique identification of Mem drivers. The format of the unique identifier shall follow the structure defined in table 7.2.

SWS_Mem_00043 requirement

The ABI version of a Mem driver following this specification shall be 0001.

SWS_Mem_00044 requirement

The header address is used for development error checks to verify the consistency of the linked Mem driver binary image with the location of the RAM buffer which is used for execution of the Mem driver. In case of a relocatable/position independent Mem driver binary, the header address shall be set to zero, otherwise, the header address shall hold the physical start address of the Mem driver binary.

SWS_Mem_00045 requirement

The flag part of the Mem driver header is a bit-field which holds additional information for develop error checks. The format of the flag bit-field shall follow the structure defined in table 7.3.

SWS_Mem_00046 requirement

The delimiter address part of the Mem driver header is used for development error checks to verify that the Mem driver binary is complete by checking the delimiter pattern linked to the end of the Mem driver binary. In case of a relocatable/position independent Mem driver binary, the delimiter address shall be set to zero, otherwise, the delimiter address shall hold the physical address of the delimiter pattern.

SWS_Mem_00048 requirement

The size of the Mem driver function pointers shall be ma- chine/CPU specific.

SWS_Mem_00051 requirement

The value of the delimiter field shall be the ones' complement of the unique identifier value.

SWS_Mem_00052 requirement

Development Error Types The development error types defined for Mem are listed in table Table 7.5.

SWS_Mem_00053 requirement

All hardware specific routines shall be accessed by the Mem_HwSpecificService() service.

SWS_Mem_00057 requirement

A Mem driver instance shall allow only one job request at a time.

SWS_Mem_00059 requirement

If the Mem driver is not able to process a job request, e.g. due to a pending request or due to an invalid parameter, the job request shall be rejected by an E_NOT_OK return code.

SWS_Mem_00060 requirement

The Mem driver implementation shall support multiple instances of the same memory device.

SWS_Mem_00061 requirement

If the Mem_PropagateError service is called, the Mem driver shall set the job result code to MEM_ECC_UNCORRECTED and cancel the current job processing.

SWS_Mem_00062 requirement

⌊ DRAFT g If the memory hardware provides ECC information, the Mem driver shall check for correctable ECC errors and set the job result code to MEM_ECC_CORRECTED and proceed with the current job processing.

SWS_Mem_00063 requirement

If the memory hardware provides ECC information, the Mem driver shall check for uncorrectable ECC errors and set the job result code to MEM_ECC_UNCORRECTED and abort the current job processing.

SWS_Mem_00065 requirement

{DRAFT} The Mem driver does not use transient faults. In case the memory device supports extended error checks, the Mem driver shall indicate them to the upper layer using the normal fault handling.

SWS_Mem_00066 requirement

All job requests triggered by asynchronous Mem driver services shall be executed within the Mem_MainFunction .

SWS_Mem_00067 requirement

After a job was successfully processed, the job processing status shall be set to MEM_JOB_OK .

SWS_Mem_00068 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_HwSpecificService shall check that the Mem driver has been initialized. If this check fails, Mem_HwSpecificService shall raise the development error MEM_E_UNINIT .

SWS_Mem_00070 requirement

In case a service is not relevant for a specific memory device technology, the service shall always return E_MEM_SERVICE_NOT_AVAIL .

SWS_Mem_00072 requirement

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Read shall raise the development error MEM_E_PARAM_LENGTH if the read length defined by length is invalid.

SWS_Mem_00073 requirement

The function pointer table is a standardized structure used to reference the Mem driver service functions. The format of function pointer table shall follow the structure defined in table 7.4.

SWS_Mem_00074 requirement

The Mem driver API names, type definitions and file naming scheme shall follow the standard AUTOSAR BSW Module implementation prefix with vendorId and vendorApiInfix .

SWS_Mem_00076 requirement

In case the job processing was completed but the results of the last Mem job didn't meet the expected result, e.g. a blank check operation was applied on a non-blank memory area, the job result shall be set to MEM_INCONSISTENT .

SWS_Mem_00077 requirement

If the memory hardware supplies ECC information, the Mem driver shall check for correctable ECC errors and, in the case of correctable ECC errors, continue with the job processing. After completion of the job, the job result shall be set to MEM_ECC_CORRECTED .

SWS_Mem_00078 requirement

In case the last memory operation didn't complete due to an un- correctable ECC error, the job result shall be set to MEM_ECC_UNCORRECTED .

SWS_Mem_00079 requirement

The service Mem_DeInit shall cancel any ongoing flash oper- ations in the hardware and de-initialize the Mem driver internal states.

SWS_Mem_00080 requirement

The service Mem_Suspend shall suspend any ongoing flash operations using an according hardware mechanism.

SWS_Mem_00081 requirement

The service Mem_Resume shall resume a flash operations that was suspended by the service Mem_Suspend .

SWS_Mem_00082 requirement

In case a memory device provides a hardware-based sus- pend/resume mechanism, the Mem driver shall utilize the hardware capabilities to implement the Mem_Suspend and Mem_Resume services. If no hardware suspend/re- sume support is available, the Mem_Suspend and Mem_Resume services shall return E_MEM_SERVICE_NOT_AVAIL .

SWS_Mem_00083 requirement

In case a suspend operation is already in pending, Mem_- Suspend shall reject the request by returning E_NOT_OK without further actions.

SWS_Mem_00084 requirement

In case no suspend operation is pending, Mem_Resume shall reject the request by returning E_NOT_OK without further actions.

SWS_Mem_00085 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Suspend shall check that the Mem driver has been initialized. If this check fails, Mem_Suspend shall raise the development error MEM_E_UNINIT .

SWS_Mem_00086 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Resume shall check that the Mem driver has been initialized. If this check fails, Mem_Resume shall raise the development error MEM_E_UNINIT .

SWS_Mem_00087 requirement

If development error detection is enabled by MemDe- vErrorDetect , the service Mem_Init shall raise the development error MEM_E_PARAM_POINTER if the configPtr argument is not a NULL pointer.

SWS_Mem_00088 requirement

The Mem driver shall not verify the result of a write or erase operation.

SWS_Mem_00090 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_GetJobResult shall check that the provided instanceId is consistent with the configuration. If this check fails, Mem_GetJobResult shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00091 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Suspend shall check that the provided instanceId is con- sistent with the configuration. If this check fails, Mem_Suspend shall raise the develop- ment error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_00092 requirement

If development error detection is enabled by MemDevErrorDe- tect , the service Mem_Resume shall check that the provided instanceId is consis- tent with the configuration. If this check fails, Mem_Resume shall raise the development error MEM_E_PARAM_INSTANCE_ID .

SWS_Mem_10020 requirement

Module Header File Imported Type MemAcc MemAcc_GeneralTypes.h MemAcc_AddressType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

SWS_Mem_10021 requirement

Det_ReportError Det.h Service to report development errors.

SWS_Mem_10022 requirement

There are no mandatory interfaces.