Autosar Sws Memoryaccess
Autosar Sws Memoryaccess
AUTOSAR CP R22-11
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Contents
1 Introduction and Functional Overview 7
1.1 Supported Use-Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Acronyms and Abbreviations 9
2.1 Physical Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Related Documentation 11
3.1 Input Documents & Related Standards and Norms . . . . . . . . . . . 11
3.2 Related Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Constraints and Assumptions 12
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.1 General Limitations . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.2 Memory Mapped Access . . . . . . . . . . . . . . . . . . . . 12
4.2 Applicability to Car Domains . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Dependencies to Other Modules 13
6 Requirements Tracing 14
7 Functional Specification 19
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.2 Key Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.3 Functional Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.3.1 Memory Address Translation . . . . . . . . . . . . . . . . . . 19
7.3.1.1 Memory Mapping Constraints . . . . . . . . . . . . . 20
7.3.2 Memory Access Coordination . . . . . . . . . . . . . . . . . 21
7.3.3 Job Management . . . . . . . . . . . . . . . . . . . . . . . . 21
7.3.4 Job Processing . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.3.4.1 Job Status . . . . . . . . . . . . . . . . . . . . . . . . 22
7.3.4.2 Job Result . . . . . . . . . . . . . . . . . . . . . . . . 22
7.3.5 Hardware Specific Services . . . . . . . . . . . . . . . . . . . 23
7.3.6 Burst Mode Support . . . . . . . . . . . . . . . . . . . . . . . 23
7.3.7 Generic Locking Mechanism . . . . . . . . . . . . . . . . . . 24
7.3.8 Dynamic Memory Driver Handling . . . . . . . . . . . . . . . 24
7.3.8.1 Dynamic Memory Driver Activation . . . . . . . . . . 25
7.3.8.2 Service Invocation . . . . . . . . . . . . . . . . . . . 25
7.4 Module Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.4.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.4.2 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.5 General Design Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.5.1 Retry Mechanism . . . . . . . . . . . . . . . . . . . . . . . . 26
7.5.2 Address Alignment . . . . . . . . . . . . . . . . . . . . . . . . 26
7.5.3 64-Bit Support . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.6 Error Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.3.1.5 MemAcc_GetJobStatus . . . . . . . . . . . . . . . . 47
8.3.1.6 MemAcc_GetMemoryInfo . . . . . . . . . . . . . . . 48
8.3.1.7 MemAcc_GetProcessedLength . . . . . . . . . . . . 49
8.3.1.8 MemAcc_GetJobInfo . . . . . . . . . . . . . . . . . . 50
8.3.1.9 MemAcc_ActivateMem . . . . . . . . . . . . . . . . . 51
8.3.1.10 MemAcc_DeactivateMem . . . . . . . . . . . . . . . 52
8.3.2 Asynchronous Functions . . . . . . . . . . . . . . . . . . . . 53
8.3.2.1 MemAcc_Cancel . . . . . . . . . . . . . . . . . . . . 53
8.3.2.2 MemAcc_Read . . . . . . . . . . . . . . . . . . . . . 54
8.3.2.3 MemAcc_Write . . . . . . . . . . . . . . . . . . . . . 55
8.3.2.4 MemAcc_Erase . . . . . . . . . . . . . . . . . . . . . 56
8.3.2.5 MemAcc_Compare . . . . . . . . . . . . . . . . . . . 57
8.3.2.6 MemAcc_BlankCheck . . . . . . . . . . . . . . . . . 59
8.3.2.7 MemAcc_HwSpecificService . . . . . . . . . . . . . 60
8.3.2.8 MemAcc_RequestLock . . . . . . . . . . . . . . . . . 61
8.3.2.9 MemAcc_ReleaseLock . . . . . . . . . . . . . . . . . 63
8.4 Callback Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.5 Scheduled Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.5.1 MemAcc_MainFunction . . . . . . . . . . . . . . . . . . . . . 64
8.6 Expected Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.6.1 Mandatory Interfaces . . . . . . . . . . . . . . . . . . . . . . 64
8.6.2 Optional Interfaces . . . . . . . . . . . . . . . . . . . . . . . . 66
8.6.3 Configurable Interfaces . . . . . . . . . . . . . . . . . . . . . 66
8.6.3.1 <AddressAreaJobEndNotification> . . . . . . . . . . 66
8.6.3.2 <ApplicationLockNotification> . . . . . . . . . . . . . 67
8.7 Service Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9 Sequence Diagrams 68
9.1 Job Handling with Result Polling . . . . . . . . . . . . . . . . . . . . . . 68
9.2 Job Handling with Job End Notification . . . . . . . . . . . . . . . . . . 69
9.3 Mem Driver Initialization by MemAcc . . . . . . . . . . . . . . . . . . . 69
9.4 Mem Driver Initialization by EcuM . . . . . . . . . . . . . . . . . . . . . 70
9.5 Mem Driver Scheduling by MemAcc . . . . . . . . . . . . . . . . . . . 71
9.6 Mem Driver Scheduling by SchM . . . . . . . . . . . . . . . . . . . . . 72
9.7 Generic Lock Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . 73
10 Configuration Specification 74
10.1 How to Read this Chapter . . . . . . . . . . . . . . . . . . . . . . . . . 74
10.2 Containers and Configuration Parameters . . . . . . . . . . . . . . . . 74
10.2.1 MemAcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.2.2 MemAccAddressAreaConfiguration . . . . . . . . . . . . . . 79
10.2.3 MemAccSubAddressAreaConfiguration . . . . . . . . . . . . 81
10.3 Published Information . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
NVM
FEE EA
MEMACC
Since MemAcc module and Mem driver also cover the Fls and Eep use cases
for non-volatile data storage, Fls and Eep become obsolete for the future.
Terms Description
Address Area Contiguous memory area in the logical address space
Typically multiple physical memory sectors are combined to one
logical address area.
Bank Group of sector batches
In case a memory technology is segmented in sectors, a bank is
an instance of a sector batch group in which no read-while-write
operation is permitted. In case of a flash memory device, this
typically maps to an individual flash controller.
Job Request Memory access request by an upper layer module for an address
area.
Memory Device Group of banks
Page Burst Aggregated access of memory pages for improved performance
In case a memory device technology has a physical segmenta-
tion, some memory devices provide an optimized access method
to read or write multiple pages at a time. Page burst denotes the
aggregation of memory pages used for the access optimization.
Read Page Smallest readable unit of a memory device (in bytes)
Some memory device technologies must be accessed consider-
ing a physical segmentation. Hence a byte-wise access is not
possible for all memory device technologies. This term defines
the minimum size that needs to be read in one access.
Sector Smallest erasable memory unit (in bytes)
Some memory device technologies require an explicit physical
erase operation before the memory can be written. A sector de-
fines the minimum size of such an erase unit. Depending on the
memory device, sectors can be either uniform- or variable-sized.
Sector Batch Aggregation of sectors with uniform size
Logical aggregation of contiguous sectors with the same size.
Sector Burst Aggregation of sectors for improved erase performance
In case a memory technology needs a physical erase opera-
tion, some devices provide an erase performance optimization
by erasing an aggregation of sectors in one step.
Terms Description
Sub Address Area Contiguous memory area in the logical address space mapped
to a sector batch of one memory device.
Write Page Smallest writeable unit of a memory device (in bytes)
Some memory device technologies must be accessed consider-
ing a physical segmentation. Hence a byte-wise access is not
possible for all memory device technologies. This term defines
the minimum size that needs to be written in one access.
Page
Sector Bank Device
3 Related Documentation
[1] Glossary
AUTOSAR_TR_Glossary
[2] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[3] Requirements on Memory Hardware Abstraction Layer
AUTOSAR_SRS_MemoryHWAbstractionLayer
[4] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral
[5] Requirements on AUTOSAR Features
AUTOSAR_RS_Features
4.1 Limitations
The MemAcc module is targeted for address based memory access. File based
access is not considered.
Block based memory devices like NAND flash devices which require an explicit
bad block management are out of scope of this specification.
6 Requirements Tracing
The following tables reference the requirements specified in [3], [4] and [5] and links to
the fulfillment of these. Please note that if column “Satisfied by” is empty for a specific
requirement this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
[RS_BRF_01000] AUTOSAR architecture shall [SWS_MemAcc_00083]
organize the BSW in a hardware
independent and a hardware
dependent layer
[RS_BRF_01848] AUTOSAR non-volatile memory [SWS_MemAcc_00005]
functionality shall provide [SWS_MemAcc_00100]
mechanisms to enhance
hardware reliability
[SRS_BSW_00003] All software modules shall [SWS_MemAcc_10016]
provide version and identification
information
[SRS_BSW_00004] All Basic SW Modules shall [SWS_MemAcc_00002]
perform a pre-processor check
of the versions of all imported
include files
[SRS_BSW_00167] All AUTOSAR Basic Software [SWS_MemAcc_00002]
Modules shall provide
configuration rules and
constraints to enable plausibility
checks
[SRS_BSW_00323] All AUTOSAR Basic Software [SWS_MemAcc_00002]
Modules shall check passed API [SWS_MemAcc_00027]
parameters for validity [SWS_MemAcc_00031]
[SWS_MemAcc_00034]
[SWS_MemAcc_00036]
[SWS_MemAcc_00037]
[SWS_MemAcc_00039]
[SWS_MemAcc_00041]
[SWS_MemAcc_00042]
[SWS_MemAcc_00044]
[SWS_MemAcc_00045]
[SWS_MemAcc_00046]
[SWS_MemAcc_00047]
[SWS_MemAcc_00049]
[SWS_MemAcc_00050]
[SWS_MemAcc_00051]
[SWS_MemAcc_00052]
[SWS_MemAcc_00054]
[SWS_MemAcc_00055]
[SWS_MemAcc_00056]
[SWS_MemAcc_00058]
[SWS_MemAcc_00059]
[SWS_MemAcc_00060]
[SWS_MemAcc_00061]
7 Functional Specification
This chapter defines the behavior of the MemAcc module.
The API of the module is defined in chapter 8, while the configuration is defined in 10.
7.1 Overview
The MemAcc module provides a memory device agnostic address-based memory ac-
cess for different upper layers modules. It implements all high level functionality like job
management, access coordination and allocation of Memory Driver access requests
according to the physical segmentation as the Memory Drivers expect all memory ac-
cesses aligned to physical segments.
The MemAcc module abstracts the physical memory addressing scheme of the Mem
driver to the upper layer by means of a logical address space.
Figure 7.1 provides an overview of the memory address translation/mapping scheme:
Physical Logical
Sector
Batch
Sub Address
Area
Sub Address
Area Address
Area
[SWS_MemAcc_00012] dAll 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.c(SRS_MemHwAb_14057)
[SWS_MemAcc_00078] dAn address area shall only be assigned to one upper layer
module.c(SRS_MemHwAb_14057)
Note: Since only one memory job is allowed per address area, there’s a 1:1 relation
between address area and upper layer.
In general, all MemAcc services that need a significant amount of time to process an
operation are defined as asynchronous services. Therefore, MemAcc job requests get
only queued by the asynchronous services like MemAcc_Read and the processing of
the queued jobs happen in the MemAcc_MainFunction.
[SWS_MemAcc_00018] dThe MemAcc module shall allow only one job request per
address area.c(SRS_MemHwAb_14057)
Note: Simplification of job management since one address area can only have one
upper layer and job request are typically requested sequentially from the upper layer.
[SWS_MemAcc_00017] dIf 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.c(SRS_MemHwAb_-
14034)
The MemAcc module provides the current job processing status information via the
MemAcc_GetJobStatus service.
[SWS_MemAcc_00113] dAfter initialization via the MemAcc_Init service, the job
precessing status shall be set to MEMACC_JOB_IDLE.c(SRS_MemHwAb_14040)
[SWS_MemAcc_00020] dOnce a job request was accepted, the job processing status
shall be set to MEMACC_JOB_PENDING.c(SRS_MemHwAb_14040)
The results of the last MemAcc job is provided by the MemAcc_GetJobResult ser-
vice. It can be used by upper layer modules to retrieve detailed information for fine-
tuned fault handling.
[SWS_MemAcc_00105] dIn case the job processing was completed successfully, the
job result shall be set to MEMACC_MEM_OK.c(SRS_MemHwAb_14040)
[SWS_MemAcc_00106] dIn 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.c(SRS_MemHwAb_14040)
[SWS_MemAcc_00021] dIn case the last memory operation was canceled, the job
result shall be set to MEMACC_MEM_CANCELED.c(SRS_MemHwAb_14040)
[SWS_MemAcc_00109] dIn case the memory operation was not successfully com-
pleted for any other reason, the job result shall be set to MEMACC_MEM_FAILED.c
(SRS_MemHwAb_14040)
To support memory device specific services, the MemAcc module provides a generic
API to call hardware specific Mem driver services - see MemAcc_HwSpecificSer-
vice.
Each Mem driver can have multiple hardware specific services which are selected by
the hwServiceId parameter.
Note: By providing a generic API for hardware specific services, the MemAcc module
can be kept hardware independent.
Some Mem drivers can provide burst capabilities, i.e. instead of writing/erasing one
smallest possible unit, several of these units are written/erased at once to increase
performance. Depending on the hardware capabilities, a Mem driver might offer three
kinds of burst modes:
• Erase multiple sectors
• Read multiple pages
• Write multiple pages
[SWS_MemAcc_00087] dIf enabled by MemAccUseEraseBurst, MemAcc shall
align and split the Mem driver erase requests according to the erase burst size of the
Mem driver.c(SRS_MemHwAb_14048)
To support upper layers like the BndM, the MemAcc module provides a generic lock
API which can be used to restrict the memory access by a certain Mem driver, e.g., if
an upper layer wants to do a direct memory mapped access.
Figure 9.7 shows an example lock/unlock sequence.
Note: The application or upper layer module has to maintain the lock state and release
the lock once the direct memory access was completed. For the sake of simplicity,
nested locks are not supported.
For some safety-relevant use cases, it is not desirable for the Mem driver to be per-
manently available in an executable form, e.g. to prevent accidental overwriting of
memory areas. For these use cases, the Mem driver is compiled as a separate binary
which contains a function pointer table to expose the Mem driver service functions to
the MemAcc module and the MemAcc module calls the Mem driver service functions
indirectly using the Mem driver function pointer table.
For the dynamic memory driver activation, the upper layer module has to ensure that
the Mem driver binary is available for execution, e.g. downloaded to RAM and initialized
before any MemAcc job is requested for the according address area.
7.4.1 Initialization
Figure 9.3 shows the Mem driver initialization via MemAcc while figure 9.4 shows the
Mem driver initialization via EcuM.
7.4.2 Scheduling
Since most of the MemAcc module services are asynchronous services, the MemAcc_-
MainFunction needs to be cyclically triggered.
Depending on the MemAccMemInvocation attribute, MemAcc can call all Mem main
functions within MemAcc_MainFunction.
Note: In case Mem drivers shall be dynamically activated, the scheduling of the Mem
driver main functions cannot be done via the SchM. Therefore, the MemAcc module
has to take care of the main function triggering depending on the individual Mem driver
state.
Figure 9.5 shows the Mem main function triggering via MemAcc while figure 9.6 shows
the Mem main function triggering via SchM.
The MemAcc module does not perform any kind of buffer alignment. Therefore,
the buffers provided by the upper layers need to consider already the alignment
requirements defined by the MemAccBufferAlignmentValue attribute.
MemAccBufferAlignmentValue must be configured to the least common multiple
value needed by the underlying Mem drivers. The same applies to the write page
requirements.
[SWS_MemAcc_00004] dIn 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.c(SRS_MemHwAb_14048)
Note: Memory requests must be aligned to the physical memory segmentation.
[SWS_MemAcc_10038] d
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 MEMACC_E_PARAM_ADDRESS_LENGTH 0x04
belonging to the passed address area ID
API service called with a hardware ID not MEMACC_E_PARAM_HW_ID 0x05
belonging to the passed address area ID
API service called for an address area ID with a MEMACC_E_BUSY 0x06
pending job request
Dynamic MEM driver activation failed due to MEMACC_E_MEM_INIT_FAILED 0x07
inconsistent MEM driver binary
8 API Specification
c(SRS_MemHwAb_14040)
8.2.1 MemAcc_AddressAreaIdType
[SWS_MemAcc_10000] d
Name MemAcc_AddressAreaIdType
Kind Type
Derived from uint16
Description Unique address area ID type.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14057)
8.2.2 MemAcc_AddressType
[SWS_MemAcc_10001] d
Name MemAcc_AddressType
Kind Type
Derived from Basetype Variation
uint32 –
5
4
uint64 –
Description Logical memory address type.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14046)
8.2.3 MemAcc_ConfigType
[SWS_MemAcc_10002] d
Name MemAcc_ConfigType
Kind Structure
Description Postbuild configuration structure type.
Available via MemAcc_GeneralTypes.h
c(SRS_BSW_00414)
8.2.4 MemAcc_DataType
[SWS_MemAcc_10004] d
Name MemAcc_DataType
Kind Type
Derived from uint8
Description General data type.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14051)
8.2.5 MemAcc_JobResultType
[SWS_MemAcc_10039] d
Name MemAcc_JobResultType
Kind Enumeration
Range MEMACC_MEM_OK 0x00 The last MemAcc job was finished
successfully
MEMACC_MEM_FAILED 0x01 The last MemAcc job resulted in an unspecific
failure and the job was not completed
MEMACC_MEM_ 0x02 The results of the last MemAcc job didn’t
INCONSISTENT meet the expected result, e.g. a blank check
operation was applied on a non-blank
memory area
5
4
MEMACC_MEM_ 0x03 The last MemAcc job was canceled
CANCELED
MEMACC_MEM_ECC_ 0x04 The last memory operation returned an
UNCORRECTED uncorrectable ECC error
MEMACC_MEM_ECC_ 0x05 The last memory operation returned a
CORRECTED correctable ECC error
Description Asynchronous job result type.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14040)
8.2.6 MemAcc_JobStatusType
[SWS_MemAcc_10009] d
Name MemAcc_JobStatusType
Kind Enumeration
Range MEMACC_JOB_IDLE 0x00 Job processing was completed or no job
currently pending
MEMACC_JOB_PENDING 0x01 A job is currently being processed
Description Asynchronous job status type.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14040)
8.2.7 MemAcc_JobType
[SWS_MemAcc_10011] d
Name MemAcc_JobType
Kind Enumeration
Range MEMACC_NO_JOB 0x00 No job currently pending
MEMACC_WRITE_JOB 0x01 Write job pending
MEMACC_READ_JOB 0x02 Read job pending
MEMACC_COMPARE_JOB 0x03 Compare job pending
MEMACC_ERASE_JOB 0x04 Erase job pending
MEMACC_ 0x05 Hardware specific job pending
MEMHWSPECIFIC_JOB
MEMACC_BLANKCHECK_ 0x06 Blank check job pending
JOB
MEMACC_ 0x07 Request lock job pending
REQUESTLOCK_JOB
Description Type for asynchronous jobs.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14040)
8.2.8 MemAcc_LengthType
[SWS_MemAcc_10007] d
Name MemAcc_LengthType
Kind Type
Derived from Basetype Variation
uint32 –
uint64 –
Description Job length type.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14046)
8.2.9 MemAcc_MemoryInfoType
[SWS_MemAcc_10012]{DRAFT} d
Name MemAcc_MemoryInfoType (draft)
Kind Structure
LogicalStartAddress
Elements Type MemAcc_AddressType
Comment Logical start address of sub address area
PhysicalStartAddress
Type MemAcc_AddressType
Comment Physical start address of sub address area
MaxOffset
Type MemAcc_LengthType
Comment Size of sub address area in bytes -1
EraseSectorSize
Type uint32
Comment Size of a sector in bytes
EraseSectorBurstSize
Type uint32
Comment Size of a sector burst in bytes. Equals SectorSize in case burst is
disabled
ReadPageSize
Type uint32
Comment Read size of a page in bytes
WritePageSize
Type uint32
Comment Write size of a page in bytes
ReadPageBurstSize
Type uint32
5
4
Comment Size of a read page burst in bytes. Equals ReadPageSize in case burst
is disabled
WritePageBurstSize
Type uint32
Comment Size of a page burst in bytes. Equals WritePageSize in case burst is
disabled
HwId
Type uint32
Comment Referenced memory driver hardware identifier
Description This structure contains information of Mem device characteristics. It can be accessed via the
MemAcc_GetMemoryInfo() service.
Tags: atp.Status=draft
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14054)
8.2.10 MemAcc_JobInfoType
[SWS_MemAcc_10013] d
Name MemAcc_JobInfoType
Kind Structure
LogicalAddress
Elements Type MemAcc_AddressType
Comment Address of currently active address area request
Length
Type MemAcc_LengthType
Comment Length of the currently active address area request
HwId
Type MemAcc_HwIdType
Comment Referenced memory driver hardware identifier
MemInstanceId
Type uint32
Comment Instance ID of the current memory request
MemAddress
Type uint32
Comment Physical address of the current memory driver request
MemLength
Type uint32
Comment Length of memory driver request
CurrentJob
Type MemAcc_JobType
Comment Currently active MemAcc job
MemResult
Type MemAcc_JobResultType
5
4
Comment Current or last Mem driver result
Description This structure contains information the current processing state of the MemAcc module.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14040)
8.2.11 MemAcc_HwIdType
[SWS_MemAcc_10010] d
Name MemAcc_HwIdType
Kind Enumeration
Range 0 - 4294967295 – The name of each enum parameter is
constructed from the Mem module name and
the Mem instance name
Description Type for the unique numeric identifiers of all Mem hardware instances used for hardware specific
requests.
Available via MemAcc_GeneralTypes.h
c(SRS_MemHwAb_14042)
8.2.12 MemAcc_MemBinaryHeaderType
[SWS_MemAcc_10014]{DRAFT} d
Name MemAcc_MemBinaryHeaderType (draft)
Kind Structure
UniqueId
Elements
Type uint64
Comment Unique ID
Flags
Type uint64
Comment Header flags
Header
Type uint64
Comment Address of Mem driver header structure
Delimiter
Type uint64
Comment Address of Mem driver delimiter field
InitFunc
Type MemAcc_MemInitFuncType*
Comment Mem_Init function pointer
MainFunc
Type MemAcc_MemMainFuncType*
5
4
Comment Mem_Main function pointer
GetJobResultFunc
Type MemAcc_MemGetJobResultFuncType*
Comment Mem_GetJobResult function pointer
ReadFunc
Type MemAcc_MemReadFuncType*
Comment Mem_Read function pointer
WriteFunc
Type MemAcc_MemWriteFuncType*
Comment Mem_Write function pointer
EraseFunc
Type MemAcc_MemEraseFuncType*
Comment Mem_Erase function pointer
PropagateErrorFunc
Type MemAcc_MemPropagateErrorFuncType*
Comment Mem_PropagateError function pointer
BlankCheckFunc
Type MemAcc_MemBlankCheckFuncType*
Comment Mem_BlankCheck function pointer
SuspendFunc
Type MemAcc_MemSuspendFuncType*
Comment Mem_Suspend function pointer
ResumeFunc
Type MemAcc_MemResumeFuncType*
Comment Mem_Resume function pointer
HwSpecificServiceFunc
Type MemAcc_MemHwSpecificServiceFuncType*
Comment Hardware specific service function pointer
Description This structure contains elements for accessing the Mem driver service functions and consistency
information.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.13 MemAcc_MemAddressType
[SWS_MemAcc_91013] d
Name MemAcc_MemAddressType
Kind Type
Derived from MemAcc_AddressType
Description Physical memory device address type
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14046)
8.2.14 MemAcc_MemConfigType
[SWS_MemAcc_91012] d
Name MemAcc_MemConfigType
Kind Structure
Description Memory driver configuration structure type
Available via MemAcc_MemApi.h
c(SRS_BSW_00414)
8.2.15 MemAcc_MemDataType
[SWS_MemAcc_91020] d
Name MemAcc_MemDataType
Kind Type
Derived from uint8
Description General data type
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14051)
8.2.16 MemAcc_MemInstanceIdType
[SWS_MemAcc_91011] d
Name MemAcc_MemInstanceIdType
Kind Type
Derived from uint32
Description Memory driver instance ID type
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14043)
8.2.17 MemAcc_MemJobResultType
[SWS_MemAcc_91016] d
Name MemAcc_MemJobResultType
Kind Enumeration
Range MEM_JOB_OK 0x00 The last job has been finished successfully
MEM_JOB_PENDING 0x01 A job is currently being processed
5
4
MEM_JOB_FAILED 0x02 Job failed for some unspecific reason
MEM_INCONSISTENT 0x03 The checked page is not blank
MEM_ECC_ 0x04 Uncorrectable ECC errors occurred during
UNCORRECTED memory access
MEM_ECC_CORRECTED 0x05 Correctable ECC errors occurred during
memory access
Description Asynchronous job result type
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14040)
8.2.18 MemAcc_MemLengthType
[SWS_MemAcc_91014] d
Name MemAcc_MemLengthType
Kind Type
Derived from uint32
Description Physical memory device length type
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14046)
8.2.19 MemAcc_MemHwServiceIdType
[SWS_MemAcc_10008] d
Name MemAcc_MemHwServiceIdType
Kind Type
Derived from uint32
Description Index type for Mem driver hardware specific service table.
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14056)
8.2.20 MemAcc_MemInitFuncType
[SWS_MemAcc_91000] d
Name MemAcc_MemInitFuncType
Kind Function Pointer
Syntax void (*MemAcc_MemInitFuncType) (
MemAcc_MemConfigType* configPtr
)
Parameters (in) configPtr Pointer to the Mem driver configuration data structure.
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_Init service for the invocation of the Mem driver API via function
pointer interface.
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.21 MemAcc_MemDeInitFuncType
[SWS_MemAcc_91018] d
Name MemAcc_MemDeInitFuncType
Kind Function Pointer
Syntax void (*MemAcc_MemDeInitFuncType) (
void
)
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_DeInit service for the invocation of the Mem driver API via
function pointer interface.
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.22 MemAcc_MemGetJobResultFuncType
[SWS_MemAcc_91002] d
Name MemAcc_MemGetJobResultFuncType
Kind Function Pointer
Syntax MemAcc_MemJobResultType (*MemAcc_MemGetJobResultFuncType) (
MemAcc_MemInstanceIdType instanceId
)
5
4
Parameters (in) instanceId ID of the related memory driver instance.
Parameters (inout) None
Parameters (out) None
Return value MemAcc_MemJobResult Most recent job result.
Type
Description Function pointer for the Mem_JobResultType service for the invocation of the Mem driver API
via function pointer interface.
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.23 MemAcc_MemSuspendFuncType
[SWS_MemAcc_91008]{DRAFT} d
Name MemAcc_MemSuspendFuncType (draft)
Kind Function Pointer
Syntax void (*MemAcc_MemSuspendFuncType) (
MemAcc_MemInstanceIdType instanceId
)
Parameters (in) instanceId ID of the related memory driver instance.
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_Suspend service for the invocation of the Mem driver API via
function pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.24 MemAcc_MemResumeFuncType
[SWS_MemAcc_91009]{DRAFT} d
Name MemAcc_MemResumeFuncType (draft)
Kind Function Pointer
Syntax void (*MemAcc_MemResumeFuncType) (
MemAcc_MemInstanceIdType instanceId
)
Parameters (in) instanceId ID of the related memory driver instance.
Parameters (inout) None
Parameters (out) None
Return value None
5
4
Description Function pointer for the Mem_Resume service for the invocation of the Mem driver API via
function pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.25 MemAcc_MemPropagateErrorFuncType
[SWS_MemAcc_91006] d
Name MemAcc_MemPropagateErrorFuncType
Kind Function Pointer
Syntax void (*MemAcc_MemPropagateErrorFuncType) (
MemAcc_MemInstanceIdType instanceId
)
Parameters (in) instanceId ID of the related memory driver instance.
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_PropagateError service for the invocation of the Mem driver API
via function pointer interface.
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.26 MemAcc_MemReadFuncType
[SWS_MemAcc_91003]{DRAFT} d
Name MemAcc_MemReadFuncType (draft)
Kind Function Pointer
Syntax Std_ReturnType (*MemAcc_MemReadFuncType) (
MemAcc_MemInstanceIdType instanceId,
MemAcc_MemAddressType sourceAddress,
MemAcc_MemLengthType length,
MemAcc_MemDataType* destinationDataPtr
)
Parameters (in) instanceId ID of the related memory driver instance.
sourceAddress Physical address to read data from.
length Read length in bytes.
Parameters (inout) None
Parameters (out) destinationDataPtr Destination memory pointer to store the read data.
5
4
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The service function is not
implemented.
Description Function pointer for the Mem_Read service for the invocation of the Mem driver API via
function pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.27 MemAcc_MemWriteFuncType
[SWS_MemAcc_91004]{DRAFT} d
Name MemAcc_MemWriteFuncType (draft)
Kind Function Pointer
Syntax void (*MemAcc_MemWriteFuncType) (
Std_ReturnType return,
MemAcc_MemInstanceIdType instanceId,
MemAcc_MemAddressType targetAddress,
const MemAcc_MemDataType* sourceDataPtr,
MemAcc_MemLengthType length
)
Parameters (in) return E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The service function is not
implemented.
instanceId ID of the related memory driver instance.
targetAddress Physical write address (aligned to page size).
sourceDataPtr Source data pointer (aligned to page size).
length Write length in bytes (aligned to page size).
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_Write service for the invocation of the Mem driver API via function
pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.28 MemAcc_MemEraseFuncType
[SWS_MemAcc_91005]{DRAFT} d
Name MemAcc_MemEraseFuncType (draft)
Kind Function Pointer
Syntax void (*MemAcc_MemEraseFuncType) (
Std_ReturnType return,
MemAcc_MemInstanceIdType instanceId,
MemAcc_MemAddressType targetAddress,
MemAcc_MemLengthType length
)
Parameters (in) return E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The service function is not
implemented.
instanceId ID of the related memory driver instance.
targetAddress Physical erase address (aligned to sector size).
length Erase length in bytes (aligned to sector size).
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_Erase service for the invocation of the Mem driver API via
function pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.29 MemAcc_MemBlankCheckFuncType
[SWS_MemAcc_91007]{DRAFT} d
Name MemAcc_MemBlankCheckFuncType (draft)
Kind Function Pointer
Syntax void (*MemAcc_MemBlankCheckFuncType) (
Std_ReturnType return,
MemAcc_MemInstanceIdType instanceId,
MemAcc_MemAddressType targetAddress,
MemAcc_MemLengthType length
)
Parameters (in) return E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The service function is not
implemented.
instanceId ID of the related memory driver instance.
targetAddress Physical blank check address.
length Blank check length.
Parameters (inout) None
5
4
Parameters (out) None
Return value None
Description Function pointer for the Mem_BlankCheck service for the invocation of the Mem driver API via
function pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.30 MemAcc_MemHwSpecificServiceFuncType
[SWS_MemAcc_91010]{DRAFT} d
Name MemAcc_MemHwSpecificServiceFuncType (draft)
Kind Function Pointer
Syntax void (*MemAcc_MemHwSpecificServiceFuncType) (
Std_ReturnType return,
MemAcc_MemInstanceIdType instanceId,
MemAcc_MemHwServiceIdType hwServiceId,
MemAcc_MemDataType* dataPtr,
MemAcc_MemLengthType* lengthPtr
)
Parameters (in) return E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The service function is not
implemented.
instanceId ID of the related memory driver instance.
hwServiceId Hardware specific service request identifier for dispatching the
request.
lengthPtr Size pointer of the passed data.
Parameters (inout) dataPtr Request specific data pointer.
Parameters (out) None
Return value None
Description Function pointer for the Mem_HwSpecificService function for the invocation of the Mem driver
API via function pointer interface.
Tags: atp.Status=draft
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.2.31 MemAcc_MemMainFuncType
[SWS_MemAcc_91001] d
Name MemAcc_MemMainFuncType
Kind Function Pointer
Syntax void (*MemAcc_MemMainFuncType) (
void
)
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Function pointer for the Mem_MainFunction service for the invocation of the Mem driver API via
function pointer interface.
Available via MemAcc_MemApi.h
c(SRS_MemHwAb_14045)
8.3.1.1 MemAcc_Init
[SWS_MemAcc_10015] d
Service Name MemAcc_Init
Syntax void MemAcc_Init (
const MemAcc_ConfigType* configPtr
)
Service ID [hex] 0x01
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) configPtr Pointer to selected configuration structure.
Parameters (inout) None
Parameters (out) None
Return value None
Description Initialization function - initializes all variables and sets the module state to initialized.
Available via MemAcc.h
c(SRS_MemHwAb_14035, SRS_MemHwAb_14037)
8.3.1.2 MemAcc_DeInit
[SWS_MemAcc_10041] d
Service Name MemAcc_DeInit
Syntax void MemAcc_DeInit (
void
)
Service ID [hex] 0x13
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14037)
8.3.1.3 MemAcc_GetVersionInfo
[SWS_MemAcc_10016] d
Service Name MemAcc_GetVersionInfo
Syntax void MemAcc_GetVersionInfo (
Std_VersionInfoType* versionInfoPtr
)
Service ID [hex] 0x02
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) versionInfoPtr Pointer to where to store the version information of this module.
Return value None
Description Service to return the version information of the MemAcc module.
Available via MemAcc.h
c(SRS_BSW_00003)
8.3.1.4 MemAcc_GetJobResult
[SWS_MemAcc_10019] d
Service Name MemAcc_GetJobResult
Syntax MemAcc_JobResultType MemAcc_GetJobResult (
MemAcc_AddressAreaIdType addressAreaId
)
Service ID [hex] 0x05
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
Parameters (inout) None
Parameters (out) None
Return value MemAcc_JobResultType Most recent job result of the referenced address area.
Description Returns the consolidated job result of the address area referenced by addressAreaId.
Available via MemAcc.h
c(SRS_MemHwAb_14040)
8.3.1.5 MemAcc_GetJobStatus
[SWS_MemAcc_10040] d
Service Name MemAcc_GetJobStatus
Syntax MemAcc_JobStatusType MemAcc_GetJobStatus (
MemAcc_AddressAreaIdType addressAreaId
)
Service ID [hex] 0x10
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
Parameters (inout) None
Parameters (out) None
Return value MemAcc_JobStatusType Most recent job result of the referenced address area.
Description Returns the status of the MemAcc job referenced by addressAreaId.
Available via MemAcc.h
c(SRS_MemHwAb_14040)
8.3.1.6 MemAcc_GetMemoryInfo
[SWS_MemAcc_10020] d
Service Name MemAcc_GetMemoryInfo
Syntax Std_ReturnType MemAcc_GetMemoryInfo (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType address,
MemAcc_MemoryInfoType* memoryInfoPtr
)
Service ID [hex] 0x06
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
address Address in logical address space from which corresponding
memory device information shall be retrieved.
Parameters (inout) None
Parameters (out) memoryInfoPtr Destination memory pointer to store the memory device
information.
Return value Std_ReturnType E_OK: The requested addressAreaId and address are valid.
E_NOT_OK: The requested addressAreaId and address are
invalid.
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14054)
8.3.1.7 MemAcc_GetProcessedLength
[SWS_MemAcc_10021] d
Service Name MemAcc_GetProcessedLength
Syntax MemAcc_LengthType MemAcc_GetProcessedLength (
MemAcc_AddressAreaIdType addressAreaId
)
Service ID [hex] 0x07
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
Parameters (inout) None
Parameters (out) None
Return value MemAcc_LengthType Processed length of current job (in bytes).
Description Returns the accumulated number of bytes that have already been processed in the current job.
Available via MemAcc.h
c(SRS_MemHwAb_14040)
8.3.1.8 MemAcc_GetJobInfo
[SWS_MemAcc_10022] d
Service Name MemAcc_GetJobInfo
Syntax void MemAcc_GetJobInfo (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_JobInfoType* jobInfoPtr
)
Service ID [hex] 0x08
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
Parameters (inout) None
Parameters (out) jobInfoPtr Structure pointer to return the detailed processing information of
the current job.
Return value None
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14040)
8.3.1.9 MemAcc_ActivateMem
[SWS_MemAcc_10033] d
Service Name MemAcc_ActivateMem
Syntax Std_ReturnType MemAcc_ActivateMem (
MemAcc_AddressType headerAddress,
MemAcc_HwIdType hwId
)
Service ID [hex] 0x14
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) headerAddress Physical start address of Mem driver header structure.
hwId Unique numeric memory driver identifier.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Mem driver activation successful.
E_NOT_OK: Mem driver activation failed.
Description Dynamic activation and initialization of a Mem driver referenced by hwId and headerAddress.
Available via MemAcc.h
c(SRS_MemHwAb_14045, SRS_MemHwAb_14047)
8.3.1.10 MemAcc_DeactivateMem
[SWS_MemAcc_10034] d
Service Name MemAcc_DeactivateMem
Syntax Std_ReturnType MemAcc_DeactivateMem (
MemAcc_HwIdType hwId,
MemAcc_AddressType headerAddress
)
Service ID [hex] 0x15
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) hwId Unique numeric memory driver identifier.
headerAddress Physical start address of Mem driver header structure.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Mem driver deactivation successful.
E_NOT_OK: Mem driver deactivation failed.
Description Dynamic deactivation of a Mem driver referenced by hwId and headerAddress.
Available via MemAcc.h
c(SRS_MemHwAb_14045, SRS_MemHwAb_14047)
Note: After calling the MemAcc_DeactivateMem service, the integration code shall
also clear the memory area where the corresponding Mem driver is stored to prevent
accidental execution of a Mem driver.
8.3.2.1 MemAcc_Cancel
[SWS_MemAcc_10018] d
Service Name MemAcc_Cancel
Syntax void MemAcc_Cancel (
MemAcc_AddressAreaIdType addressAreaId
)
Service ID [hex] 0x04
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
Parameters (inout) None
Parameters (out) None
Return value None
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14038, SRS_MemHwAb_14039)
8.3.2.2 MemAcc_Read
[SWS_MemAcc_10023] d
Service Name MemAcc_Read
Syntax Std_ReturnType MemAcc_Read (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType sourceAddress,
MemAcc_DataType* destinationDataPtr,
MemAcc_LengthType length
)
Service ID [hex] 0x09
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
sourceAddress Read address in logical address space.
length Read length in bytes (aligned to read page size)
Parameters (inout) None
Parameters (out) destinationDataPtr Destination memory pointer to store the read data.
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver
service function is not available.
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14038, SRS_MemHwAb_14039)
8.3.2.3 MemAcc_Write
[SWS_MemAcc_10024] d
Service Name MemAcc_Write
Syntax Std_ReturnType MemAcc_Write (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType targetAddress,
const MemAcc_DataType* sourceDataPtr,
MemAcc_LengthType length
)
Service ID [hex] 0x0a
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
targetAddress Write address in logical address space.
sourceDataPtr Source data pointer (aligned to MemAccBufferAlignmentValue).
length Write length in bytes (aligned to page size).
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver
service function is not available.
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14038, SRS_MemHwAb_14039)
8.3.2.4 MemAcc_Erase
[SWS_MemAcc_10025] d
Service Name MemAcc_Erase
Syntax Std_ReturnType MemAcc_Erase (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType targetAddress,
MemAcc_LengthType length
)
Service ID [hex] 0x0b
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
targetAddress Erase address in logical address space (aligned to sector size).
length Erase length in bytes (aligned to sector size).
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver
service function is not available.
5
4
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14038, SRS_MemHwAb_14039)
8.3.2.5 MemAcc_Compare
[SWS_MemAcc_10026]{DRAFT} d
Service Name MemAcc_Compare (draft)
Syntax Std_ReturnType MemAcc_Compare (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType sourceAddress,
const MemAcc_DataType* dataPtr,
MemAcc_LengthType length
)
Service ID [hex] 0x0c
5
4
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
sourceAddress Compare address in logical address space.
dataPtr Pointer to user data which shall be compared to data in memory.
length Compare length in bytes.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver
service function is not available.
Description 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
Available via MemAcc.h
c(SRS_MemHwAb_14038, SRS_MemHwAb_14039)
8.3.2.6 MemAcc_BlankCheck
[SWS_MemAcc_10027] d
Service Name MemAcc_BlankCheck
Syntax Std_ReturnType MemAcc_BlankCheck (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType targetAddress,
MemAcc_LengthType length
)
Service ID [hex] 0x0d
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
targetAddress Blank check address in logical address space.
length Blank check length in bytes.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has been rejected by the module.
E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver
service function is not available and no job was started.
Description 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.
Available via MemAcc.h
c(SRS_MemHwAb_14038, SRS_MemHwAb_14039)
MEMACC_E_PARAM_ADDRESS_AREA_ID.c(SRS_BSW_00323)
8.3.2.7 MemAcc_HwSpecificService
[SWS_MemAcc_10028] d
Service Name MemAcc_HwSpecificService
Syntax Std_ReturnType MemAcc_HwSpecificService (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_HwIdType hwId,
MemAcc_MemHwServiceIdType hwServiceId,
MemAcc_DataType* dataPtr,
MemAcc_LengthType* lengthPtr
)
Service ID [hex] 0xe
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
hwId Unique numeric memory driver identifier.
hwServiceId Hardware specific service request identifier for dispatching the
request.
Parameters (inout) dataPtr Data pointer pointing to the job buffer. Value can be NULL_PTR,
if not needed. If dataPtr is used by the hardware specific service,
the pointer must be valid until the job completed.
lengthPtr Size pointer of the data passed by dataPtr. Can be NULL_PTR if
dataPtr is also NULL_PTR.
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has not been accepted by the
module.
E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver
service function is not available.
Description 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.
Available via MemAcc.h
8.3.2.8 MemAcc_RequestLock
[SWS_MemAcc_10030] d
Service Name MemAcc_RequestLock
Syntax Std_ReturnType MemAcc_RequestLock (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType address,
MemAcc_AddressType length,
void* lockNotificationFctPtr
)
Service ID [hex] 0x11
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
address Logical start address of the address area to identify the Mem
driver to be locked.
length Length of the address area to identify the Mem driver to be
locked.
lockNotificationFctPtr Pointer to address area lock notification callback function.
5
4
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has been rejected by the module
Description Request lock of an address area for exclusive access. Once the lock is granted, the referenced
lock notification function is called by MemAcc.
Available via MemAcc.h
8.3.2.9 MemAcc_ReleaseLock
[SWS_MemAcc_10031]{DRAFT} d
Service Name MemAcc_ReleaseLock (draft)
Syntax Std_ReturnType MemAcc_ReleaseLock (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_AddressType address,
MemAcc_LengthType length
)
Service ID [hex] 0x12
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
address Logical start address to identify lock area.
length Length to identify lock area.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The requested job has been accepted by the module.
E_NOT_OK: The requested job has been rejected by the module.
Description Release access lock of provided address area.
Tags: atp.Status=draft
Available via MemAcc.h
c(SRS_MemHwAb_14055)
8.5.1 MemAcc_MainFunction
[SWS_MemAcc_10017] d
Service Name MemAcc_MainFunction
Syntax void MemAcc_MainFunction (
void
)
Service ID [hex] 0x03
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Service to handle the requested jobs and the internal management operations. Depending on
the configuration MemAcc will call the Mem driver main functions.
Available via MemAcc.h
c(SRS_MemHwAb_14047)
[SWS_MemAcc_00084] dIf 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.c(SRS_MemHwAb_14047)
This section defines all interfaces, which are required to fulfill the core functionality of
the module.
[SWS_MemAcc_10036] d
API Function Header File Description
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.
c(SRS_BSW_00415)
This section defines all interfaces, which are required to fulfill an optional functionality
of the module.
[SWS_MemAcc_10035] d
API Function Header File Description
Det_ReportError Det.h Service to report development errors.
c(SRS_BSW_00415)
In this chapter all interfaces are listed where the target function could be configured.
The target function is usually a callback function. The names of this kind of interfaces
are not fixed because they are configurable.
8.6.3.1 <AddressAreaJobEndNotification>
[SWS_MemAcc_10029]{DRAFT} d
Service Name <AddressAreaJobEndNotification> (draft)
Syntax void <AddressAreaJobEndNotification> (
MemAcc_AddressAreaIdType addressAreaId,
MemAcc_JobResultType jobResult
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) addressAreaId Numeric identifier of address area.
jobResult Result of the last MemAcc operation.
Parameters (inout) None
Parameters (out) None
Return value None
Description MemAcc application job end notification callback. The function name is configurable.
Tags: atp.Status=draft
Available via configurable
c(SRS_MemHwAb_14041)
8.6.3.2 <ApplicationLockNotification>
[SWS_MemAcc_10032]{DRAFT} d
Service Name <ApplicationLockNotification> (draft)
Syntax void <ApplicationLockNotification> (
void
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Address area lock application callback. The function name is configurable.
Tags: atp.Status=draft
Available via configurable
c(SRS_MemHwAb_14055)
9 Sequence Diagrams
MemAcc_Erase()
MemAcc_Erase()
loop Sector
MemAcc_MainFunction()
Mem_Erase()
Mem_Erase()
Mem_MainFunction()
Mem_MainFunction()
Mem_GetJobResult()
Mem_GetJobResult()
MemAcc_MainFunction()
MemAcc_GetJobStatus()
MemAcc_GetJobStatus()
MemAcc_GetJobResult()
MemAcc_GetJobResult()
MemAcc_Erase()
MemAcc_Erase()
loop Sector
MemAcc_MainFunction()
Mem_Erase()
Mem_Erase()
Mem_MainFunction()
Mem_MainFunction()
Mem_GetJobResult()
Mem_GetJobResult()
MemAcc_MainFunction()
<UpperLayer>_JobEndNotification()
<UpperLayer>_JobEndNotification()
MemAcc_Init()
Mem_30_PFls_Init()
Mem_30_PFls_Init()
Mem_30_DFls_Init()
Mem_30_DFls_Init()
MemAcc_Init()
Mem_30_PFls_Init()
Mem_30_PFls_Init()
Mem_30_DFls_Init()
Mem_30_DFls_Init()
MemAcc_Init()
MemAcc_Init()
MemAcc_Erase()
MemAcc_Erase()
loop Sector
Mem_Erase()
Mem_Erase()
Mem_MainFunction()
Mem_MainFunction()
Mem_GetJobResult()
Mem_GetJobResult()
MemAcc_MainFunction()
MemAcc_GetJobStatus()
MemAcc_GetJobStatus()
MemAcc_Erase()
MemAcc_Erase()
MemAcc_MainFunction()
Mem_Erase()
Mem_Erase()
MemAcc_MainFunction()
Mem_MainFunction()
Mem_MainFunction()
MemAcc_MainFunction()
Mem_GetJobResult()
Mem_GetJobResult()
MemAcc_MainFunction()
MemAcc_GetJobStatus()
MemAcc_GetJobStatus()
MemAcc_RequestLock()
<ApplicationLockNotification>()
Read()
Read()
MemAcc_ReleasetLock()
MemAcc_ReleasetLock()
10 Configuration Specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification chapter 10.1 describes fundamentals. It
also specifies a template (table) you shall use for the parameter specification. We
intend to leave chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
MemAcc.
Chapter 10.3 specifies published information of the module MemAcc.
10.2.1 MemAcc
defaultValue = true
lowerMultiplicity = 1 MemAcc64BitSupport:
upperMultiplicity = 1 EcucBooleanParamDef
maxLength = 32
minLength = 1
lowerMultiplicity = 0
upperMultiplicity = *
MemAccAddressAreaConfiguration:
+container
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = 65535
Included Containers
Container Name Multiplicity Scope / Dependency
MemAccAddressAreaConfiguration 1..65535 This container includes the configuration of AddressArea specific
parameters for the MemAcc module.
An AddressArea is a logical area of memory. Upper layers only
use logical addresses to access the address area. It is the job of
MemAcc to map between logical and physical addresses. An
AddressArea contains SubAddressAreas and each SubAddress
Area is part of a physically continuous memory area (sector
batch).
MemAccGeneral 1 General configuration parameters of the MemAcc.
4
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: local
No Included Containers
10.2.2 MemAccAddressAreaConfiguration
MemAccAddressAreaId:
MemAcc: EcucModuleDef EcucIntegerParamDef
MemAccAddressAreaPriority:
upperMultiplicity = 1 min = 0
EcucIntegerParamDef
lowerMultiplicity = 0 max = 65535
defaultValue = 0 min = 0
lowerMultiplicity = 1 max = 65535
+container upperMultiplicity = 1 defaultValue = 0
+parameter
symbolicNameValue = true lowerMultiplicity = 1
MemAccAddressAreaConfiguration: +parameter
upperMultiplicity = 1
EcucParamConfContainerDef
lowerMultiplicity = 1 MemAccJobEndNotificationName:
upperMultiplicity = 65535 +parameter EcucFunctionNameDef MemAccBufferAlignmentValue:
EcucIntegerParamDef
lowerMultiplicity = 1
upperMultiplicity = 1 min = 0
max = 255
+parameter lowerMultiplicity = 1
upperMultiplicity = 1
MemAccNumberOfSectors:
+subContainer EcucIntegerParamDef
MemAccSubAddressAreaConfiguration: min = 1
EcucParamConfContainerDef +parameter max = 4294967295
defaultValue = 1
lowerMultiplicity = 1 MemAccLogicalStartAddress:
lowerMultiplicity = 1
upperMultiplicity = 65536 EcucIntegerParamDef
upperMultiplicity = 1
+parameter
min = 0
max = 18446744073709551615
MemAccSectorOffset: defaultValue = 0
EcucIntegerParamDef lowerMultiplicity = 1
+parameter upperMultiplicity = 1
min = 0
max = 4294967295
defaultValue = 0 MemAccNumberOfEraseRetries:
lowerMultiplicity = 1 EcucIntegerParamDef
upperMultiplicity = 1 +parameter min = 0
max = 255
defaultValue = 0
MemAccUseEraseBurst: lowerMultiplicity = 0
upperMultiplicity = 1
+parameter EcucBooleanParamDef
defaultValue = false
lowerMultiplicity = 1
MemAccUseWriteBurst:
upperMultiplicity = 1
EcucBooleanParamDef
+parameter
defaultValue = false
MemAccUseReadBurst: lowerMultiplicity = 1
upperMultiplicity = 1
+parameter EcucBooleanParamDef
defaultValue = false MemAccNumberOfWriteRetries:
lowerMultiplicity = 1 EcucIntegerParamDef
upperMultiplicity = 1
+parameter min = 0
max = 255
defaultValue = 0
MemAccMemNamePrefix: lowerMultiplicity = 0
+parameter
EcucStringParamDef upperMultiplicity = 1
lowerMultiplicity = 1
upperMultiplicity = 1
MemSectorBatch:
EcucParamConfContainerDef
MemAccSectorBatchRef: +destination
+reference lowerMultiplicity = 1
EcucReferenceDef
upperMultiplicity = *
lowerMultiplicity = 1
(from Mem)
upperMultiplicity = 1
DIRECT_STATIC:
+literal EcucEnumerationLiteralDef
MemAccMemInvocation:
EcucEnumerationParamDef
defaultValue = DIRECT_STATIC
+literal INDIRECT_STATIC:
+parameter lowerMultiplicity = 1
EcucEnumerationLiteralDef
upperMultiplicity = 1
+literal
INDIRECT_DYNAMIC:
EcucEnumerationLiteralDef
Included Containers
Container Name Multiplicity Scope / Dependency
MemAccSubAddressArea 1..65536 This container includes the configuration parameters for a
Configuration physically continuous area of memory.
10.2.3 MemAccSubAddressAreaConfiguration
4
Post-build time X VARIANT-POST-BUILD
Configuration Parameters
4
Link time –
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
4
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time –
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers