DEENESPTFRRUARHIKOZHNL

Memory Access (MemAcc)

ModulMemAcc (Memory Access)
BSW-Modul-ID41
Standard-Header#include "MemAcc.h"
SWS-SpezifikationAUTOSAR_CP_SWS_MemoryAccess.pdf, AUTOSAR_SWS_MemoryAccess.pdf
Umfang161 Records · 4 Snippets
ClusterSpeicher-Stack (Memory)

Memory Access (MemAcc)

AUTOSAR Classic Memory HW Abstraction-Modul Memory Access (MemAcc, Spezifikation: AUTOSAR_CP_SWS_MemoryAccess.pdf, AUTOSAR_SWS_MemoryAccess.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

function MemAcc_Init [SWS_MemAcc_10015] 📄 PDF

void MemAcc_Init(const MemAcc_ConfigType* configPtr);

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

function MemAcc_MainFunction [SWS_MemAcc_10017] 📄 PDF

void MemAcc_MainFunction(void);

Service to handle the requested jobs and the internal management operations. Depending on the configuration MemAcc will call the Mem driver main functions.

function MemAcc_Cancel [SWS_MemAcc_10018] 📄 PDF

void MemAcc_Cancel(MemAcc_AddressAreaIdType addressAreaId);

Triggers a cancel operation of the pending job for the address area referenced by the address AreaId. Cancelling affects only jobs in pending state. For any other states, the request will be ignored.

function MemAcc_GetJobResult [SWS_MemAcc_10019] 📄 PDF

MemAcc_JobResultType MemAcc_GetJobResult(MemAcc_AddressAreaIdType addressAreaId);

Returns the consolidated job result of the address area referenced by addressAreaId.

function MemAcc_GetMemoryInfo [SWS_MemAcc_10020] 📄 PDF

Std_ReturnType MemAcc_GetMemoryInfo(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType address, MemAcc_MemoryInfoType* memoryInfoPtr);

This service function retrieves the physical memory device information of a specific address area. It can be used by an upper layer to get all necessary information to align the start address and trim the length for erase/write jobs.

function MemAcc_GetProcessedLength [SWS_MemAcc_10021] 📄 PDF

MemAcc_LengthType MemAcc_GetProcessedLength(MemAcc_AddressAreaIdType addressAreaId);

Returns the accumulated number of bytes that have already been processed in the current job.

function MemAcc_GetJobInfo [SWS_MemAcc_10022] 📄 PDF

void MemAcc_GetJobInfo(MemAcc_AddressAreaIdType addressAreaId, MemAcc_JobInfoType* jobInfoPtr);

Returns detailed information of the current memory job like memory device ID, job type, job processing state or job result, address area as well as address and length.

function MemAcc_Read [SWS_MemAcc_10023] 📄 PDF

Std_ReturnType MemAcc_Read(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType sourceAddress, MemAcc_DataType* destinationDataPtr, MemAcc_LengthType length);

Triggers a read job to copy data from the source address into the referenced destination data buffer. The result of this service can be retrieved using the MemAcc_GetJobResult API. If the read operation was successful, the result of the job is MEMACC_MEM_OK. If the read operation failed, the result of the job is either MEMACC_MEM_FAILED in case of a general error or MEMACC_MEM_ECC_CORRECTED/MEMACC_MEM_ECC_UNCORRECTED in case of a correctable/uncorrectable ECC error.

function MemAcc_Write [SWS_MemAcc_10024] 📄 PDF

Std_ReturnType MemAcc_Write(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType targetAddress, const MemAcc_DataType* sourceDataPtr, MemAcc_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 MemAcc_GetJobResult API. If the write operation was successful, the job result is MEMACC_MEM_OK. If there was an issue writing the data, the result is MEMACC_MEM_FAILED.

function MemAcc_Erase [SWS_MemAcc_10025] 📄 PDF

Std_ReturnType MemAcc_Erase(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType targetAddress, MemAcc_LengthType length);

Triggers an erase job of the given area. Triggers an erase job of the given area 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.

function MemAcc_Compare [SWS_MemAcc_10026] 📄 PDF

Std_ReturnType MemAcc_Compare(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType sourceAddress, const MemAcc_DataType* dataPtr, MemAcc_LengthType length);

Triggers a job to compare the passed data to the memory content of the provided address area. The job terminates, if all bytes matched or a difference was detected. The result of this service can be retrieved using the MemAcc_GetJobResult() API. If the compare operation determined a mismatch, the result code is MEMACC_MEM_INCONSISTENT. Tags: atp.Status=draft

function MemAcc_BlankCheck [SWS_MemAcc_10027] 📄 PDF

Std_ReturnType MemAcc_BlankCheck(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType targetAddress, MemAcc_LengthType length);

Checks if the passed address space is blank, i.e. erased and writeable. The result of this service can be retrieved using the MemAcc_GetJobResult API. If the address area defined by targetAddress and length is blank, the result is MEMACC_MEM_OK, otherwise the result is MEMACC_MEM_INCONSISTENT.

function MemAcc_HwSpecificService [SWS_MemAcc_10028] 📄 PDF

Std_ReturnType MemAcc_HwSpecificService(MemAcc_AddressAreaIdType addressAreaId, MemAcc_HwIdType hwId, MemAcc_MemHwServiceIdType hwServiceId, MemAcc_DataType* dataPtr, MemAcc_LengthType* lengthPtr);

Triggers a hardware specific job request referenced by hwServiceId. Service specific data can be passed/retrieved by dataPtr. The result of this service can be retrieved using the MemAcc_GetJobResult API. If the hardware specific operation was successful, the result of the job is MEMACC_MEM_OK. If the hardware specific operation failed, the result of the job is MEMACC_MEM_FAILED.

function <AddressAreaJobEndNotification> [SWS_MemAcc_10029] 📄 PDF

void <AddressAreaJobEndNotification>(MemAcc_AddressAreaIdType addressAreaId, MemAcc_JobResultType jobResult);

MemAcc application job end notification callback. The function name is configurable. Tags: atp.Status=draft

function MemAcc_RequestLock [SWS_MemAcc_10030] 📄 PDF

Std_ReturnType MemAcc_RequestLock(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType address, MemAcc_AddressType length, void* lockNotificationFctPtr);

Request lock of an address area for exclusive access. Once the lock is granted, the referenced lock notification function is called by MemAcc.

function MemAcc_ReleaseLock [SWS_MemAcc_10031] 📄 PDF

Std_ReturnType MemAcc_ReleaseLock(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType address, MemAcc_LengthType length);

Release access lock of provided address area. Tags: atp.Status=draft

function <ApplicationLockNotification> [SWS_MemAcc_10032] 📄 PDF

void <ApplicationLockNotification>(void);

Address area lock application callback. The function name is configurable. Tags: atp.Status=draft

function MemAcc_ActivateMem [SWS_MemAcc_10033] 📄 PDF

Std_ReturnType MemAcc_ActivateMem(MemAcc_AddressType headerAddress, MemAcc_HwIdType hwId);

Dynamic activation and initialization of a Mem driver referenced by hwId and headerAddress.

function MemAcc_DeactivateMem [SWS_MemAcc_10034] 📄 PDF

Std_ReturnType MemAcc_DeactivateMem(MemAcc_HwIdType hwId, MemAcc_AddressType headerAddress);

Dynamic deactivation of a Mem driver referenced by hwId and headerAddress.

function MemAcc_GetJobStatus [SWS_MemAcc_10040] 📄 PDF

MemAcc_JobStatusType MemAcc_GetJobStatus(MemAcc_AddressAreaIdType addressAreaId);

Returns the status of the MemAcc job referenced by addressAreaId.

function MemAcc_DeInit [SWS_MemAcc_10041] 📄 PDF

void MemAcc_DeInit(void);

Deinitialize module. If there are still access jobs pending, they are immediately terminated and the module state is set to unitialized. Therefore, MemAcc must be re-initialized before it will accept any new job requests after this service is processed.

type MemAcc_HwIdType [SWS_MemAcc_10010] 📄 PDF

Type for the unique numeric identifiers of all Mem hardware instances used for hardware specific requests.

type MemAcc_MemoryInfoType [SWS_MemAcc_10012] 📄 PDF

This structure contains information of Mem device characteristics. It can be accessed via the MemAcc_GetMemoryInfo() service. Tags: atp.Status=draft

type MemAcc_JobInfoType [SWS_MemAcc_10013] 📄 PDF

This structure contains information the current processing state of the MemAcc module.

type MemAcc_MemBinaryHeaderType [SWS_MemAcc_10014] 📄 PDF

This structure contains elements for accessing the Mem driver service functions and consistency information. Tags: atp.Status=draft

type MemAcc_MemInitFuncType [SWS_MemAcc_91000] 📄 PDF

Function pointer for the Mem_Init service for the invocation of the Mem driver API via function pointer interface.

type MemAcc_MemMainFuncType [SWS_MemAcc_91001] 📄 PDF

Function pointer for the Mem_MainFunction service for the invocation of the Mem driver API via function pointer interface.

type MemAcc_MemGetJobResultFuncType [SWS_MemAcc_91002] 📄 PDF

Function pointer for the Mem_JobResultType service for the invocation of the Mem driver API via function pointer interface.

type MemAcc_MemReadFuncType [SWS_MemAcc_91003] 📄 PDF

Function pointer for the Mem_Read service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemWriteFuncType [SWS_MemAcc_91004] 📄 PDF

Function pointer for the Mem_Write service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemEraseFuncType [SWS_MemAcc_91005] 📄 PDF

Function pointer for the Mem_Erase service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemPropagateErrorFuncType [SWS_MemAcc_91006] 📄 PDF

Function pointer for the Mem_PropagateError service for the invocation of the Mem driver API via function pointer interface.

type MemAcc_MemBlankCheckFuncType [SWS_MemAcc_91007] 📄 PDF

Function pointer for the Mem_BlankCheck service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemSuspendFuncType [SWS_MemAcc_91008] 📄 PDF

Function pointer for the Mem_Suspend service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemResumeFuncType [SWS_MemAcc_91009] 📄 PDF

Function pointer for the Mem_Resume service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemHwSpecificServiceFuncType [SWS_MemAcc_91010] 📄 PDF

Function pointer for the Mem_HwSpecificService function for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

type MemAcc_MemDeInitFuncType [SWS_MemAcc_91018] 📄 PDF

Function pointer for the Mem_DeInit service for the invocation of the Mem driver API via function pointer interface.

type MemAcc_ApplicationLockNotificationType [SWS_MemAcc_91021] 📄 PDF

Type of the function pointer to register an application callback to be notified once the address area lock was successfully acquired.

requirement SWS_MemAcc_00002 [SWS_MemAcc_00002] 📄 PDF

The MemAcc module shall check static configuration param- eters statically (at the latest during compile time) for correctness.

requirement SWS_MemAcc_00003 [SWS_MemAcc_00003] 📄 PDF

The MemAcc module shall split memory access requests for the Mem driver layer according to page/page burst, respectively sector/sector burst sizes.

requirement SWS_MemAcc_00004 [SWS_MemAcc_00004] 📄 PDF

In case the start address or the length of a memory request is not aligned to the physical segmentation of the respective memory device, MemAcc shall reject such job requests with E_NOT_OK .

requirement SWS_MemAcc_00005 [SWS_MemAcc_00005] 📄 PDF

If MemAccNumberOfEraseRetries is set to a value > 0, MemAcc shall retry the Mem driver erase operation according to the configured value if the Mem driver erase operation resulted in MEM_JOB_FAILED .

requirement SWS_MemAcc_00006 [SWS_MemAcc_00006] 📄 PDF

The MemAcc module shall coordinate conflicting memory accesses by multiple upper layers.

requirement SWS_MemAcc_00007 [SWS_MemAcc_00007] 📄 PDF

{DRAFT} The MemAcc module shall only coordinate conflict- ing resource accesses. The access dependencies shall be configurable in the config- uration tool.

requirement SWS_MemAcc_00008 [SWS_MemAcc_00008] 📄 PDF

The MemAcc module shall support multiple memory access requests from different upper layers for distinct memory areas at the same time. In case there is a hardware resource conflict, the memory stack shall still accept the access request and process it once the resource is free.

requirement SWS_MemAcc_00012 [SWS_MemAcc_00012] 📄 PDF

All MemAcc services, i.e. erase, read and write, shall sup- port access requests which cross memory device boundaries based on the logical/- physical memory mapping.

requirement SWS_MemAcc_00014 [SWS_MemAcc_00014] 📄 PDF

Based on MemAccAddressAreaPriority , MemAcc shall prioritize memory access requests from AUTOSAR BSW upper layer modules.

requirement SWS_MemAcc_00015 [SWS_MemAcc_00015] 📄 PDF

If a job end notification function is configured by MemAc- cJobEndNotificationName , MemAcc shall notify the upper layer BSW module by calling the configured notification function.

requirement SWS_MemAcc_00017 [SWS_MemAcc_00017] 📄 PDF

If the MemAcc module is not able to process a job request, e.g. due to a pending request on the same address area or due to an invalid parameter, the job request shall be rejected by an E_NOT_OK return code.

requirement SWS_MemAcc_00020 [SWS_MemAcc_00020] 📄 PDF

Once a job request was accepted, the job processing status shall be set to MEMACC_JOB_PENDING .

requirement SWS_MemAcc_00021 [SWS_MemAcc_00021] 📄 PDF

In case the last memory operation was canceled, the job result shall be set to MEMACC_MEM_CANCELED .

requirement SWS_MemAcc_00024 [SWS_MemAcc_00024] 📄 PDF

The prioritization of memory operations shall use the Mem_Suspend and Mem_Resume service if the memory hardware supports this func- tionality. If the memory hardware does not support a suspend/resume functionality, the prior- itization shall be implemented on a page/page burst, respectively sector/sector burst basis.

requirement SWS_MemAcc_00025 [SWS_MemAcc_00025] 📄 PDF

The service MemAcc_Init shall initialize the MemAcc mod- ule internal states. If MemAccMemInvocation is set to INDIRECT_DYNAMIC or INDIRECT_STATIC , MemAcc_Init shall also initialize all available Mem drivers by calling the Mem driver's individual initialization functions.

requirement SWS_MemAcc_00027 [SWS_MemAcc_00027] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetVersionInfo shall raise the development error MEMACC_E_PARAM_POINTER if the argument is a NULL pointer.

requirement SWS_MemAcc_00028 [SWS_MemAcc_00028] 📄 PDF

When the MemAcc_Cancel service is called by an upper layer, the MemAcc module shall wait for the completion of a pending Mem job and stop further processing of the current MemAcc job.

requirement SWS_MemAcc_00029 [SWS_MemAcc_00029] 📄 PDF

In case no MemAcc job is pending, the MemAcc_Cancel service shall just return without any further action, i.e., the result of the last MemAcc job shall not be affected.

requirement SWS_MemAcc_00030 [SWS_MemAcc_00030] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Cancel shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Cancel shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00031 [SWS_MemAcc_00031] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Cancel shall check that the provided addres- sAreaId is consistent with the configuration. If this check fails, MemAcc_Cancel shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00033 [SWS_MemAcc_00033] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetJobResult shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetJobResult shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00034 [SWS_MemAcc_00034] 📄 PDF

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_GetJobResult shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetJobResult shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00035 [SWS_MemAcc_00035] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetMemoryInfo shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetMemoryInfo shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00036 [SWS_MemAcc_00036] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_GetMemoryInfo shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetMemoryInfo shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00037 [SWS_MemAcc_00037] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetMemoryInfo shall raise the development er- ror MEMACC_E_PARAM_POINTER if the memoryInfoPtr argument is a NULL pointer.

requirement SWS_MemAcc_00038 [SWS_MemAcc_00038] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_GetProcessedLength shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetProcess- edLength shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00039 [SWS_MemAcc_00039] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_GetProcessedLength shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetProcessedLength shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00040 [SWS_MemAcc_00040] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_GetJobInfo shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetJobInfo shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00041 [SWS_MemAcc_00041] 📄 PDF

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_GetJobInfo shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetJobInfo shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00042 [SWS_MemAcc_00042] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetJobInfo shall raise the development error MEMACC_E_PARAM_POINTER if the memoryInfoPtr argument is a NULL pointer.

requirement SWS_MemAcc_00043 [SWS_MemAcc_00043] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Read shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Read shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00044 [SWS_MemAcc_00044] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Read shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00045 [SWS_MemAcc_00045] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall raise the development error MEMACC_E_PARAM_POINTER if the destinationDataPtr argument is a NULL pointer.

requirement SWS_MemAcc_00046 [SWS_MemAcc_00046] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by sourceAd- dress and length is invalid, i.e. not aligned to MemReadPageSize or exceeds the configured area.

requirement SWS_MemAcc_00047 [SWS_MemAcc_00047] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

requirement SWS_MemAcc_00048 [SWS_MemAcc_00048] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Write shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Write shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00049 [SWS_MemAcc_00049] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Write shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Write shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00050 [SWS_MemAcc_00050] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Write shall raise the development error MEMACC_E_PARAM_POINTER if the sourceDataPtr argument is a NULL pointer.

requirement SWS_MemAcc_00051 [SWS_MemAcc_00051] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Write shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by targetAd- dress and length is invalid, i.e. not aligned to MemWritePageSize or exceeds the configured area.

requirement SWS_MemAcc_00052 [SWS_MemAcc_00052] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Write shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

requirement SWS_MemAcc_00053 [SWS_MemAcc_00053] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Erase shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Erase shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00054 [SWS_MemAcc_00054] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Erase shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Erase shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00055 [SWS_MemAcc_00055] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Erase shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by targetAd- dress and length is invalid, i.e. not aligned to MemEraseSectorSize or exceeds the configured area.

requirement SWS_MemAcc_00056 [SWS_MemAcc_00056] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Erase shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

requirement SWS_MemAcc_00057 [SWS_MemAcc_00057] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Compare shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Compare shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00058 [SWS_MemAcc_00058] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Compare shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Compare shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00059 [SWS_MemAcc_00059] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Compare shall raise the development error MEMACC_E_PARAM_POINTER if the dataPtr argument is a NULL pointer.

requirement SWS_MemAcc_00060 [SWS_MemAcc_00060] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Compare shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by sourceAddress and length is invalid, i.e. not aligned to MemReadPageSize .

requirement SWS_MemAcc_00061 [SWS_MemAcc_00061] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Compare shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

requirement SWS_MemAcc_00062 [SWS_MemAcc_00062] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_BlankCheck shall check that the MemAcc module has been initialized. If this check fails, MemAcc_BlankCheck shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00063 [SWS_MemAcc_00063] 📄 PDF

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_BlankCheck shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_BlankCheck shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00064 [SWS_MemAcc_00064] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_BlankCheck shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by sourceAd- dress and length is invalid, i.e. not aligned to MemReadPageSize .

requirement SWS_MemAcc_00065 [SWS_MemAcc_00065] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_BlankCheck shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

requirement SWS_MemAcc_00066 [SWS_MemAcc_00066] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_HwSpecificService shall check that the MemAcc module has been initialized. If this check fails, MemAcc_HwSpecificSer- vice shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00067 [SWS_MemAcc_00067] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_HwSpecificService shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_HwSpecificService shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00068 [SWS_MemAcc_00068] 📄 PDF

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_HwSpecificService shall raise the development error MEMACC_E_PARAM_HW_ID if the Mem driver hardware identifi- cation given by hwId is invalid or not assigned to the passed addressAreaId .

requirement SWS_MemAcc_00070 [SWS_MemAcc_00070] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_HwSpecificService shall raise the develop- ment error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

requirement SWS_MemAcc_00071 [SWS_MemAcc_00071] 📄 PDF

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_RequestLock shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_RequestLock shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00072 [SWS_MemAcc_00072] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_RequestLock shall raise the development error MEMACC_E_PARAM_POINTER if the lockNotificationFctPtr argument is a NULL pointer.

requirement SWS_MemAcc_00073 [SWS_MemAcc_00073] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_RequestLock shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by address and length is invalid, i.e. not mapped to a specific Mem driver.

requirement SWS_MemAcc_00076 [SWS_MemAcc_00076] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_ReleaseLock shall check that the MemAcc module has been initialized. If this check fails, MemAcc_ReleaseLock shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00077 [SWS_MemAcc_00077] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_ReleaseLock shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by address and length is invalid, i.e. not mapped to a specific Mem driver.

requirement SWS_MemAcc_00080 [SWS_MemAcc_00080] 📄 PDF

Start address and length of address areas shall be aligned to the physical sectors.

requirement SWS_MemAcc_00081 [SWS_MemAcc_00081] 📄 PDF

The MemAcc module shall support address areas larger than 4GBytes, thus MemAcc_AddressType and MemAcc_LengthType shall be defined as a 64-Bit types in case the address area configuration of one address area exceeds 4GBytes.

requirement SWS_MemAcc_00082 [SWS_MemAcc_00082] 📄 PDF

If all address areas don't exceed 4GBytes, MemAcc_Ad- dressType and MemAcc_LengthType shall be defined as a 32-Bit types.

requirement SWS_MemAcc_00084 [SWS_MemAcc_00084] 📄 PDF

If MemAccMemInvocation is set to INDIRECT_DYNAMIC or INDIRECT_STATIC , MemAcc shall call all Mem main functions within MemAcc_- MainFunction . MemAcc_MainFunction shall only call the Mem main function if there is a job request pending for the corresponding Mem driver.

requirement SWS_MemAcc_00085 [SWS_MemAcc_00085] 📄 PDF

If enabled by MemAccUseMemFuncPtrTable , MemAcc shall call the Mem driver service functions via the Mem driver function pointer table. Otherwise the MemAcc shall directly call the Mem driver service functions.

requirement SWS_MemAcc_00087 [SWS_MemAcc_00087] 📄 PDF

If enabled by MemAccUseEraseBurst , MemAcc shall align and split the Mem driver erase requests according to the erase burst size of the Mem driver.

requirement SWS_MemAcc_00088 [SWS_MemAcc_00088] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_ActivateMem shall check that the MemAcc module has been initialized. If this check fails, MemAcc_ActivateMem shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00089 [SWS_MemAcc_00089] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_ActivateMem shall ensure the validity of the Mem driver binary by checks in the following sequence: 1. Comparing the header address field with the start address of the Mem driver binary (if the Mem driver was not compiled as a relocatable binary) 2. Unique ID validity 3. Availability and consistency of the delimiter field If any of these checks fails MemAcc_ActivateMem shall raise the development error MEMACC_E_MEM_INIT_FAILED .

requirement SWS_MemAcc_00090 [SWS_MemAcc_00090] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_DeactivateMem shall check that the MemAcc module has been initialized. If this check fails, MemAcc_DeactivateMem shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00092 [SWS_MemAcc_00092] 📄 PDF

The service MemAcc_GetJobResult shall return the con- solidated result of the last MemAcc job.

requirement SWS_MemAcc_00093 [SWS_MemAcc_00093] 📄 PDF

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_ReleaseLock shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_ReleaseLock shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_00099 [SWS_MemAcc_00099] 📄 PDF

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_RequestLock shall check that the MemAcc module has been initialized. If this check fails, MemAcc_RequestLock shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00100 [SWS_MemAcc_00100] 📄 PDF

If MemAccNumberOfWriteRetries is set to a value > 0, MemAcc shall retry the Mem driver write operation according to the configured value if the Mem driver write operation resulted in MEM_JOB_FAILED .

requirement SWS_MemAcc_00101 [SWS_MemAcc_00101] 📄 PDF

If enabled by MemAccUseReadBurst , MemAcc shall align and split the Mem driver read requests according to the read burst size of the Mem driver.

requirement SWS_MemAcc_00102 [SWS_MemAcc_00102] 📄 PDF

If enabled by MemAccUseWriteBurst , MemAcc shall align and split the Mem driver write requests according to the write burst size of the Mem driver.

requirement SWS_MemAcc_00104 [SWS_MemAcc_00104] 📄 PDF

In case the job processing was completed or no job is currently pending, the job processing status shall be set to MEMACC_JOB_IDLE .

requirement SWS_MemAcc_00105 [SWS_MemAcc_00105] 📄 PDF

In case the job processing was completed successfully, the job result shall be set to MEMACC_MEM_OK .

requirement SWS_MemAcc_00106 [SWS_MemAcc_00106] 📄 PDF

In case the job processing was completed but the re- sults of the last MemAcc 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 MEMACC_MEM_INCONSISTENT .

requirement SWS_MemAcc_00107 [SWS_MemAcc_00107] 📄 PDF

In case the last memory operation was completed but the ECC circuit corrected an ECC error, the job result shall be set to MEMACC_MEM_ECC_CORRECTED .

requirement SWS_MemAcc_00108 [SWS_MemAcc_00108] 📄 PDF

In case the last memory operation didn't com- plete due to an uncorrectable ECC error, the job result shall be set to MEMACC_MEM_ECC_UNCORRECTED .

requirement SWS_MemAcc_00109 [SWS_MemAcc_00109] 📄 PDF

In case the memory operation was not successfully com- pleted for any other reason, the job result shall be set to MEMACC_MEM_FAILED .

requirement SWS_MemAcc_00111 [SWS_MemAcc_00111] 📄 PDF

The service MemAcc_DeInit shall de-initialize the MemAcc module internal states. If MemAccMemInvocation is set to INDIRECT_DYNAMIC or INDIRECT_STATIC , MemAcc_DeInit shall also de-initialize all available Mem drivers by calling the Mem driver's individual de-initialization functions.

requirement SWS_MemAcc_00112 [SWS_MemAcc_00112] 📄 PDF

After initialization via the MemAcc_Init service, the job result shall be set to MEMACC_MEM_OK .

requirement SWS_MemAcc_00113 [SWS_MemAcc_00113] 📄 PDF

After initialization via the MemAcc_Init service, the job precessing status shall be set to MEMACC_JOB_IDLE .

requirement SWS_MemAcc_00114 [SWS_MemAcc_00114] 📄 PDF

If the compare operation determined a mismatch, the result code returned by the MemAcc_GetJobResult service shall be set to MEMACC_MEM_INCONSISTENT , otherwise MemAcc_GetJobResult shall return MEMACC_MEM_OK .

requirement SWS_MemAcc_00115 [SWS_MemAcc_00115] 📄 PDF

MemAcc_RequestLock shall lock all memory accesses of the Mem driver referenced by the addressAreaId , address and length parameter. If an upper layer calls a MemAcc service function for an address area which is locked for direct memory access, MemAcc shall still accept the memory access request for the address area but shall not forward the access request to the corresponding Mem driver until the lock request is released by the MemAcc_ReleaseLock service.

requirement SWS_MemAcc_00116 [SWS_MemAcc_00116] 📄 PDF

MemAcc shall wait until the address area referenced by addressAreaId is idle before it calls the lock notification function referenced by lockNotificationFctPtr to notify the upper layer module that the lock of the address area was successfully acquired.

requirement SWS_MemAcc_00117 [SWS_MemAcc_00117] 📄 PDF

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetJobStatus shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetJobStatus shall raise the development error MEMACC_E_UNINIT .

requirement SWS_MemAcc_00118 [SWS_MemAcc_00118] 📄 PDF

The service MemAcc_GetJobStatus shall return MEMACC_JOB_IDLE for the referenced addressAreaId if MemAcc is not pro- cessing a job request.

requirement SWS_MemAcc_00119 [SWS_MemAcc_00119] 📄 PDF

The service MemAcc_GetJobStatus shall return MEMACC_JOB_PENDING for the referenced addressAreaId if MemAcc is cur- rently processing a job request.

requirement SWS_MemAcc_00120 [SWS_MemAcc_00120] 📄 PDF

The service MemAcc_GetProcessedLength shall return the processed length of the current MemAcc job referenced by addressAreaId . If the job finished successfully, MemAcc_GetProcessedLength shall return the requested job length of the finished job until a new MemAcc job request is received for the referenced addressAreaId .

requirement SWS_MemAcc_00121 [SWS_MemAcc_00121] 📄 PDF

If MemAccMemInvocation is set to INDIRECT_DYNAMIC , the service MemAcc_ActivateMem shall initialize the Mem driver referenced by hwId and headerAddress and update the internal driver activation state.

requirement SWS_MemAcc_00122 [SWS_MemAcc_00122] 📄 PDF

If MemAccMemInvocation is set to INDIRECT_DYNAMIC , the service MemAcc_DeactivateMem shall de-initialize the Mem driver referenced by hwId and headerAddress and update the internal driver activation state.

requirement SWS_MemAcc_00123 [SWS_MemAcc_00123] 📄 PDF

In case a MemAcc job is still pending, the service MemAcc_DeactivateMem shall return E_NOT_OK without any further action.

requirement SWS_MemAcc_00124 [SWS_MemAcc_00124] 📄 PDF

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_GetJobStatus shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetJobStatus shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

requirement SWS_MemAcc_10036 [SWS_MemAcc_10036] 📄 PDF

Mem_BlankCheck Mem.h 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_GetJob Result 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. Mem_Erase Mem.h 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. Mem_GetJobResult Mem.h Service to return results of the most recent job. Mem_HwSpecificService (draft) Mem.h 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_GetJob Result 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 Mem_Init Mem.h Initialization function - initializes all variables and sets the module state to initialized. Mem_MainFunction Mem.h Service to handle the requested jobs and the internal management operations. Mem_PropagateError Mem.h 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.. Mem_Read Mem.h 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. Mem_Write Mem.h 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.

requirement SWS_MemAcc_10037 [SWS_MemAcc_10037] 📄 PDF

Module Header File Imported Type Mem.h Mem_AddressType Mem.h Mem_ConfigType Mem.h Mem_DataType Mem.h Mem_HwServiceIdType Mem.h Mem_InstanceIdType Mem.h Mem_JobResultType Mem Mem.h Mem_LengthType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

requirement SWS_MemAcc_10038 [SWS_MemAcc_10038] 📄 PDF

Type of error Related error code Error value API service called without module initialization MEMACC_E_UNINIT 0x01 API service called with NULL pointer argument MEMACC_E_PARAM_POINTER 0x02 API service called with wrong address area ID MEMACC_E_PARAM_ADDRESS_AREA_ID 0x03 API service called with address and length not belonging to the passed address area ID MEMACC_E_PARAM_ADDRESS_LENGTH 0x04 API service called with a hardware ID not belonging to the passed address area ID MEMACC_E_PARAM_HW_ID 0x05 API service called for an address area ID with a pending job request MEMACC_E_BUSY 0x06 Dynamic MEM driver activation failed due to inconsistent MEM driver binary MEMACC_E_MEM_INIT_FAILED 0x07

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

Record
AUTOSAR/AP/record/CP_MOD_MemAcc
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_MemAcc@rel:R20-11#2e14b966
Content hash
2e14b966
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_MemoryAccess.pdf#nameddest=SWS_MemAcc_10015

Topic map

Requirements

107
SWS_MemAcc_00002SWS_MemAcc_00003SWS_MemAcc_00004SWS_MemAcc_00005SWS_MemAcc_00006SWS_MemAcc_00007SWS_MemAcc_00008SWS_MemAcc_00012SWS_MemAcc_00014SWS_MemAcc_00015SWS_MemAcc_00017SWS_MemAcc_00018SWS_MemAcc_00020SWS_MemAcc_00021SWS_MemAcc_00024SWS_MemAcc_00025SWS_MemAcc_00027SWS_MemAcc_00028SWS_MemAcc_00029SWS_MemAcc_00030SWS_MemAcc_00031SWS_MemAcc_00033SWS_MemAcc_00034SWS_MemAcc_00035SWS_MemAcc_00036SWS_MemAcc_00037SWS_MemAcc_00038SWS_MemAcc_00039SWS_MemAcc_00040SWS_MemAcc_00041SWS_MemAcc_00042SWS_MemAcc_00043SWS_MemAcc_00044SWS_MemAcc_00045SWS_MemAcc_00046SWS_MemAcc_00047SWS_MemAcc_00048SWS_MemAcc_00049SWS_MemAcc_00050SWS_MemAcc_00051SWS_MemAcc_00052SWS_MemAcc_00053SWS_MemAcc_00054SWS_MemAcc_00055SWS_MemAcc_00056SWS_MemAcc_00057SWS_MemAcc_00058SWS_MemAcc_00059SWS_MemAcc_00060SWS_MemAcc_00061SWS_MemAcc_00062SWS_MemAcc_00063SWS_MemAcc_00064SWS_MemAcc_00065SWS_MemAcc_00066SWS_MemAcc_00067SWS_MemAcc_00068SWS_MemAcc_00070SWS_MemAcc_00071SWS_MemAcc_00072SWS_MemAcc_00073SWS_MemAcc_00076SWS_MemAcc_00077SWS_MemAcc_00078SWS_MemAcc_00079SWS_MemAcc_00080SWS_MemAcc_00081SWS_MemAcc_00082SWS_MemAcc_00083SWS_MemAcc_00084SWS_MemAcc_00085SWS_MemAcc_00087SWS_MemAcc_00088SWS_MemAcc_00089SWS_MemAcc_00090SWS_MemAcc_00092SWS_MemAcc_00093SWS_MemAcc_00098SWS_MemAcc_00099SWS_MemAcc_00100SWS_MemAcc_00101SWS_MemAcc_00102SWS_MemAcc_00104SWS_MemAcc_00105SWS_MemAcc_00106SWS_MemAcc_00107SWS_MemAcc_00108SWS_MemAcc_00109SWS_MemAcc_00111SWS_MemAcc_00112SWS_MemAcc_00113SWS_MemAcc_00114SWS_MemAcc_00115SWS_MemAcc_00116SWS_MemAcc_00117SWS_MemAcc_00118SWS_MemAcc_00119SWS_MemAcc_00120SWS_MemAcc_00121SWS_MemAcc_00122SWS_MemAcc_00123SWS_MemAcc_00124SWS_MemAcc_10035SWS_MemAcc_10036SWS_MemAcc_10037SWS_MemAcc_10038SWS_MemAcc_91022

Detail view

Select an entry in the outline.

Initialization and status

MemAcc_DeInit function

Deinitialize module. If there are still access jobs pending, they are immediately terminated and the module state is set to unitialized. Therefore, MemAcc must be re-initialized before it will accept any new job requests after this service is processed.

void MemAcc_DeInit(void);

Service to return the version information of the MemAcc module.

void MemAcc_GetVersionInfo(Std_VersionInfoType* versionInfoPtr);
MemAcc_Init function

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

void MemAcc_Init(const MemAcc_ConfigType* configPtr);

Services

Dynamic activation and initialization of a Mem driver referenced by hwId and headerAddress.

Std_ReturnType MemAcc_ActivateMem(MemAcc_AddressType headerAddress, MemAcc_HwIdType hwId);

Checks if the passed address space is blank, i.e. erased and writeable. The result of this service can be retrieved using the MemAcc_GetJobResult API. If the address area defined by targetAddress and length is blank, the result is MEMACC_MEM_OK, otherwise the result is MEMACC_MEM_INCONSISTENT.

Std_ReturnType MemAcc_BlankCheck(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType targetAddress, MemAcc_LengthType length);
MemAcc_Cancel function

Triggers a cancel operation of the pending job for the address area referenced by the address AreaId. Cancelling affects only jobs in pending state. For any other states, the request will be ignored.

void MemAcc_Cancel(MemAcc_AddressAreaIdType addressAreaId);

Triggers a job to compare the passed data to the memory content of the provided address area. The job terminates, if all bytes matched or a difference was detected. The result of this service can be retrieved using the MemAcc_GetJobResult() API. If the compare operation determined a mismatch, the result code is MEMACC_MEM_INCONSISTENT. Tags: atp.Status=draft

Std_ReturnType MemAcc_Compare(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType sourceAddress, const MemAcc_DataType* dataPtr, MemAcc_LengthType length);

Dynamic deactivation of a Mem driver referenced by hwId and headerAddress.

Std_ReturnType MemAcc_DeactivateMem(MemAcc_HwIdType hwId, MemAcc_AddressType headerAddress);
MemAcc_Erase function

Triggers an erase job of the given area. Triggers an erase job of the given area 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 MemAcc_Erase(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType targetAddress, MemAcc_LengthType length);

Returns detailed information of the current memory job like memory device ID, job type, job processing state or job result, address area as well as address and length.

void MemAcc_GetJobInfo(MemAcc_AddressAreaIdType addressAreaId, MemAcc_JobInfoType* jobInfoPtr);

Returns the consolidated job result of the address area referenced by addressAreaId.

MemAcc_JobResultType MemAcc_GetJobResult(MemAcc_AddressAreaIdType addressAreaId);

Returns the status of the MemAcc job referenced by addressAreaId.

MemAcc_JobStatusType MemAcc_GetJobStatus(MemAcc_AddressAreaIdType addressAreaId);

This service function retrieves the physical memory device information of a specific address area. It can be used by an upper layer to get all necessary information to align the start address and trim the length for erase/write jobs.

Std_ReturnType MemAcc_GetMemoryInfo(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType address, MemAcc_MemoryInfoType* memoryInfoPtr);

Returns the accumulated number of bytes that have already been processed in the current job.

MemAcc_LengthType MemAcc_GetProcessedLength(MemAcc_AddressAreaIdType addressAreaId);

Triggers a hardware specific job request referenced by hwServiceId. Service specific data can be passed/retrieved by dataPtr. The result of this service can be retrieved using the MemAcc_GetJobResult API. If the hardware specific operation was successful, the result of the job is MEMACC_MEM_OK. If the hardware specific operation failed, the result of the job is MEMACC_MEM_FAILED.

Std_ReturnType MemAcc_HwSpecificService(MemAcc_AddressAreaIdType addressAreaId, MemAcc_HwIdType hwId, MemAcc_MemHwServiceIdType hwServiceId, MemAcc_DataType* dataPtr, MemAcc_LengthType* lengthPtr);
MemAcc_Read function

Triggers a read job to copy data from the source address into the referenced destination data buffer. The result of this service can be retrieved using the MemAcc_GetJobResult API. If the read operation was successful, the result of the job is MEMACC_MEM_OK. If the read operation failed, the result of the job is either MEMACC_MEM_FAILED in case of a general error or MEMACC_MEM_ECC_CORRECTED/MEMACC_MEM_ECC_UNCORRECTED in case of a correctable/uncorrectable ECC error.

Std_ReturnType MemAcc_Read(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType sourceAddress, MemAcc_DataType* destinationDataPtr, MemAcc_LengthType length);

Release access lock of provided address area. Tags: atp.Status=draft

Std_ReturnType MemAcc_ReleaseLock(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType address, MemAcc_LengthType length);

Request lock of an address area for exclusive access. Once the lock is granted, the referenced lock notification function is called by MemAcc.

Std_ReturnType MemAcc_RequestLock(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType address, MemAcc_AddressType length, void* lockNotificationFctPtr);
MemAcc_Write function

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 MemAcc_GetJobResult API. If the write operation was successful, the job result is MEMACC_MEM_OK. If there was an issue writing the data, the result is MEMACC_MEM_FAILED.

Std_ReturnType MemAcc_Write(MemAcc_AddressAreaIdType addressAreaId, MemAcc_AddressType targetAddress, const MemAcc_DataType* sourceDataPtr, MemAcc_LengthType length);

Callouts and expected interfaces

MemAcc application job end notification callback. The function name is configurable. Tags: atp.Status=draft

void <AddressAreaJobEndNotification>(MemAcc_AddressAreaIdType addressAreaId, MemAcc_JobResultType jobResult);

Address area lock application callback. The function name is configurable. Tags: atp.Status=draft

void <ApplicationLockNotification>(void);

Cyclic

Service to handle the requested jobs and the internal management operations. Depending on the configuration MemAcc will call the Mem driver main functions.

void MemAcc_MainFunction(void);

Types

Unique address area ID type.

Logical memory address type.

Type of the function pointer to register an application callback to be notified once the address area lock was successfully acquired.

Postbuild configuration structure type.

General data type.

Type for the unique numeric identifiers of all Mem hardware instances used for hardware specific requests.

This structure contains information the current processing state of the MemAcc module.

Asynchronous job result type.

Asynchronous job status type.

Type for asynchronous jobs.

Job length type.

Physical memory device address type

This structure contains elements for accessing the Mem driver service functions and consistency information. Tags: atp.Status=draft

Function pointer for the Mem_BlankCheck service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Memory driver configuration structure type

General data type

Function pointer for the Mem_DeInit service for the invocation of the Mem driver API via function pointer interface.

Function pointer for the Mem_Erase service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Function pointer for the Mem_JobResultType service for the invocation of the Mem driver API via function pointer interface.

Index type for Mem driver hardware specific service table.

Function pointer for the Mem_HwSpecificService function for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Function pointer for the Mem_Init service for the invocation of the Mem driver API via function pointer interface.

Memory driver instance ID type

Asynchronous job result type

Physical memory device length type

Function pointer for the Mem_MainFunction service for the invocation of the Mem driver API via function pointer interface.

This structure contains information of Mem device characteristics. It can be accessed via the MemAcc_GetMemoryInfo() service. Tags: atp.Status=draft

Function pointer for the Mem_PropagateError service for the invocation of the Mem driver API via function pointer interface.

Function pointer for the Mem_Read service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Function pointer for the Mem_Resume service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Function pointer for the Mem_Suspend service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Function pointer for the Mem_Write service for the invocation of the Mem driver API via function pointer interface. Tags: atp.Status=draft

Requirements

SWS_MemAcc_00002 requirement

The MemAcc module shall check static configuration param- eters statically (at the latest during compile time) for correctness.

SWS_MemAcc_00003 requirement

The MemAcc module shall split memory access requests for the Mem driver layer according to page/page burst, respectively sector/sector burst sizes.

SWS_MemAcc_00004 requirement

In case the start address or the length of a memory request is not aligned to the physical segmentation of the respective memory device, MemAcc shall reject such job requests with E_NOT_OK .

SWS_MemAcc_00005 requirement

If MemAccNumberOfEraseRetries is set to a value > 0, MemAcc shall retry the Mem driver erase operation according to the configured value if the Mem driver erase operation resulted in MEM_JOB_FAILED .

SWS_MemAcc_00006 requirement

The MemAcc module shall coordinate conflicting memory accesses by multiple upper layers.

SWS_MemAcc_00007 requirement

{DRAFT} The MemAcc module shall only coordinate conflict- ing resource accesses. The access dependencies shall be configurable in the config- uration tool.

SWS_MemAcc_00008 requirement

The MemAcc module shall support multiple memory access requests from different upper layers for distinct memory areas at the same time. In case there is a hardware resource conflict, the memory stack shall still accept the access request and process it once the resource is free.

SWS_MemAcc_00012 requirement

All MemAcc services, i.e. erase, read and write, shall sup- port access requests which cross memory device boundaries based on the logical/- physical memory mapping.

SWS_MemAcc_00014 requirement

Based on MemAccAddressAreaPriority , MemAcc shall prioritize memory access requests from AUTOSAR BSW upper layer modules.

SWS_MemAcc_00015 requirement

If a job end notification function is configured by MemAc- cJobEndNotificationName , MemAcc shall notify the upper layer BSW module by calling the configured notification function.

SWS_MemAcc_00017 requirement

If the MemAcc module is not able to process a job request, e.g. due to a pending request on the same address area or due to an invalid parameter, the job request shall be rejected by an E_NOT_OK return code.

SWS_MemAcc_00018 requirement

The MemAcc module shall allow only one job request per address area.

SWS_MemAcc_00020 requirement

Once a job request was accepted, the job processing status shall be set to MEMACC_JOB_PENDING .

SWS_MemAcc_00021 requirement

In case the last memory operation was canceled, the job result shall be set to MEMACC_MEM_CANCELED .

SWS_MemAcc_00024 requirement

The prioritization of memory operations shall use the Mem_Suspend and Mem_Resume service if the memory hardware supports this func- tionality. If the memory hardware does not support a suspend/resume functionality, the prior- itization shall be implemented on a page/page burst, respectively sector/sector burst basis.

SWS_MemAcc_00025 requirement

The service MemAcc_Init shall initialize the MemAcc mod- ule internal states. If MemAccMemInvocation is set to INDIRECT_DYNAMIC or INDIRECT_STATIC , MemAcc_Init shall also initialize all available Mem drivers by calling the Mem driver's individual initialization functions.

SWS_MemAcc_00027 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetVersionInfo shall raise the development error MEMACC_E_PARAM_POINTER if the argument is a NULL pointer.

SWS_MemAcc_00028 requirement

When the MemAcc_Cancel service is called by an upper layer, the MemAcc module shall wait for the completion of a pending Mem job and stop further processing of the current MemAcc job.

SWS_MemAcc_00029 requirement

In case no MemAcc job is pending, the MemAcc_Cancel service shall just return without any further action, i.e., the result of the last MemAcc job shall not be affected.

SWS_MemAcc_00030 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Cancel shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Cancel shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00031 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Cancel shall check that the provided addres- sAreaId is consistent with the configuration. If this check fails, MemAcc_Cancel shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00033 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetJobResult shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetJobResult shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00034 requirement

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_GetJobResult shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetJobResult shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00035 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetMemoryInfo shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetMemoryInfo shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00036 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_GetMemoryInfo shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetMemoryInfo shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00037 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetMemoryInfo shall raise the development er- ror MEMACC_E_PARAM_POINTER if the memoryInfoPtr argument is a NULL pointer.

SWS_MemAcc_00038 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_GetProcessedLength shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetProcess- edLength shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00039 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_GetProcessedLength shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetProcessedLength shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00040 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_GetJobInfo shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetJobInfo shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00041 requirement

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_GetJobInfo shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetJobInfo shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00042 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetJobInfo shall raise the development error MEMACC_E_PARAM_POINTER if the memoryInfoPtr argument is a NULL pointer.

SWS_MemAcc_00043 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Read shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Read shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00044 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Read shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00045 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall raise the development error MEMACC_E_PARAM_POINTER if the destinationDataPtr argument is a NULL pointer.

SWS_MemAcc_00046 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by sourceAd- dress and length is invalid, i.e. not aligned to MemReadPageSize or exceeds the configured area.

SWS_MemAcc_00047 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Read shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

SWS_MemAcc_00048 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Write shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Write shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00049 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Write shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Write shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00050 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Write shall raise the development error MEMACC_E_PARAM_POINTER if the sourceDataPtr argument is a NULL pointer.

SWS_MemAcc_00051 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Write shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by targetAd- dress and length is invalid, i.e. not aligned to MemWritePageSize or exceeds the configured area.

SWS_MemAcc_00052 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Write shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

SWS_MemAcc_00053 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Erase shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Erase shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00054 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Erase shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Erase shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00055 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Erase shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by targetAd- dress and length is invalid, i.e. not aligned to MemEraseSectorSize or exceeds the configured area.

SWS_MemAcc_00056 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Erase shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

SWS_MemAcc_00057 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_Compare shall check that the MemAcc module has been initialized. If this check fails, MemAcc_Compare shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00058 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Compare shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_- Compare shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00059 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Compare shall raise the development error MEMACC_E_PARAM_POINTER if the dataPtr argument is a NULL pointer.

SWS_MemAcc_00060 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_Compare shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by sourceAddress and length is invalid, i.e. not aligned to MemReadPageSize .

SWS_MemAcc_00061 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_Compare shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

SWS_MemAcc_00062 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_BlankCheck shall check that the MemAcc module has been initialized. If this check fails, MemAcc_BlankCheck shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00063 requirement

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_BlankCheck shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_BlankCheck shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00064 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_BlankCheck shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by sourceAd- dress and length is invalid, i.e. not aligned to MemReadPageSize .

SWS_MemAcc_00065 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_BlankCheck shall raise the development error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

SWS_MemAcc_00066 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_HwSpecificService shall check that the MemAcc module has been initialized. If this check fails, MemAcc_HwSpecificSer- vice shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00067 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_HwSpecificService shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_HwSpecificService shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00068 requirement

If development error detection is enabled by MemAc- cDevErrorDetect , the service MemAcc_HwSpecificService shall raise the development error MEMACC_E_PARAM_HW_ID if the Mem driver hardware identifi- cation given by hwId is invalid or not assigned to the passed addressAreaId .

SWS_MemAcc_00070 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_HwSpecificService shall raise the develop- ment error MEMACC_E_BUSY if a previous MemAcc job for the same addressAreaId is still being processed.

SWS_MemAcc_00071 requirement

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_RequestLock shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_RequestLock shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00072 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_RequestLock shall raise the development error MEMACC_E_PARAM_POINTER if the lockNotificationFctPtr argument is a NULL pointer.

SWS_MemAcc_00073 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_RequestLock shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by address and length is invalid, i.e. not mapped to a specific Mem driver.

SWS_MemAcc_00076 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_ReleaseLock shall check that the MemAcc module has been initialized. If this check fails, MemAcc_ReleaseLock shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00077 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_ReleaseLock shall raise the development error MEMACC_E_PARAM_ADDRESS_LENGTH if the address range defined by address and length is invalid, i.e. not mapped to a specific Mem driver.

SWS_MemAcc_00078 requirement

An address area shall only be assigned to one upper layer module.

SWS_MemAcc_00079 requirement

Within a sub-address area, only a uniform sector size is allowed.

SWS_MemAcc_00080 requirement

Start address and length of address areas shall be aligned to the physical sectors.

SWS_MemAcc_00081 requirement

The MemAcc module shall support address areas larger than 4GBytes, thus MemAcc_AddressType and MemAcc_LengthType shall be defined as a 64-Bit types in case the address area configuration of one address area exceeds 4GBytes.

SWS_MemAcc_00082 requirement

If all address areas don't exceed 4GBytes, MemAcc_Ad- dressType and MemAcc_LengthType shall be defined as a 32-Bit types.

SWS_MemAcc_00083 requirement

The MemAcc module implementation shall be hardware in- dependent.

SWS_MemAcc_00084 requirement

If MemAccMemInvocation is set to INDIRECT_DYNAMIC or INDIRECT_STATIC , MemAcc shall call all Mem main functions within MemAcc_- MainFunction . MemAcc_MainFunction shall only call the Mem main function if there is a job request pending for the corresponding Mem driver.

SWS_MemAcc_00085 requirement

If enabled by MemAccUseMemFuncPtrTable , MemAcc shall call the Mem driver service functions via the Mem driver function pointer table. Otherwise the MemAcc shall directly call the Mem driver service functions.

SWS_MemAcc_00087 requirement

If enabled by MemAccUseEraseBurst , MemAcc shall align and split the Mem driver erase requests according to the erase burst size of the Mem driver.

SWS_MemAcc_00088 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_ActivateMem shall check that the MemAcc module has been initialized. If this check fails, MemAcc_ActivateMem shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00089 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_ActivateMem shall ensure the validity of the Mem driver binary by checks in the following sequence: 1. Comparing the header address field with the start address of the Mem driver binary (if the Mem driver was not compiled as a relocatable binary) 2. Unique ID validity 3. Availability and consistency of the delimiter field If any of these checks fails MemAcc_ActivateMem shall raise the development error MEMACC_E_MEM_INIT_FAILED .

SWS_MemAcc_00090 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_DeactivateMem shall check that the MemAcc module has been initialized. If this check fails, MemAcc_DeactivateMem shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00092 requirement

The service MemAcc_GetJobResult shall return the con- solidated result of the last MemAcc job.

SWS_MemAcc_00093 requirement

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_ReleaseLock shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_ReleaseLock shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_00098 requirement

The MemAcc module implementation shall support multiple Mem drivers.

SWS_MemAcc_00099 requirement

If development error detection is enabled by MemAccDe- vErrorDetect , the service MemAcc_RequestLock shall check that the MemAcc module has been initialized. If this check fails, MemAcc_RequestLock shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00100 requirement

If MemAccNumberOfWriteRetries is set to a value > 0, MemAcc shall retry the Mem driver write operation according to the configured value if the Mem driver write operation resulted in MEM_JOB_FAILED .

SWS_MemAcc_00101 requirement

If enabled by MemAccUseReadBurst , MemAcc shall align and split the Mem driver read requests according to the read burst size of the Mem driver.

SWS_MemAcc_00102 requirement

If enabled by MemAccUseWriteBurst , MemAcc shall align and split the Mem driver write requests according to the write burst size of the Mem driver.

SWS_MemAcc_00104 requirement

In case the job processing was completed or no job is currently pending, the job processing status shall be set to MEMACC_JOB_IDLE .

SWS_MemAcc_00105 requirement

In case the job processing was completed successfully, the job result shall be set to MEMACC_MEM_OK .

SWS_MemAcc_00106 requirement

In case the job processing was completed but the re- sults of the last MemAcc 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 MEMACC_MEM_INCONSISTENT .

SWS_MemAcc_00107 requirement

In case the last memory operation was completed but the ECC circuit corrected an ECC error, the job result shall be set to MEMACC_MEM_ECC_CORRECTED .

SWS_MemAcc_00108 requirement

In case the last memory operation didn't com- plete due to an uncorrectable ECC error, the job result shall be set to MEMACC_MEM_ECC_UNCORRECTED .

SWS_MemAcc_00109 requirement

In case the memory operation was not successfully com- pleted for any other reason, the job result shall be set to MEMACC_MEM_FAILED .

SWS_MemAcc_00111 requirement

The service MemAcc_DeInit shall de-initialize the MemAcc module internal states. If MemAccMemInvocation is set to INDIRECT_DYNAMIC or INDIRECT_STATIC , MemAcc_DeInit shall also de-initialize all available Mem drivers by calling the Mem driver's individual de-initialization functions.

SWS_MemAcc_00112 requirement

After initialization via the MemAcc_Init service, the job result shall be set to MEMACC_MEM_OK .

SWS_MemAcc_00113 requirement

After initialization via the MemAcc_Init service, the job precessing status shall be set to MEMACC_JOB_IDLE .

SWS_MemAcc_00114 requirement

If the compare operation determined a mismatch, the result code returned by the MemAcc_GetJobResult service shall be set to MEMACC_MEM_INCONSISTENT , otherwise MemAcc_GetJobResult shall return MEMACC_MEM_OK .

SWS_MemAcc_00115 requirement

MemAcc_RequestLock shall lock all memory accesses of the Mem driver referenced by the addressAreaId , address and length parameter. If an upper layer calls a MemAcc service function for an address area which is locked for direct memory access, MemAcc shall still accept the memory access request for the address area but shall not forward the access request to the corresponding Mem driver until the lock request is released by the MemAcc_ReleaseLock service.

SWS_MemAcc_00116 requirement

MemAcc shall wait until the address area referenced by addressAreaId is idle before it calls the lock notification function referenced by lockNotificationFctPtr to notify the upper layer module that the lock of the address area was successfully acquired.

SWS_MemAcc_00117 requirement

If development error detection is enabled by MemAccDev- ErrorDetect , the service MemAcc_GetJobStatus shall check that the MemAcc module has been initialized. If this check fails, MemAcc_GetJobStatus shall raise the development error MEMACC_E_UNINIT .

SWS_MemAcc_00118 requirement

The service MemAcc_GetJobStatus shall return MEMACC_JOB_IDLE for the referenced addressAreaId if MemAcc is not pro- cessing a job request.

SWS_MemAcc_00119 requirement

The service MemAcc_GetJobStatus shall return MEMACC_JOB_PENDING for the referenced addressAreaId if MemAcc is cur- rently processing a job request.

SWS_MemAcc_00120 requirement

The service MemAcc_GetProcessedLength shall return the processed length of the current MemAcc job referenced by addressAreaId . If the job finished successfully, MemAcc_GetProcessedLength shall return the requested job length of the finished job until a new MemAcc job request is received for the referenced addressAreaId .

SWS_MemAcc_00121 requirement

If MemAccMemInvocation is set to INDIRECT_DYNAMIC , the service MemAcc_ActivateMem shall initialize the Mem driver referenced by hwId and headerAddress and update the internal driver activation state.

SWS_MemAcc_00122 requirement

If MemAccMemInvocation is set to INDIRECT_DYNAMIC , the service MemAcc_DeactivateMem shall de-initialize the Mem driver referenced by hwId and headerAddress and update the internal driver activation state.

SWS_MemAcc_00123 requirement

In case a MemAcc job is still pending, the service MemAcc_DeactivateMem shall return E_NOT_OK without any further action.

SWS_MemAcc_00124 requirement

If development error detection is enabled by MemAccDevErrorDetect , the service MemAcc_GetJobStatus shall check that the provided addressAreaId is consistent with the configuration. If this check fails, MemAcc_GetJobStatus shall raise the development error MEMACC_E_PARAM_ADDRESS_AREA_ID .

SWS_MemAcc_10035 requirement

Det_ReportError Det.h Service to report development errors.

SWS_MemAcc_10036 requirement

Mem_BlankCheck Mem.h 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_GetJob Result 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. Mem_Erase Mem.h 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. Mem_GetJobResult Mem.h Service to return results of the most recent job. Mem_HwSpecificService (draft) Mem.h 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_GetJob Result 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 Mem_Init Mem.h Initialization function - initializes all variables and sets the module state to initialized. Mem_MainFunction Mem.h Service to handle the requested jobs and the internal management operations. Mem_PropagateError Mem.h 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.. Mem_Read Mem.h 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. Mem_Write Mem.h 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.

SWS_MemAcc_10037 requirement

Module Header File Imported Type Mem.h Mem_AddressType Mem.h Mem_ConfigType Mem.h Mem_DataType Mem.h Mem_HwServiceIdType Mem.h Mem_InstanceIdType Mem.h Mem_JobResultType Mem Mem.h Mem_LengthType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

SWS_MemAcc_10038 requirement

Type of error Related error code Error value API service called without module initialization MEMACC_E_UNINIT 0x01 API service called with NULL pointer argument MEMACC_E_PARAM_POINTER 0x02 API service called with wrong address area ID MEMACC_E_PARAM_ADDRESS_AREA_ID 0x03 API service called with address and length not belonging to the passed address area ID MEMACC_E_PARAM_ADDRESS_LENGTH 0x04 API service called with a hardware ID not belonging to the passed address area ID MEMACC_E_PARAM_HW_ID 0x05 API service called for an address area ID with a pending job request MEMACC_E_BUSY 0x06 Dynamic MEM driver activation failed due to inconsistent MEM driver binary MEMACC_E_MEM_INIT_FAILED 0x07

SWS_MemAcc_91022 requirement

Overlayed return value of Std_ReturnType for Mem driver API