AUTOSAR SWS NVRAMManager
AUTOSAR SWS NVRAMManager
AUTOSAR CP R22-11
• Removed NvM_GetActiveService
API
AUTOSAR • Remove EcuMfixed completely
2018-10-31 4.4.0 Release • Changed single and multi block
Management callbacks
• minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
• Correction for write protection and
erase requests for
AUTOSAR NvMWriteBlockOnce blocks
2017-12-08 4.3.1 Release • Clarification regarding implicit
Management recovery of dataset blocks
• minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
• Added NvM_FirstInitAll and NvM_
GetActiveService functionalities
AUTOSAR • NvM_SetRamBlockStatus works also
2016-11-30 4.3.0 Release for explicit synchronization blocks
Management • The interaction between NvM and
BswM is clarified.
• Other small clarifications and
updates.
• Clarified behavior related to restoring
default data for blocks and for
handling of MEMIF_BLOCK_
INVALID job result
AUTOSAR • Added additional information related
2015-07-31 4.2.2 Release to the block states in chapter
Management 7.2.2.14 and related subchapters
• Updated NvM_Init and NvM_
ValidateAll function prototypes
• Debugging support marked as
obsolete
• Detailed pass/fail conditions for
production errors
AUTOSAR • Added the NvM_ValidateAll
2014-10-31 4.2.1 Release functionality
Management • Updated return values for Init and
SingleBlock callbacks
• Other small clarifications
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 12
3 Related documentation 15
3.1 Input documents & related standards and norms . . . . . . . . . . . . 15
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4 Constraints and assumptions 17
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3 Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5 Dependencies to other modules 18
5.1 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.1 Header file structure . . . . . . . . . . . . . . . . . . . . . . . 18
5.2 Memory abstraction modules . . . . . . . . . . . . . . . . . . . . . . . 18
5.3 CRC module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.4 Capability of the underlying drivers . . . . . . . . . . . . . . . . . . . . 18
6 Requirements Tracing 19
7 Functional specification 27
7.1 Basic architecture guidelines . . . . . . . . . . . . . . . . . . . . . . . 27
7.1.1 Layer structure . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.1.2 Addressing scheme for the memory hardware abstraction . . 27
7.1.2.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . 28
7.1.3 Basic storage objects . . . . . . . . . . . . . . . . . . . . . . 29
7.1.3.1 NV block . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.1.3.2 RAM block . . . . . . . . . . . . . . . . . . . . . . . . 30
7.1.3.3 ROM block . . . . . . . . . . . . . . . . . . . . . . . 31
7.1.3.4 Administrative block . . . . . . . . . . . . . . . . . . 32
7.1.3.5 NV Block Header . . . . . . . . . . . . . . . . . . . . 32
7.1.4 Block management types . . . . . . . . . . . . . . . . . . . . 33
7.1.4.1 Block management types overview . . . . . . . . . . 33
7.1.4.2 NVRAM block structure . . . . . . . . . . . . . . . . 34
7.1.4.3 NVRAM block descriptor table . . . . . . . . . . . . . 34
7.1.4.4 Native NVRAM block . . . . . . . . . . . . . . . . . . 35
7.1.4.5 Redundant NVRAM block . . . . . . . . . . . . . . . 35
7.1.4.6 Dataset NVRAM block . . . . . . . . . . . . . . . . . 37
7.1.4.7 NVRAM Manager API configuration classes . . . . . 38
7.1.5 Scan order / priority scheme . . . . . . . . . . . . . . . . . . 41
7.2 General behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7.2.1 Functional requirements . . . . . . . . . . . . . . . . . . . . . 42
7.2.2 Design notes . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8.2.1 NvM_ConfigType . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.2.2 NvM_MultiBlockRequestType . . . . . . . . . . . . . . . . . . 82
8.3 Function definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.3.1 Synchronous requests . . . . . . . . . . . . . . . . . . . . . . 82
8.3.1.1 NvM_Init . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.3.1.2 NvM_SetDataIndex . . . . . . . . . . . . . . . . . . . 83
8.3.1.3 NvM_GetDataIndex . . . . . . . . . . . . . . . . . . 84
8.3.1.4 NvM_SetBlockProtection . . . . . . . . . . . . . . . . 85
8.3.1.5 NvM_GetErrorStatus . . . . . . . . . . . . . . . . . . 85
8.3.1.6 NvM_GetVersionInfo . . . . . . . . . . . . . . . . . . 86
8.3.1.7 NvM_SetRamBlockStatus . . . . . . . . . . . . . . . 87
8.3.1.8 NvM_SetBlockLockStatus . . . . . . . . . . . . . . . 89
8.3.1.9 NvM_CancelJobs . . . . . . . . . . . . . . . . . . . . 89
8.3.2 Asynchronous single block requests . . . . . . . . . . . . . . 90
8.3.2.1 NvM_ReadBlock . . . . . . . . . . . . . . . . . . . . 90
8.3.2.2 NvM_WriteBlock . . . . . . . . . . . . . . . . . . . . 94
8.3.2.3 NvM_RestoreBlockDefaults . . . . . . . . . . . . . . 97
8.3.2.4 NvM_EraseNvBlock . . . . . . . . . . . . . . . . . . 99
8.3.2.5 NvM_InvalidateNvBlock . . . . . . . . . . . . . . . . 100
8.3.2.6 NvM_ReadPRAMBlock . . . . . . . . . . . . . . . . 101
8.3.2.7 NvM_WritePRAMBlock . . . . . . . . . . . . . . . . 104
8.3.2.8 NvM_RestorePRAMBlockDefaults . . . . . . . . . . 106
8.3.3 Asynchronous multi block requests . . . . . . . . . . . . . . . 108
8.3.3.1 NvM_ReadAll . . . . . . . . . . . . . . . . . . . . . . 108
8.3.3.2 NvM_WriteAll . . . . . . . . . . . . . . . . . . . . . . 115
8.3.3.3 NvM_CancelWriteAll . . . . . . . . . . . . . . . . . . 118
8.3.3.4 NvM_ValidateAll . . . . . . . . . . . . . . . . . . . . 119
8.3.3.5 NvM_FirstInitAll . . . . . . . . . . . . . . . . . . . . . 120
8.3.3.6 Callback notifications . . . . . . . . . . . . . . . . . . 124
8.4 Scheduled functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.5 Expected interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
8.5.1 Mandatory Interfaces . . . . . . . . . . . . . . . . . . . . . . 127
8.5.2 Optional Interfaces . . . . . . . . . . . . . . . . . . . . . . . . 127
8.5.3 Configurable interfaces . . . . . . . . . . . . . . . . . . . . . 128
8.6 API Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
8.7 Service Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
8.7.1 Client-Server-Interfaces . . . . . . . . . . . . . . . . . . . . . 133
8.7.1.1 NvM_Admin . . . . . . . . . . . . . . . . . . . . . . . 133
8.7.1.2 NvM_Mirror . . . . . . . . . . . . . . . . . . . . . . . 133
8.7.1.3 NvM_NotifyInitBlock . . . . . . . . . . . . . . . . . . 134
8.7.1.4 NvM_NotifyJobFinished . . . . . . . . . . . . . . . . 135
8.7.1.5 NvM_Service . . . . . . . . . . . . . . . . . . . . . . 136
8.7.2 Implementation Data Types . . . . . . . . . . . . . . . . . . . 140
8.7.2.1 ImplementationDataType NvM_RequestResultType . 140
8.7.2.2 ImplementationDataType NvM_BlockIdType . . . . . 141
8.7.2.3 ImplementationDataType NvM_InitBlockRequestType 141
3 Related documentation
[1] Glossary
AUTOSAR_TR_Glossary
[2] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[3] Layered Software Architecture
AUTOSAR_EXP_LayeredSoftwareArchitecture
[4] Specification of EEPROM Abstraction
AUTOSAR_SWS_EEPROMAbstraction
[5] Specification of Flash EEPROM Emulation
AUTOSAR_SWS_FlashEEPROMEmulation
[6] Specification of Memory Abstraction Interface
AUTOSAR_SWS_MemoryAbstractionInterface
[7] Specification of CRC Routines
AUTOSAR_SWS_CRCLibrary
[8] Specification of EEPROM Driver
AUTOSAR_SWS_EEPROMDriver
[9] Specification of Flash Driver
AUTOSAR_SWS_FlashDriver
[10] Requirements on I/O Hardware Abstraction
AUTOSAR_SRS_IOHWAbstraction
[11] Requirements on Memory Services
AUTOSAR_SRS_MemoryServices
[12] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral
[13] Requirements on Software Component Template
AUTOSAR_RS_SoftwareComponentTemplate
[14] Specification of RTE Software
AUTOSAR_SWS_RTE
Thus, the specification SWS BSW General shall be considered as additional and re-
quired specification for NVRAMManager.
4.1 Limitations
Limitations are given mainly by the finite number of "Block Management Types" and
their individual treatment of NV data. These limits can be reduced by an enhanced
user defined management information, which can be stored as a structured part of
the real NV data. In this case the user defined management information has to be
interpreted and handled by the application at least.
4.3 Conflicts
The NvM can be configured to use functionality from other modules or integrator code.
Examples include the en/decryption of block data using Csm or the compression of
block data. It is the responsibility of the integrator to ensure that:
• the required functionality is available at the time NvM uses it (e.g. the called
Csm is already initialized [or not yet de-initialized]; needed main functions in
called modules are executed; ...)
• the required time is available (e.g. cryptographic algorithms may need some
time and therefore the read/write functionality of the NvM may take much longer
for blocks which need an en/decryption)
6 Requirements Tracing
The following tables reference the requirements specified in [10], [11], [12] 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
[SRS_BSW_00005] Modules of the µC Abstraction [SWS_NvM_NA_00744]
Layer (MCAL) may not have
hard coded horizontal interfaces
[SRS_BSW_00006] The source code of software [SWS_NvM_NA_00744]
modules above the µC
Abstraction Layer (MCAL) shall
not be processor and compiler
dependent.
[SRS_BSW_00007] All Basic SW Modules written in [SWS_NvM_NA_00744]
C language shall conform to the
MISRA C 2012 Standard.
[SRS_BSW_00009] All Basic SW Modules shall be [SWS_NvM_NA_00744]
documented according to a
common standard.
[SRS_BSW_00010] The memory consumption of all [SWS_NvM_NA_00744]
Basic SW Modules shall be
documented for a defined
configuration for all supported
platforms.
[SRS_BSW_00101] The Basic Software Module shall [SWS_NvM_00399] [SWS_NvM_00400]
be able to initialize variables and
hardware in a separate
initialization function
[SRS_BSW_00160] Configuration files of AUTOSAR [SWS_NvM_NA_00744]
Basic SW module shall be
readable for human beings
[SRS_BSW_00161] The AUTOSAR Basic Software [SWS_NvM_NA_00744]
shall provide a microcontroller
abstraction layer which provides
a standardized interface to
higher software layers
[SRS_BSW_00162] The AUTOSAR Basic Software [SWS_NvM_NA_00744]
shall provide a hardware
abstraction layer
[SRS_BSW_00164] The Implementation of interrupt [SWS_NvM_NA_00744]
service routines shall be done
by the Operating System,
complex drivers or modules
[SRS_BSW_00168] SW components shall be tested [SWS_NvM_NA_00744]
by a function defined in a
common API in the Basis-SW
[SRS_BSW_00170] The AUTOSAR SW Components [SWS_NvM_NA_00744]
shall provide information about
their dependency from faults,
signal qualities, driver demands
7 Functional specification
Hint: According to [SWS_NvM_00051], the NvM module allows for a (theoretical) max-
imum of 65536 logical blocks, each logical block having a (theoretical) maximum size
of 64 Kbytes.
[SWS_NvM_00122] dThe NvM module shall further subdivide the 16bit Fee/Ea block
number into the following parts:
• NV block base number (NVM_NV_BLOCK_BASE_NUMBER) with a bit width of
(16 -NVM_DATASET_SELECTION_BITS)
• Data index with a bit width of (NVM_DATASET_SELECTION_BITS)
c(SRS_Mem_00041, SRS_Mem_08014, SRS_Mem_00016, SRS_Mem_00017,
SRS_Mem_00018)
[SWS_NvM_00343] dHandling/addressing of redundant NVRAM blocks shall be done
towards the memory hardware abstraction in the same way like for dataset NVRAM
blocks, i.e. the redundant NV blocks shall be managed by usage of the configuration
parameter NvMDatasetSelectionBits.c()
[SWS_NvM_00123] dThe NV block base number (NVM_NV_BLOCK_BASE_NUM-
BER) shall be located in the most significant bits of the Fee/Ea block number.c(SRS_-
Mem_08000)
[SWS_NvM_00442] dThe configuration tool shall configure the block identifiers.c
(SRS_Mem_08000, SRS_Mem_00027, SRS_Mem_08014)
[SWS_NvM_00443] dThe NvM module shall not modify the configured block identi-
fiers.c()
7.1.2.1 Examples
To clarify the previously described addressing scheme which is used for NVRAM man-
ager ↔ memory hardware abstraction interaction, the following examples shall help to
understand the correlations between the configuration parameters NvMNvBlockBase
Number, NvMDatasetSelectionBits on NVRAM manager side and EA_BLOCK_NUM-
BER / FEE_BLOCK_NUMBER on memory hardware abstraction side (see 10.2.3).
For the given examples A and B a simple formula is used:
FEE/EA_BLOCK_NUMBER = (NvMNvBlockBaseNumber << NvMDatasetSelection
Bits) + DataIndex.
Example A:
• The configuration parameter NvMDatasetSelectionBits is configured to be 2. This
leads to the result that 14 bits are available as range for the configuration param-
eter NvMNvBlockBaseNumber.
• Range of NvMNvBlockBaseNumber: 0x1..0x3FFE
7.1.3.1 NV block
Note: This figure does not show the physical memory layout of an NV block. Only the
logical clustering is shown.
[SWS_NvM_00126] dThe RAM block is a basic storage object and represents an area
in RAM consisting of user data and (optionally) a CRC value and (optionally) a NV
block header.c()
[SWS_NvM_00127] dRestrictions on CRC usage on RAM blocks. CRC is only avail-
able if the corresponding NV block(s) also have a CRC. CRC has to be of the same
type as that of the corresponding NV block(s).c()
Note: For more information on Crc configuration, see chapter 10.2.3.
[SWS_NvM_00129] dThe user data area of a RAM block can reside in a different RAM
address location (global data section) than the state of the RAM block.c()
[SWS_NvM_00130] dThe data area of a RAM block shall be accessible from NVRAM
Manager and from the application side (data passing from/to the corresponding NV
block).c()
Note: This figure does not show the physical memory layout of a RAM block. Only the
logical clustering is shown.
As the NvM module doesn’t support alignment, this could be managed by configu-
ration, i.e. the block length could be enlarged by adding padding to meet alignment
requirements.
[SWS_NvM_00373] dThe RAM block data shall contain the permanently or temporarily
assigned user data.c()
[SWS_NvM_00370] dIn case of permanently assigned user data, the address of the
RAM block data is known during configuration time.c()
[SWS_NvM_00372] dIn case of temporarily assigned user data, the address of the
RAM block data is not known during configuration time and will be passed to the NvM
module during runtime.c()
[SWS_NvM_00088] dIt shall be possible to allocate each RAM block without address
constraints in the global RAM area. The whole number of configured RAM blocks
needs not be located in a continuous address space.c()
[SWS_NvM_00020] dThe ROM block is a basic storage object, resides in the ROM
(FLASH) and is used to provide default data in case of an empty or damaged NV
block.c()
[SWS_NvM_00134] dThe Administrative block shall be located in RAM and shall con-
tain a block index which is used in association with Dataset NV blocks. Additionally, at-
tribute/error/status information of the corresponding NVRAM block shall be contained.c
()
[SWS_NvM_00128] dThe NvM module shall use state information of the permanent
RAM block or of the RAM mirror in the NvM module in case of explicit syncronization
(invalid/valid) to determine the validity of the permanent RAM block user data.c()
[SWS_NvM_00132] dThe RAM block state "invalid" indicates that the data area of the
respective RAM block is invalid. The RAM block state "valid" indicates that the data
area of the respective RAM block is valid.c(SRS_Mem_08547)
[SWS_NvM_00133] dThe value of "invalid" shall be represented by all other values
except "valid".c()
[SWS_NvM_00135] dThe Administrative block shall be invisible for the application and
is used exclusively by the NvM module for security and administrative purposes of the
RAM block and the NVRAM block itself.c()
[SWS_NvM_00054] dThe NvM module shall use an attribute field to manage the NV
block write protection in order to protect/unprotect a NV block data field.c()
[SWS_NvM_00136] dThe NvM module shall use an error/status field to manage the
error/status value of the last request.c()
• RAM Blocks: 1
• ROM Blocks: 0..1
• Administrative Blocks:1
c()
[SWS_NvM_00559] dNVM_BLOCK_DATASET type of NVRAM storage shall consist
of the following basic storage objects:
• NV Blocks: 1..(m<256)*
• RAM Blocks: 1
• ROM Blocks: 0..n
• Administrative Blocks:1
• * The number of possible datasets depends on the configuration parameter Nv
MDatasetSelectionBits.
c()
[SWS_NvM_00138] dThe NVRAM block shall consist of the mandatory basic storage
objects NV block, RAM block and Administrative block.c()
[SWS_NvM_00139] dThe basic storage object ROM block is optional.c()
[SWS_NvM_00140] dThe composition of any NVRAM block is fixed during configura-
tion by the corresponding NVRAM block descriptor.c()
[SWS_NvM_00141] dAll address offsets are given relatively to the start addresses of
RAM or ROM in the NVRAM block descriptor. The start address is assumed to be
zero.c()
Hint: A device specific base address or offset will be added by the respective device
driver if needed.
For details of the NVRAM block descriptor see chapter 7.1.4.3.
[SWS_NvM_00069] dA single NVRAM block to deal with will be selected via the NvM
module API by providing a subsequently assigned Block ID.c()
[SWS_NvM_00143] dAll structures related to the NVRAM block descriptor table and
their addresses in ROM (FLASH) have to be generated during configuration of the Nv
M module.c()
The Native NVRAM block is the simplest block management type. It allows storage to/
retrieval from NV memory with a minimum of overhead.
[SWS_NvM_00000] dThe Native NVRAM block consists of a single NV block, RAM
block and Administrative block.c()
In addition to the Native NVRAM block, the Redundant NVRAM block provides en-
hanced fault tolerance, reliability and availability. It increases resistance against data
corruption.
[SWS_NvM_00001] dThe Redundant NVRAM block consists of two NV blocks, a RAM
block and an Administrative block.c()
The following figure reflects the internal structure of a redundant NV block:
Note: This figure does not show the physical NV memory layout of a redundant NVRAM
block. Only the logical clustering is shown.
[SWS_NvM_00531] dIn case one NV Block associated with a Redundant NVRAM
block is deemed invalid (e.g. during read), an attempt shall be made to recover the
NV Block using data from the incorrupt NV Block.c()
[SWS_NvM_00546] dIn case the recovery fails then this shall be reported to the DEM
using the code NVM_E_LOSS_OF_REDUNDANCY.c()
Note: "Recovery" denotes the re-establishment of redundancy. This usually means
writing the recovered data back to the NV Block.
The Dataset NVRAM block is an array of equally sized data blocks (NV/ROM). The
application can at one time access exactly one of these elements.
[SWS_NvM_00006] dThe Dataset NVRAM block consists of multiple NV user data,
(optionally) CRC areas, (optional) NV block headers, a RAM block and an Administra-
tive block.c()
[SWS_NvM_00144] dThe index position of the dataset is noticed via a separated field
in the corresponding Administrative block.c()
[SWS_NvM_00374] dThe NvM module shall be able to read all assigned NV blocks.c()
[SWS_NvM_00375] dThe NvM module shall only be able to write to all assigned NV
blocks if (and only if) write protection is disabled.c()
[SWS_NvM_00146] dIf the basic storage object ROM block is selected as optional
part, the index range which normally selects a dataset is extended to the ROM to make
it possible to select a ROM block instead of a NV block. The index covers all NV/ROM
blocks which may build up the NVRAM Dataset block.c()
[SWS_NvM_00376] dThe NvM module shall be able to only read optional ROM blocks
(default datasets).c()
[SWS_NvM_00377] dThe NvM module shall treat a write to a ROM block like a write
to a protected NV block.c()
[SWS_NvM_00444] dThe total number of configured datasets (NV+ROM blocks) shall
be in the range of 1..255.c()
[SWS_NvM_00445] dIn case of optional ROM blocks, data areas with an index from 0
up to NvMNvBlockNum - 1 represent the NV blocks with their CRC in the NV memory.
Data areas with an index from NvMNvBlockNum up to NvMNvBlockNum + NvMRom
BlockNum - 1 represent the ROM blocks.c()
Note: This figure does not show the physical NV memory layout of a Dataset NVRAM
block. Only the logical clustering is shown.
[SWS_NvM_00149] dTo have the possibility to adapt the NvM module to limited hard-
ware resources, three different API configuration classes shall be defined:
• API configuration class 3: All specified API calls are available. A maximum of
functionality is supported.
c()
[SWS_NvM_00561] dAPI configuration class 2 shall consist of the following API:
• Type 1:
• NvM_SetDataIndex(...)
• NvM_GetDataIndex(...)
• NvM_GetErrorStatus(...)
• NvM_SetRamBlockStatus(...)
• NvM_SetBlockLockStatus(...)
• Type 2:
• NvM_ReadBlock(...)
• NvM_WriteBlock(...)
• NvM_RestoreBlockDefaults(...)
• NvM_CancelJobs(...)
• NvM_ReadPRAMBlock(...)
• NvM_WritePRAMBlock(...)
• NvM_RestorePRAMBlockDefaults(...)
• Type 3:
• NvM_ReadAll(...)
• NvM_WriteAll(...)
• NvM_CancelWriteAll(...)
• NvM_ValidatedAll(...)
• Type 4:
• NvM_Init(...)
c()
[SWS_NvM_00562] dAPI configuration class 1 shall consist of the following API:
• Type 1:
• NvM_GetErrorStatus(...)
• NvM_SetRamBlockStatus(...)
• NvM_SetBlockLockStatus(...)
• Type 2:
• –
• Type 3:
• NvM_ReadAll(...)
• NvM_WriteAll(...)
• NvM_CancelWriteAll(...)
• Type 4:
• NvM_Init(...)
• Note: For API configuration class 1 no queues are needed, no immediate data
can be written. Furthermore the API call NvM_SetRamBlockStatus is only avail-
able if configured by NvMSetRamBlockStatusApi.
c()
[SWS_NvM_00365] dWithin API configuration class 1, the block management type
NVM_BLOCK_DATASET is not supported.c()
For information regarding the definition of Type 1. . . 4 refer to chapter 8.6.
[SWS_NvM_00150] dThe NvM module shall only contain that code that is needed to
handle the configured block types.c()
[SWS_NvM_00032] dThe NvM module shall support a priority based job processing.c
(SRS_Mem_08542)
[SWS_NvM_00564] dBy configuration parameter NvMJobPrioritization priority based
job processing shall be enabled/disabled.c(SRS_Mem_08542)
Note: For more information on parameter NvMJobPrioritization, see chapter 10.2.2.
[SWS_NvM_00378] dIn case of priority based job processing order, the NvM module
shall use two queues, one for immediate write jobs (crash data) another for all other
jobs (including immediate read/erase jobs).c(SRS_Mem_08542)
[SWS_NvM_00379] dIf priority based job processing is disabled via configuration, the
NvM module shall not support immediate write jobs. In this case, the NvM module
processes all jobs in FCFS order.c()
[SWS_NvM_00380] dThe job queue length for multi block requests originating from
any of the NvM_ReadAll, NvM_ValidateAll, NvM_FirstInitAll and NvM_WriteAll APIs
shall be one (only one multi block job is queued).c()
[SWS_NvM_00381] dThe NvM module shall not interrupt jobs originating from the Nv
M_ReadAll request by other requests.c()
[SWS_NvM_00692] dThe application accesses the RAM data directly, with respect to
given restrictions (e.g. synchronization).c()
[SWS_NvM_00385] dThe NvM module shall queue all asynchronous "single block"
read/write/control requests if the block with its specific ID is not already queued or
currently in progress (multitasking restrictions).c()
[SWS_NvM_00386] dThe NvM module shall accept multiple asynchronous "single
block" requests as long as no queue overflow occurs.c()
[SWS_NvM_00155] dThe highest priority request shall be fetched from the queues by
the NvM module and processed in a serialized order.c()
[SWS_NvM_00040] dThe NvM module shall implement implicit mechanisms for con-
sistency / integrity checks of data saved in NV memory [SWS_NvM_00165].c()
Depending on implementation of the memory stack, callback routines provided and/or
invoked by the NvM module may be called in interrupt context.
Hint: The NvM module providing routines called in interrupt context has therefore to
make sure that their runtime is reasonably short.
[SWS_NvM_00085] dIf there is no default ROM data available at configuration time or
no callback defined by NvMInitBlockCallback then the application shall be responsible
for providing the default initialization data.c()
Note: In this case, the application has to use NvM_GetErrorStatus() to be able to
distinguish between first initialization and corrupted data (see 10.2.3).
[SWS_NvM_00387] dDuring processing of NvM_ReadAll, the NvM module shall be
able to detect corrupted RAM data by performing a checksum calculation. [ECUC_Nv
M_00476].c()
[SWS_NvM_00226] dDuring processing of NvM_ReadAll, the NvM module shall be
able to detect invalid RAM data by testing the validity of a data within the administrative
block [ECUC_NvM_00476].c()
[SWS_NvM_00388] dDuring startup phase and normal operation of NvM_ReadAll and
if the NvM module has detected an unrecoverable error within the NV block, the NvM
module shall copy default data (if configured) to the corresponding RAM block.c()
[SWS_NvM_00332] dTo make use of the OS services, the NvM module shall only use
the BSW scheduler instead of directly making use of OS objects and/or related OS
services.c(SRS_BSW_00429)
[SWS_NvM_00985] dThe NvM module shall use the internal mirror as a buffer for all
operations that read and write the RAM block of the NVRAM blocks with configured
permanent RAM (or RAM passed by API parameter) for which the RAM (start) is not
aligned to the NvMBufferAlignmentValue.c()
[SWS_NvM_00162] dThe NvM module shall receive the requests via an asynchronous
interface using a queuing mechanism. The NvM module shall process all requests
serially depending on their priority.c(SRS_Mem_00013, SRS_Mem_00034)
[SWS_NvM_00047] dThe NvM module shall provide techniques for error recovery. The
error recovery depends on the NVRAM block management type [SWS_NvM_00001].c
()
[SWS_NvM_00389] dThe NvM module shall provide error recovery on read for every
kind of NVRAM block management type by loading of default values.c()
[SWS_NvM_00390] dThe NvM module shall provide error recovery on read for NVRAM
blocks of block management type NVM_BLOCK_REDUNDANT by loading the RAM
block with default values.c()
[SWS_NvM_00168] dThe NvM module shall provide error recovery on write by per-
forming write retries regardless of the NVRAM block management type.c()
[SWS_NvM_00169] dThe NvM module shall provide read error recovery on startup for
all NVRAM blocks with configured RAM block CRC in case of RAM block revalidation
failure.c()
[SWS_NvM_00171] dThe NvM module shall provide implicit and explicit recovery
techniques to restore ROM data to its corresponding RAM block in case of unre-
coverable data inconsistency of a NV block [SWS_NvM_00387], [SWS_NvM_00226],
[SWS_NvM_00388].c(SRS_Mem_08549, SRS_Mem_08010)
[SWS_NvM_00574] dThe implicit recovery shall not be provided during startup (part
of NvM_ReadAll), neither by NvM_ReadBlock nor by NvM_ReadPRAMBlock for each
NVRAM block for the following conditions:
• The default data is configured (by the parameter NvMRomBlockDataAddress or
the parameter NvMInitBlockCallback).
• The permanent RAM block or the content of the RAM mirror in the NvM module (
in case of explicit synchronization) state is invalid and CRC (data) is inconsistent.
• Read attempt from NV succeeds.
c()
[SWS_NvM_00575] dThe implicit recovery shall be provided during startup (part of Nv
M_ReadAll) and by NvM_ReadBlock or NvM_ReadPRAMBlock for each NVRAM block
for the following conditions:
• The default data is configured (by the parameter NvMRomBlockDataAddress or
the parameter NvMInitBlockCallback).
• The permanent RAM block state or the content of the RAM mirror in the NvM
module ( in case of explicit synchronization) is invalid and CRC (data) is incon-
sistent.
• Read attempt from NV fails.
c()
[SWS_NvM_00951] dImplicit recovery shall be provided during NvM_ReadBlock() or
NvM_ReadPRAMBlock() requests for NVRAM blocks of type NVM_BLOCK_NATIVE
and NVM_BLOCK_REDUNDANT.c(SRS_Mem_00018)
[SWS_NvM_00391] dFor explicit recovery with ROM block data the NvM module shall
provide functions NvM_RestoreBlockDefaults and NvM_RestorePRAMBlockDefaults
[SWS_NvM_00012] to restore ROM data to its corresponding RAM block.c()
[SWS_NvM_00392] dThe function NvM_RestoreBlockDefaults and NvM_Restore
PRAMBlockDefaults shall remain unmodified the data content of the corresponding
NV block.
Hint: The function NvM_RestoreBlockDefaults or NvM_RestorePRAMBlockDefaults
shall be used by the application to restore ROM data to the corresponding RAM block
every time it is needed.c()
[SWS_NvM_00393] dThe NvM module shall use a separate variable to store the result
of an asynchronous multi block request (NvM_ReadAll, NvM_WriteAll including NvM_
CancelWriteAll, NvM_ValidateAll).c()
[SWS_NvM_00394] dThe function NvM_GetErrorStatus [SWS_NvM_00015] shall re-
turn the most recent error/status information of an asynchronous multi block request
(including NvM_CancelWriteAll) in conjunction with a reserved block ID value of 0.c()
[SWS_NvM_00395] dThe result of a multi block request shall represent only a common
error/status information.c()
[SWS_NvM_00396] dThe multi block requests provided by the NvM module shall indi-
cate their detailed error/status information in the designated error/status field of each
affected Administrative block.c()
[SWS_NvM_00179] dThe optional configuration parameter NvMMultiBlockCallback
configures the notification via callback on the termination of an asynchronous multi
block request.c()
Note: For more information on NvMMultiBlockCallback, see chapter 10.2.2.
The NvM module shall offer different kinds of write protection which shall be config-
urable. Every kind of write protection is only related to the NV part of NVRAM block,
i.e. the RAM block data can be modified but not be written to NV memory.
[SWS_NvM_00325] dEnabling/Disabling of the write protection is allowed using NvM_
SetBlockProtection function when the NvMWriteBlockOnce is FALSE regardless of the
value (True/False) configured for NvMBlockWriteProt.c(SRS_Mem_08009)
[SWS_NvM_00577] dEnabling/Disabling of the write protection is not allowed using Nv
M_SetBlockProtection function when the NvMWriteBlockOnce is TRUE regardless of
the value (True/False) configured for NvMBlockWriteProt.c(SRS_Mem_08009)
[SWS_NvM_00326] dFor all NVRAM blocks configured with NvMBlockWriteProt =
TRUE, the NvM module shall enable a default write protection.c(SRS_Mem_08009)
[SWS_NvM_00578] dThe NvM module’s environment can explicitly disable the write
protection using the NvM_SetBlockProtection function.c()
[SWS_NvM_00397] dFor NVRAM blocks configured with NvMWriteBlockOnce ==
TRUE [ECUC_NvM_00072], the NvM module shall only write once to the associated
NV memory, i.e in case of a blank NV device.c(SRS_Mem_08015)
This chapter shall give summarized information regarding the internal handling of
NVRAM Manager status bits. Depending on different API calls, the influence on the
status of RAM blocks shall be described in addition to the specification items located
in chapter 8.3. The following figures depict the state transitions of RAM blocks.
Since entering and preserving a state can be done based on multiple conditions and
placing them all in the above figure would make it difficult to understand, more detailed
explanations are provided in the following subchapters. The INVALID / CHANGED
state is not detailed as it can never be reached (as mentioned in the figure above).
After the Initialization the RAM Block is in state INVALID/UNCHANGED until it is up-
dated via NvM_ReadAll, which causes a transition to state VALID/UNCHANGED. In
this state WriteAll is not allowed. This state is left, if the NvM_SetRamBlockStatus is
invoked. If there occurs a CRC error the RAM Block changes to state INVALID again,
which than can be left via the implicit or explicit error recovery mechanisms. After error
recovery the block is in state VALID/CHANGED as the content of the RAM differs from
the NVRAM content.
[SWS_NvM_00344] dIf the API for modifying the RAM block status has been disabled
in configuration (via NvMSetRamBlockStatusApi or NvMBlockUseSetRamBlockStatus)
the NvM module shall treat a RAM block or the RAM mirror in the NvM module (in case
of explicit synchronization) as valid and changed when writing data in the correspond-
ing NV block, i.e. during NvM_WriteAll, the NvM module shall write each permanent
RAM block to NV memory.c(SRS_Mem_08550)
[SWS_NvM_00345] dIf the API for modifying the RAM block status has been disabled
in configuration (via NvMSetRamBlockStatusApi or NvMBlockUseSetRamBlockStatus)
the NvM module shall treat a RAM block as invalid when reading data from NV block,
i.e. during NvM_ReadAll, the NvM module shall copy each NVRAM block to RAM if
configured accordingly.c(SRS_Mem_08550)
[SWS_NvM_00696] dIn case of an unsuccessful block read attempt, it is the respon-
sibility of the application to provide valid data before the next write attempt.c(SRS_-
Mem_08550)
[SWS_NvM_00472] dIn case a RAM block is successfully copied to NV memory the
RAM block state shall be set to "valid/unmodified" afterwards.c(SRS_Mem_08541)
This state implies that the contents of the RAM Block are either identical to the contents
of the corresponding NV Block or - if the application has accessed the RAM Block - a
potential change was not yet indicated. For a DATASET block these conditions apply to
he RAM contents of the instance that was last processed. Also, the last block operation
was successful and the block was not invalidated by request.
To enter the VALID / UNCHANGED state, at least of the following has to occur:
1. NvM_ReadAll() read successfully the block
2. NvM_ReadBlock finished successfully for the block
3. NvM_WriteBlock finished successfully for the block
4. NvM_WriteAll() wrote successfully the block
The VALID / UNCHANGED state is preserved while:
• the last read or write for a BlockID was successful (no error and no retrieval of
default data)
AND
• the application has not indicated a potential change of RAM block since last read
or write
This state implies that the contents of the RAM Block potentially differ from the contents
of the corresponding NV Block. For a DATASET block this condition applies to the
RAM contents of the instance that was last processed. Also, the last operation for the
block was successsful and the block was not invalidated by request. The block owner
can signal a potential RAM contents changed for the block causing the block state to
become VALID / CHANGED.
To enter the VALID / CHANGED state, at least one of the following has to occur:
1. NvM_SetRamBlockStatus called with TRUE for the block
2. NvM_WriteBlock is called for the block
3. NvM_WriteAll will also process the block
4. NvM_ReadBlock called for the block gives default data
5. NvM_RestoreBlockDefaults called for the block finishes successfully
6. NvM_ReadAll gives default data when processign the block
7. NvM_ValidateAll processed successfully the block
The VALID / CHANGED state is preserved while:
• a block owner has indicated a potential change of RAM block
OR
• default data was retrieved (implicitly or explicitly) for the block upon last read
This state implies that the NV Block is invalid. For a DATASET block this means that
the NV Block contents are invalid for the last instance that was processed.
To enter the INVALID / UNCHANGED state, at least one of the following has to occur:
1. NvM_SetRamBlockStatus called with FALSE for the block
2. NvM_ReadBlock indicates invalidation by user request for the block
3. NvM_ReadBlock indicates corrupted data (if CRC configured) for the block
4. NvM_ReadBlock indicates wrong StaticID (if configured) for the block
5. NvM_WriteBlock finished non-successfully for the block
6. NvM_WriteAll non-successful write for the block
7. NvM_InvalidateNvBlock finished successfully for the block
This request may be triggered only by the BSW Mode Manager at system startup.
This request fills all configured permanent RAM blocks with necessary data for startup.
If the request fails or the request is handled only partially successful, the NVRAM-
Manager signals this condition to the DEM and returns an error to the BSW Mode
Manager. The DEM and the BSW Mode Manager have to decide about further mea-
sures that have to be taken. These steps are beyond the scope of the NvM module
and are handled in the specifications of DEM and BSW Mode Manager.
[SWS_NvM_00701] dApplications have to adhere to the following rules during multi
block read requests for implicit synchronization between application and NVRAM man-
ager:
The BSW Mode Manager issues the NvM_ReadAll.
1. The BSW Mode Manager can use polling to get the status of the request or can
be informed via a callback function.
2. During NvM_ReadAll, a single block callback (if configured) will be invoked after
having completely processed a NVRAM block. These callbacks enable the RTE
to start each SW-C individually.
c()
This request should only be triggered by the BSW Mode Manager at shutdown of the
system. This request writes the contents of all modified permanent RAM blocks to NV
memory. By calling this request only during ECU shutdown, the BSW Mode Manager
can ensure that no SW component is able to modify data in the RAM blocks until the
end of the operation. These measures are beyond the scope of the NvM module and
are handled in the specifications of the BSW Mode Manager.
[SWS_NvM_00702] dApplications have to adhere to the following rules during multi
block write requests for implicit synchronization between application and NVRAM man-
ager:
1. The BSW Mode Manager issues the NvM_WriteAll request which transfers con-
trol to the NvM module.
2. The BSW Mode Manager can use polling to get the status of the request or can
be informed via a callback function.
c()
In contrast to the implicit synchronization between the application and the NvM module
(see section 7.2.2.15) an optional (i.e. configurable) explicit synchronization mech-
anism is available. It is realized by a RAM mirror in the NvM module. The data is
transferred by the application in both directions via callback routines, called by the Nv
M module.
Here is a short analysis of this mechanism:
The advantage is that applications can control their data in a better way. They are
responsible for copying consistent data to and from the NvM module’s RAM mirror, so
they know the point in time. The RAM block is never in an inconsistent state due to
concurrent accesses.
The drawbacks are the additional RAM which needs to have the same size as the
largest NVRAM block that uses this mechanism and the necessity of an additional
copy between two RAM locations for every operation.
This mechanism especially enables the sharing of NVRAM blocks by different applica-
tions, if there is a module that synchronizes these applications and is the owner of the
NVRAM block from the NvM module’s perspective.
[SWS_NvM_00511] dFor every NVRAM block there shall be the possibility to configure
the usage of an explicit synchronization mechanism by the parameter NvMBlockUse
SyncMechanism.c()
[SWS_NvM_00512] dThe NvM module shall not allocate a RAM mirror if no block is
configured to use the explicit synchronization mechanism.c()
[SWS_NvM_00513] dThe NvM module shall allocate only one RAM mirror if at least
one block is configured to use the explicit synchronization mechanism. This RAM mirror
should not exceed the size of the longest NVRAM block configured to use the explicit
synchronization mechanism.c()
[SWS_NvM_00514] dThe NvM module shall use the internal mirror as buffer for all
operations that read and write the RAM block of those NVRAM blocks with NvMBlock
UseSyncMechanism == TRUE. The buffer should not be used for the other NVRAM
blocks.c()
[SWS_NvM_00515] dThe NvM module shall call the routine NvMWriteRamBlockToNv
Callback in order to copy the data from the RAM block to the mirror for all NVRAM
blocks with NvMBlockUseSyncMechanism == TRUE. This routine shall not be used for
the other NVRAM blocks.c()
[SWS_NvM_00516] dThe NvM module shall call the routine NvMReadRamBlockFrom
NvCallback in order to copy the data from the mirror to the RAM block for all NVRAM
blocks with NvMBlockUseSyncMechanism == TRUE. This routine shall not be used for
the other NVRAM blocks.c()
[SWS_NvM_00517] dDuring a single block request if the routines NvMReadRamBlock
FromNvCallback return E_NOT_OK, then the NvM module shall retry the routine call
NvMRepeatMirrorOperations times. Thereafter the single block read job shall set the
block specific request result to NVM_REQ_NOT_OK and shall report NVM_E_REQ_
FAILED to the DEM.c()
[SWS_NvM_00839] dIn the case the NvMReadRamBlockFromNvCallback routine re-
turns E_NOT_OK, the NvM module shall retry the routine call in the next call of the Nv
M_MainFunction.c()
[SWS_NvM_00579] dDuring a single block request if the routines NvMWriteRamBlock
ToNvCallback return E_NOT_OK, then the NvM module shall retry the routine call Nv
MRepeatMirrorOperations times. Thereafter the single block write job shall set the
block specific request result to NVM_REQ_NOT_OK and shall report NVM_E_REQ_
FAILED to the DEM.c()
[SWS_NvM_00840] dIn the case the NvMWriteRamBlockToNvCallback routine returns
E_NOT_OK, the NvM module shall retry the routine call in the next call of the NvM_
MainFunction.c()
[SWS_NvM_00837] dDuring a multi block request (NvM_WriteAll) if the routines Nv
MWriteRamBlockToNvCallback return E_NOT_OK, then the NvM module shall retry
the routine call NvMRepeatMirrorOperations times. Thereafter the job of the function
NvM_WriteAll shall set the block specific request result to NVM_REQ_NOT_OK and
shall report NVM_E_REQ_FAILED to the DEM.c()
[SWS_NvM_00838] dDuring a multi block request (NvM_ReadAll) if the routines Nv
MReadRamBlockFromNvCallback return E_NOT_OK, then the NvM module shall retry
the routine call NvMRepeatMirrorOperations times. Thereafter the job of the function
NvM_ReadAll shall set the block specific request result to NVM_REQ_NOT_OK and
shall report NVM_E_REQ_FAILED to the DEM.c()
[SWS_NvM_00904] dIf a block has explicit synchronization configured for it then it shall
not have a permanent RAM image configured.c(SRS_Mem_08534)
The following two sections clarify the differences when using the explicit synchroniza-
tion mechanism, compare to 7.2.2.17.1 and 7.2.2.17.2.
3. The application might modify the RAM block until the routine NvMReadRamBlock
FromNvCallback is called by the NvM module.
4. If the routine NvMReadRamBlockFromNvCallback is called by the NvM module,
then the application copy the data from the destination given by the NvM module
to the RAM block.The application can use the return value E_NOT_OK in order
to signal that data was not copied. The NvM module will accept this NvMRepeat
MirrorOperations times and then postpones the request and continues with its
next request.
5. Continuation only if data was copied from the NvM module:
6. Now the application finds the NV block values in the RAM block.
7. The application can use polling to get the status of the request or can be informed
via a callback routine.
Note: The application may combine several read requests to different positions in one
NV block, if NvM_ReadBlock or NvM_ReadPRAMBlock was requested, but not yet
processed by the NvM module. The request was not processed, if the callback routine
NvMReadRamBlockFromNvCallback was not called.
Note: NvM_RestoreBlockDefaults and NvM_RestorePRAMBlockDefaults works simi-
larly to NvM_ReadBlock.c()
This request may be triggered only by the BSW Mode Manager at system startup. This
request fills all configured permanent RAM blocks with necessary data for startup.
If the request fails or the request is handled only partially successful, the NVRAM-
Manager signals this condition to the DEM and returns an error to the BSW Mode
Manager. The DEM and the BSW Mode Manager have to decide about further mea-
sures that have to be taken. These steps are beyond the scope of the NvM module
and are handled in the specifications of DEM and BSW Mode Manager.
Normal operation:
1. The BSW Mode Manager issues the NvM_ReadAll.
2. The BSW Mode Manager can use polling to get the status of the request or can
be informed via a callback function.
3. During NvM_ReadAll job, if a synchronization callback (NvM_ReadRamBlock
FromNvm) is configured for a block it will be called by the NvM module. In this
callback the application shall copy the data from the destination given by the Nv
M module to the RAM block.The application can use the return value E_NOT_OK
in order to signal that data was not copied. The NvM module will accept this Nv
MRepeatMirrorOperations times and then report the read operation as failed.
4. Now the application finds the NV block values in the RAM block if the read oper-
ation was successful.
5. During NvM_ReadAll, a single block callback (if configured) will be invoked after
having completely processed a NVRAM block. These callbacks enable the RTE
to start each SW-C individually.
6. After processing of the last block and calling its single block callback (if config-
ured), the multi block callback (if configured) will be invoked.
This request should only be triggered by the BSW Mode Manager at shutdown of the
system. This request writes the contents of all modified permanent RAM blocks to NV
memory. By calling this request only during ECU shutdown, the BSW Mode Manager
can ensure that no SW component is able to modify data in the RAM blocks until the
end of the operation. These measures are beyond the scope of the NvM module and
are handled in the specifications of the BSW Mode Manager.
Normal operation:
1. The BSW Mode Manager issues the NvM_WriteAll request which transfers con-
trol to the NvM module.
2. During NvM_WriteAll job, if a synchronization callback (NvM_WriteRamBlockTo
NvM) is configured for a block it will be called by the NvM module. In this call-
back the application has to provide a consistent copy of the RAM block to the
destination requested by the NvM module.
The application can use the return value E_NOT_OK in order to signal that data
was not consistent. The NvM module will accept this NvMRepeatMirrorOpera-
tions times and then report the write operation as failed.
3. Now the application can read and write the RAM block again.
4. The BSW Mode Manager can use polling to get the status of the request or can
be informed via a callback function.
Note: NVRAM Manager stores the NV Block Header including the Static Block ID in
the NV Block each time the block is written to NV memory. When a block is read, its
Static Block ID is compared to the requested block ID. This permits to detect hardware
failures which cause a wrong block to be read.
[SWS_NvM_00523] dThe NVRAM Manager shall store the Static Block ID field of the
Block Header each time the block is written to NV memory.c(SRS_Mem_08555)
[SWS_NvM_00524] dThe NVRAM Manager shall check the Block Header each time
the block is read from NV memory.c(SRS_Mem_08555)
[SWS_NvM_00525] dIf the Static Block ID check fails then the failure NVM_E_
WRONG_BLOCK_ID is reported to DEM.c()
[SWS_NvM_00580] dIf the Static Block ID check fails then the read error recovery is
initiated. Hint: A check shall be made during configuration to ensure that all Static
Block IDs are unique.c()
[SWS_NvM_00526] dIf the NVRAM manager detects a failure during a read operation
from NV memory, a CRC error then one or more additional read attempts shall be
made, as configured by NVM_MAX_NUM_OF_READ_RETRIES, before continuing to
read the redundant NV Block.c(SRS_Mem_08554)
[SWS_NvM_00581] dIf the NVRAM manager detects a failure during a read operation
from NV memory, a CRC error then one or more additional read attempts shall be
made, as configured by NVM_MAX_NUM_OF_READ_RETRIES, before continuing to
read the ROM Block.c(SRS_Mem_08554)
[SWS_NvM_00582] dIf the NVRAM manager detects a failure during a read operation
from NV memory, a Static Block ID check then one or more additional read attempts
shall be made, as configured by NVM_MAX_NUM_OF_READ_RETRIES, before con-
tinuing to read the redundant NV Block.c(SRS_Mem_00129)
[SWS_NvM_00583] dIf the NVRAM manager detects a failure during a read operation
from NV memory, a Static Block ID check then one or more additional read attempts
shall be made, as configured by NVM_MAX_NUM_OF_READ_RETRIES, before con-
tinuing to read the ROM Block.c()
When a RAM Block is written to NV memory the NV block shall be immediately read
back and compared with the original content in RAM Block if the behaviour is enabled
by NVM_WRITE_VERIFICATION.
[SWS_NvM_00527] dComparison between original content in RAM Block and the
block read back shall be performed in steps so that the number of bytes read and com-
pared is not greater than as specified by the configuration parameter NVM_WRITE_
VERIFICATION_DATA_SIZE.c(SRS_Mem_08554, SRS_Mem_08556)
[SWS_NvM_00528] dIf the original content in RAM Block is not the same as read back
then the production code error NVM_E_VERIFY_FAILED shall be reported to DEM.c
(SRS_Mem_08556)
[SWS_NvM_00529] dIf the original content in RAM Block is not the same as read
back then write retries shall be performed as specified in this document.c(SRS_Mem_-
08554, SRS_Mem_08556)
[SWS_NvM_00530] dIf the read back operation fails then no read retries shall be per-
formed.c()
[SWS_NvM_00897] dIf the original content in RAM Block is not the same as read
back, for the initial write attempt as well as for all the configured retries, then NvM shall
set as request result NVM_REQ_NOT_OK.c(SRS_Mem_00017, SRS_Mem_08554,
SWS_NvM_08541, SRS_Mem_00030, SRS_Mem_08556)
[SWS_NvM_00753] dIf the function NvM_SetBlockLockStatus was called with the pa-
rameter BlockLocked as FALSE, the NvM shall guarantee normal processing of this
NVRAM block as specified by AUTOSAR.c()
[SWS_NvM_00754] dThe BlockLocked setting made using the function NvM_SetBlock
LockStatus shall not be changeable by NvM_SetRamBlockStatus, nor by NvM_Set
BlockProtection.c()
Save new Data for an NVRAM block via diagnostic services into NV memory. These
data shall be made available to the SW-C(s) with next ECU start-up, i.e. they shall
neither be overwritten by a request originating from an SW-C, nor be overwritten with
permanent RAM block’s data during shut-down (NvM_WriteAll).
The block data is compressed before it is written to NV memory. The type of compres-
sion (block split, compression, delta) is vendor-specific.
The use-case is for larger data blocks with changes of only smaller junks (like drive-
cycle logging). The goal is that not the whole block needs to be written to NV memory
to reduce the overall write-cycles.
The block split would divide the block in multiple sub-blocks and only the changed sub-
blocks would be written. Alternatively, only the changed delta could be written. Anyway,
any data compression algorithm could be used.
The drawback is always a higher runtime for writing or reading the data.
For security purposes NvM supports synchronous encryption and decryption via CSM
module using symmetric 16 byte aligned algorithms, e.g. AES128.
The user always works with plain data, the NV RAM stores the ciphered data:
> Write data: NvM encrypts the plain user data and then forwards the ciphered data to
the device.
> Read data: NvM reads the ciphered data from device, decrypts the data and finally
provides the plain data to the user.
To check the integrity of the ciphered data a CRC can be configured (as usual). NvM
will then calculate the CRC over encrypted data and recalculate and check the CRC
before decryption: the CRC always matches the ciphered data.
[SWS_NvM_00976] dIn case NvMBlockCipheringRef is given, the NvM shall before
forwarding the write request to MemIf encrypt the plain data using Csm_Encrypt() with
the CSM job given in NvMCsmEncryptionJobReference.
The CRC calculation (if configured) shall be done over the encrypted data.c()
[SWS_NvM_00977] dIn case Csm_Encrypt() returns a CRYPTO_E_BUSY, the NvM
shall retry to redo the job. After NvMCsmRetryCounter times of retry the NvM shall
abort the write job and set the NvM result to NVM_REQ_NOT_OK and signal an error
via NvM_JobErrorNotification().c()
[SWS_NvM_00978] dIn case Csm_Encrypt() returns any other error than CRYPTO_
E_BUSY or CRYPTO_E_OK, the NvM shall abort the write job and set the NvM result
to NVM_REQ_NOT_OK and signal an error via NvM_JobErrorNotification().c()
[SWS_NvM_00979] dIn case Csm_Encrypt() returns successfully with CRYPTO_E_
OK, the NvM shall continue the write job (e.g. with the CRC calculation) with the new
length given in NvMNvBlockNVRAMDataLength.
In case of the returned length in resultLengthPtr is different to the NvMNvBlock
NVRAMDataLength the development error NVM_E_BLOCK_CHIPHER_LENGTH_
MISSMATCH shall be triggerd.c()
[SWS_NvM_00980] dIn case NvMBlockCipheringRef is given, the NvM shall before
forwarding the read request to application decrypt the stored data using Csm_Decrypt()
with the CSM job given in NvMCsmDecryptionJobReference. The CRC check (if con-
figured) shall be done over the encrypted data. If the CRC does not match, NvM will
not decrypt the data but abort the job with NVM_REQ_INTEGRITY_FAILED.c()
[SWS_NvM_00981] dIn case Csm_Decrypt() returns a CRYPTO_E_BUSY, the NvM
shall retry to redo the job. After NvMCsmRetryCounter times of retry the NvM shall
abort the read job and set the NvM result to NVM_REQ_NOT_OK and signal an error
via NvM_JobErrorNotification().c()
[SWS_NvM_00982] dIn case Csm_Decrypt() returns any other error than CRYPTO_
E_BUSY or CRYPTO_E_OK, the NvM shall abort the read job and set the NvM result
to NVM_REQ_NOT_OK and signal an error via NvM_JobErrorNotification().c()
[SWS_NvM_00983] dIn case Csm_Decrypt() returns successfully with CRYPTO_E_
OK, the NvM shall continue the read job with the new length given in NvMNvBlock
Length.
In case of the returned length in resultLengthPtr is different to the NvMNvBlockLength
the development error NVM_E_BLOCK_CHIPHER_LENGTH_MISSMATCH shall be
triggerd.c()
[SWS_NvM_91004] d
Type of error Related error code Error value
API is called with wrong parameter block ID NVM_E_PARAM_BLOCK_ID 0x0A
API is called with wrong parameter block data NVM_E_PARAM_BLOCK_DATA_IDX 0x0C
API is called with wrong parameter address NVM_E_PARAM_ADDRESS 0x0D
API is called with wrong parameter data NVM_E_PARAM_DATA 0x0E
API is called with wrong parameter pointer NVM_E_PARAM_POINTER 0x0F
API is called for a block without defaults when NVM_E_BLOCK_WITHOUT_DEFAULTS 0x11
either the NvM_RestoreBlockDeafults or NvM_
RestorePRAMBlockDefaults is called for a valid
block ID that has no default data and no NvMInit
BlockCallback configured for the block
API is called when NVRAM manager is not NVM_E_UNINIT 0x14
initialized yet
read/write/control API is called for a block which is NVM_E_BLOCK_PENDING 0x15
already listed or in progress
Service is not possible with this block configuration NVM_E_BLOCK_CONFIG 0x18
write API is called for a block which RAM block is NVM_E_BLOCK_LOCKED 0x19
locked
write/erase/invalidate API is called for a block with NVM_E_WRITE_ONCE_STATUS_UNKNOWN 0x1A
MVM_WRITE_BLOCK_ONCE (TRUE) prior to the
first read request for that block
The length resulting from encryption or decription NVM_E_BLOCK_CHIPHER_LENGTH_ 0x1B
do not match with the given length in the MISSMATCH
configuration.
[SWS_NvM_00599] dIf development error detection is enabled for NvM module, the
function NvM_SetDataIndex shall report the DET error NVM_E_PARAM_BLOCK_
DATA_IDX when DataIndex parameter exceeds the total number of configured datasets
(Check: [SWS_NvM_00444], [SWS_NvM_00445]).c()
[SWS_NvM_00601] dIf development error detection is enabled for NvM module, the
function NvM_SetDataIndex shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00602] dIf development error detection is enabled for NvM module, the
function NvM_GetDataIndex shall report the DET error NVM_E_UNINIT when NVM
not yet initialized.c()
[SWS_NvM_00604] dIf development error detection is enabled for NvM module, the
function NvM_GetDataIndex shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00605] dIf development error detection is enabled for NvM module, the
function NvM_GetDataIndex shall report the DET error NVM_E_PARAM_DATA when
a NULL pointer is passed via the parameter DataIndexPtr.c()
[SWS_NvM_00606] dIf development error detection is enabled for NvM module, the
function NvM_SetBlockProtection shall report the DET error NVM_E_UNINIT when
NVM is not yet initialized.c()
[SWS_NvM_00607] dIf development error detection is enabled for NvM module, the
function NvM_SetBlockProtection shall report the DET error NVM_E_BLOCK_PEND-
ING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00608] dIf development error detection is enabled for NvM module, the
function NvM_SetBlockProtection shall report the DET error NVM_E_BLOCK_CON-
FIG when the NVRAM block is configured with NvMWriteBlockOnce = TRUE.c()
[SWS_NvM_00609] dIf development error detection is enabled for NvM module,
the function NvM_SetBlockProtection shall report the DET error NVM_E_PARAM_
BLOCK_ID when the passed BlockID is out of range.c()
[SWS_NvM_00759] dIf development error detection is enabled for NvM module,
the function NvM_SetBlockProtection shall report the DET error NVM_E_BLOCK_
LOCKED when the block is locked.c()
[SWS_NvM_00610] dIf development error detection is enabled for NvM module, the
function NvM_GetErrorStatus shall report the DET error NVM_E_UNINIT when NVM
is not yet initialized.c()
[SWS_NvM_00611] dIf development error detection is enabled for NvM module, the
function NvM_GetErrorStatus shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00612] dIf development error detection is enabled for NvM module, the
function NvM_GetErrorStatus shall report the DET error NVM_E_PARAM_DATA when
a NULL pointer is passed via the parameter RequestResultPtr.c()
[SWS_NvM_00613] dIf development error detection is enabled for NvM module, the
function NvM_GetVersionInfo shall report the DET error NVM_E_PARAM_POINTER
when a NULL pointer is passed via the parameter versioninfo.c()
[SWS_NvM_00614] dIf development error detection is enabled for NvM module, the
function NvM_ReadBlock shall report the DET error NVM_E_UNINIT when NVM is not
yet initialized.c()
[SWS_NvM_00615] dIf development error detection is enabled for NvM module, the
function NvM_ReadBlock shall report the DET error NVM_E_BLOCK_PENDING when
NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00616] dIf development error detection is enabled for NvM module, the
function NvM_ReadBlock shall report the DET error NVM_E_PARAM_ADDRESS
when no permanent RAM block and no explicit synchronization are configured and
a NULL pointer is passed via the parameter NvM_DstPtr.c()
[SWS_NvM_00618] dIf development error detection is enabled for NvM module, the
function NvM_ReadBlock shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00823] dIf development error detection is enabled for NvM module, the
function NvM_ReadPRAMBlock shall report the DET error NVM_E_UNINIT when NVM
is not yet initialized.c()
[SWS_NvM_00824] dIf development error detection is enabled for NvM module, the
function NvM_ReadPRAMBlock shall report the DET error NVM_E_BLOCK_PEND-
ING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00825] dIf development error detection is enabled for NvM module,
the function NvM_ReadPRAMBlock shall report the DET error NVM_E_PARAM_AD-
DRESS when no permanent RAM block and no explicit synchronization are configured,
for the received block ID.c(SRS_Mem_00016, SRS_Mem_00038)
[SWS_NvM_00826] dIf development error detection is enabled for NvM module, the
function NvM_ReadPRAMBlock shall report the DET error NVM_E_PARAM_BLOCK_
ID when the passed BlockID is out of range.c()
[SWS_NvM_00619] dIf development error detection is enabled for NvM module, the
function NvM_WriteBlock shall report the DET error NVM_E_UNINIT when NVM not
yet initialized.c()
[SWS_NvM_00620] dIf development error detection is enabled for NvM module, the
function NvM_WriteBlock shall report the DET error NVM_E_BLOCK_PENDING when
NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00622] dIf development error detection is enabled for NvM module,
the function NvM_WriteBlock shall report the DET error NVM_E_PARAM_ADDRESS
when no permanent RAM block and no explicit synchronization are configured and
a NULL pointer is passed via the parameter NvM_SrcPtr.c(SRS_Mem_00017, SRS_-
Mem_08541)
[SWS_NvM_00624] dIf development error detection is enabled for NvM module, the
function NvM_WriteBlock shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00748] dIf development error detection is enabled for NvM module, the
function NvM_WriteBlock shall report the DET error NVM_E_BLOCK_LOCKED when
the block is locked.c(SRS_Mem_08541, SRS_Mem_00127, SRS_Mem_00038)
[SWS_NvM_00827] dIf development error detection is enabled for NvM module, the
function NvM_WritePRAMBlock shall report the DET error NVM_E_UNINIT when NVM
not yet initialized.c()
[SWS_NvM_00828] dIf development error detection is enabled for NvM module, the
function NvM_WritePRAMBlock shall report the DET error NVM_E_BLOCK_PEND-
ING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00893] dIf development error detection is enabled for NvM module,
the function NvM_WritePRAMBlock shall report the DET error NVM_E_PARAM_AD-
DRESS when no permanent RAM block and no explicit synchronization are config-
ured.c(SRS_Mem_00018, SRS_Mem_08548)
[SWS_NvM_00829] dIf development error detection is enabled for NvM module, the
function NvM_WritePRAMBlock shall report the DET error NVM_E_PARAM_BLOCK_
ID when the passed BlockID is out of range.c()
[SWS_NvM_00830] dIf development error detection is enabled for NvM module, the
function NvM_WritePRAMBlock shall report the DET error NVM_E_BLOCK_LOCKED
when the block is locked.c()
[SWS_NvM_00625] dIf development error detection is enabled for NvM module, the
function NvM_RestoreBlockDefaults shall report the DET error NVM_E_UNINIT when
NVM is not yet initialized.c()
[SWS_NvM_00626] dIf development error detection is enabled for NvM module,
the function NvM_RestoreBlockDefaults shall report the DET error NVM_E_BLOCK_
PENDING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00894] dIf development error detection is enabled for NvM module,
the function NvM_RestorePRAMBlockDefaults shall report the DET error NVM_E_
PARAM_ADDRESS when no permanent RAM block and no explicit synchronization
are configured.c(SRS_Mem_00018, SRS_Mem_08548)
[SWS_NvM_00629] dIf development error detection is enabled for NvM module, the
function NvM_RestoreBlockDefaults shall report the DET error NVM_E_PARAM_AD-
DRESS when no permanent RAM block and no explicit synchronization are configured
and a NULL pointer is passed via the parameter NvM_DstPtr.c(SRS_Mem_00016,
SRS_Mem_08548)
[SWS_NvM_00630] dIf development error detection is enabled for NvM module,
the function NvM_RestoreBlockDefaults shall report the DET error NVM_E_PARAM_
BLOCK_ID when the passed BlockID is out of range.c()
[SWS_NvM_00831] dIf development error detection is enabled for NvM module, the
function NvM_RestorePRAMBlockDefaults shall report the DET error NVM_E_UNINIT
when NVM is not yet initialized.c()
[SWS_NvM_00832] dIf development error detection is enabled for NvM module,
the function NvM_RestorePRAMBlockDefaults shall report the DET error NVM_E_
BLOCK_PENDING when NVRAM block identifier is already queued or currently in
progress.c()
[SWS_NvM_00834] dIf development error detection is enabled for NvM module,
the function NvM_RestorePRAMBlockDefaults shall report the DET error NVM_E_
PARAM_BLOCK_ID when the passed BlockID is out of range.c()
[SWS_NvM_00631] dIf development error detection is enabled for NvM module, the
function NvM_EraseNvBlock shall report the DET error NVM_E_UNINIT when the
NVM is not yet initialized.c()
[SWS_NvM_00632] dIf development error detection is enabled for NvM module, the
function NvM_EraseNvBlock shall report the DET error NVM_E_BLOCK_PENDING
when the NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00635] dIf development error detection is enabled for NvM module, the
function NvM_EraseNvBlock shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00636] dIf development error detection is enabled for NvM module, the
function NvM_EraseNvBlock shall report the DET error NVM_E_BLOCK_CONFIG
when the NVRAM block has not immediate priority.c()
[SWS_NvM_00757] dIf development error detection is enabled for NvM module, the
function NvM_EraseNvBlock shall report the DET error NVM_E_BLOCK_LOCKED
when the block is locked.c()
[SWS_NvM_00637] dIf development error detection is enabled for NvM module, the
function NvM_CancelWriteAll shall report the DET error NVM_E_UNINIT when NVM
is not yet initialized.c()
[SWS_NvM_00638] dIf development error detection is enabled for NvM module, the
function NvM_InvalidateNvBlock shall report the DET error NVM_E_UNINIT when
NVM is not yet initialized.c()
[SWS_NvM_00639] dIf development error detection is enabled for NvM module, the
function NvM_InvalidateNvBlock shall report the DET error NVM_E_BLOCK_PEND-
ING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00642] dIf development error detection is enabled for NvM module, the
function NvM_InvalidateNvBlock shall report the DET error NVM_E_PARAM_BLOCK_
ID when the passed BlockID is out of range.c()
[SWS_NvM_00756] dIf development error detection is enabled for NvM module, the
function NvM_InvalidateNvBlock shall report the DET error NVM_E_BLOCK_LOCKED
when the block is locked.c()
[SWS_NvM_00643] dIf development error detection is enabled for NvM module, the
function NvM_SetRamBlockStatus shall report the DET error NVM_E_UNINIT when
NVM not yet initialized.c()
[SWS_NvM_00644] dIf development error detection is enabled for NvM module, the
function NvM_SetRamBlockStatus shall report the DET error NVM_E_BLOCK_PEND-
ING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00645] dIf development error detection is enabled for NvM module,
the function NvM_SetRamBlockStatus shall report the DET error NVM_E_PARAM_
BLOCK_ID when the passed BlockID is out of range.c()
[SWS_NvM_00758] dIf development error detection is enabled for NvM module,
the function NvM_SetRamBlockStatus shall report the DET error NVM_E_BLOCK_
LOCKED when the block is locked.c()
[SWS_NvM_00646] dIf development error detection is enabled for NvM module, the
function NvM_ReadAll shall report the DET error NVM_E_UNINIT when NVM is not
yet initialized.c()
[SWS_NvM_00647] dIf development error detection is enabled for NvM module, the
function NvM_WriteAll shall report the DET error NVM_E_UNINIT when NVM is not
yet initialized.c()
[SWS_NvM_00648] dIf development error detection is enabled for NvM module, the
function NvM_CancelJobs shall report the DET error NVM_E_UNINIT when NVM is
not yet initialized.c()
[SWS_NvM_00649] dIf development error detection is enabled for NvM module, the
function NvM_CancelJobs shall report the DET error NVM_E_PARAM_BLOCK_ID
when the passed BlockID is out of range.c()
[SWS_NvM_00728] dIf development error detection is enabled for NvM module, the
function NvM_SetBlockLockStatus shall report the DET error NVM_E_UNINIT when
NVM is not yet initialized.c()
[SWS_NvM_00729] dIf development error detection is enabled for NvM module, the
function NvM_SetBlockLockStatus shall report the DET error NVM_E_BLOCK_PEND-
ING when NVRAM block identifier is already queued or currently in progress.c()
[SWS_NvM_00730] dIf development error detection is enabled for NvM module, the
function NvM_SetBlockLockStatus shall report the DET error NVM_E_BLOCK_CON-
FIG when the NVRAM block is configured with NvMWriteBlockOnce = TRUE.c()
[SWS_NvM_00731] dIf development error detection is enabled for NvM module,
the function NvM_SetBlockLockStatus shall report the DET error NVM_E_PARAM_
BLOCK_ID when the passed BlockID is out of range.c()
[SWS_NvM_00863] dIf development error detection is enabled for NvM module, the
function NvM_ValidateAll shall report the DET error NVM_E_UNINIT when NVM is not
yet initialized.c(SRS_Mem_00137)
[SWS_NvM_00954] dIf development error detection is enabled for NvM module, the
function NvM_WriteBlock shall report the DET error NVM_E_WRITE_ONCE_STA-
TUS_UNKNOWN when a write request is made for a block configured with NVM_
WRITE_BLOCK_ONCE (TRUE) for which no read request was made prior to this.c()
[SWS_NvM_00955] dIf development error detection is enabled for NvM module, the
function NvM_WritePRAMBlock shall report the DET error NVM_E_WRITE_ONCE_
STATUS_UNKNOWN when a write request is made for a block configured with NVM_
WRITE_BLOCK_ONCE (TRUE) for which no read request was made prior to this.c()
[SWS_NvM_00956] dIf development error detection is enabled for NvM module, the
job of the function NvM_WriteAll shall report the DET error NVM_E_WRITE_ONCE_
STATUS_UNKNOWN when the processing of a block configured with NVM_WRITE_
BLOCK_ONCE (TRUE) for which no read request was made prior to this.c()
[SWS_NvM_00957] dIf development error detection is enabled for NvM module, the
job of the function NvM_EraseNvBlock shall report the DET error NVM_E_WRITE_
ONCE_STATUS_UNKNOWN when a write request is made for a block configured with
NVM_WRITE_BLOCK_ONCE (TRUE) for which no read request was made prior to
this.c()
[SWS_NvM_00958] dIf development error detection is enabled for NvM module, the
job of the function NvM_InvalidateNvBlock shall report the DET error NVM_E_WRITE_
ONCE_STATUS_UNKNOWN when a write request is made for a block configured with
NVM_WRITE_BLOCK_ONCE (TRUE) for which no read request was made prior to
this.c()
[SWS_NvM_00962] dIf development error detection is enabled for NvM module, the
function NvM_WriteBlock shall report the DET error NVM_E_WRITE_PROTECTED
when the block is write protected.c()
[SWS_NvM_00963] dIf development error detection is enabled for NvM module, the
function NvM_WritePRAMBlock shall report the DET error NVM_E_WRITE_PRO-
TECTED when the block is write protected.c()
[SWS_NvM_00964] dIf development error detection is enabled for NvM module,
the function NvM_EraseNvBlock shall report the DET error NVM_E_WRITE_PRO-
TECTED when the block is write protected.c()
[SWS_NvM_00965] dIf development error detection is enabled for NvM module, the
function NvM_InvalidateNvBlock shall report the DET error NVM_E_WRITE_PRO-
TECTED when the block is write protected.c()
[SWS_NvM_00947] d
Type of error Related error code Error value
NvM queue is full so the request cannot be NVM_E_QUEUE_FULL 0xA0
queued, be the request either standard or
immediate.
c()
[SWS_NvM_00948] dThe run-time error NVM_E_QUEUE_FULL shall be reported to
Det, by the NvM module, each time a request cannot be queued because the related
queue is full.c(SRS_Mem_00038)
7.3.4.1 NVM_E_HARDWARE
[SWS_NvM_00835] d
Error Name: NVM_E_HARDWARE
Short Description: Reading from or writing to non volatile memory failed
Long Description: If read job (multi job or single job read) fails either because the MemIf reports
MEMIF_JOB_FAILED, MEMIF_BLOCK_INCONSISTENT or a CRC mismatch
occurs or if a write/invalidate/erase job fails because the MemIf reports MEMIF_
JOB_FAILED, NvM shall report NVM_E_HARDWARE to the DEM.
Detection Criteria: Fail MemIf reports MEMIF_JOB_FAILED,
MEMIF_BLOCK_INCONSISTENT or a
CRC mismatch occurs during read /
write / invalidate / erase operation.
Pass Read / write / invalidate / erase is
successfull.
(MemIf does not report MEMIF_JOB_
FAILED , MEMIF_BLOCK_
INCONSISTENT and no CRC
mismatch occurs)
Secondary Parameters: The condition under which the FAIL and/or PASS detection is active:
Every time a read / write / invalidate / erase is requested for the block NvM shall
report if the condition of the block changed.
Time Required: Not applicabale. (there is no timeout monitoring in the NvM)
Monitor Frequency continous
c()
7.3.5.1 NVM_E_INTEGRITY_FAILED
7.3.5.2 NVM_E_REQ_FAILED
the first attempt or from one of the retries, and that it finished successfully, from the
point of view of the underlying layer (request result is MEMIF_JOB_OK).c()
7.3.5.3 NVM_E_WRONG_BLOCK_ID
7.3.5.4 NVM_E_VERIFY_FAILED
7.3.5.5 NVM_E_LOSS_OF_REDUNDANCY
8 API specification
c()
8.2.1 NvM_ConfigType
[SWS_NvM_00880] d
Name NvM_ConfigType
Kind Structure
Elements implementation specific
Type –
Comment –
Description Configuration data structure of the NvM module.
Available via NvM.h
c() Since this type is used for compliance purposes only (meaning that NvM_Init will
now have a pointer to this type as parameter, based on SWS_BSW_00047) it will be
left to the developer to chose how to implement it, considering it has no use for the Nv
M module in any way.
8.2.2 NvM_MultiBlockRequestType
[SWS_NvM_91003] d
Name NvM_MultiBlockRequestType
Kind Enumeration
Range NVM_READ_ALL 0x00 NvM_ReadAll was performed
NVM_WRITE_ALL 0x01 NvM_WriteAll was performed
NVM_VALIDATE_ALL 0x02 NvM_ValidateAll was performed
NVM_FIRST_INIT_ALL 0x03 NvM_FirstInitAll was performed
NVM_CANCEL_WRITE_ 0x04 NvM_CancelWriteAll was performed
ALL
Description Identifies the type of request performed on multi block when signaled via the callback function or
when reporting to BswM
Available via NvM.h
c()
8.3.1.1 NvM_Init
[SWS_NvM_00447] d
Service Name NvM_Init
Syntax void NvM_Init (
const NvM_ConfigType* ConfigPtr
)
Service ID [hex] 0x00
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ConfigPtr Pointer to the selected configuration set.
Parameters (inout) None
Parameters (out) None
Return value None
Description Service for resetting all internal variables.
Available via NvM.h
c(SRS_BSW_00414, SWS_BSW_00047)
[SWS_NvM_00881] dThe Configuration pointer ConfigPtr shall always have a NULL_
PTR value.c()
The Configuration pointer ConfigPtr is currently not used and shall therefore be set to
a NULL_PTR value when calling the NvM_Init API.
[SWS_NvM_00399] dThe function NvM_Init shall reset all internal variables, e.g. the
queues, request flags, state machines, to their initial values. It shall signal "INIT DONE"
8.3.1.2 NvM_SetDataIndex
[SWS_NvM_00448] d
Service Name NvM_SetDataIndex
Syntax Std_ReturnType NvM_SetDataIndex (
NvM_BlockIdType BlockId,
uint8 DataIndex
)
Service ID [hex] 0x01
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
DataIndex Index position (association) of a NV/ROM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The index position was set successfully.
E_NOT_OK: An error occurred.
Description Service for setting the DataIndex of a dataset NVRAM block.
Available via NvM.h
c(SRS_Mem_08007)
[SWS_NvM_00014] dThe function NvM_SetDataIndex shall set the index to access a
certain dataset of a NVRAM block (with/without ROM blocks).c()
[SWS_NvM_00263] dThe function NvM_SetDataIndex shall leave the content of the
corresponding RAM block unmodified.c()
8.3.1.3 NvM_GetDataIndex
[SWS_NvM_00449] d
Service Name NvM_GetDataIndex
Syntax Std_ReturnType NvM_GetDataIndex (
NvM_BlockIdType BlockId,
uint8* DataIndexPtr
)
Service ID [hex] 0x02
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) DataIndexPtr Pointer to where to store the current dataset index (0..255)
Return value Std_ReturnType E_OK: The index position has been retrieved successfully.
E_NOT_OK: An error occurred.
Description Service for getting the currently set DataIndex of a dataset NVRAM block
Available via NvM.h
c()
[SWS_NvM_00021] dThe function NvM_GetDataIndex shall get the current index (as-
sociation) of a dataset NVRAM block (with/without ROM blocks).c()
[SWS_NvM_00265] dFor blocks with block management different from NVM_BLOCK_
DATASET, NvM_GetDataIndex shall set the index pointed by DataIndexPtr to zero.
Further, E_NOT_OK shall be returned.c()
[SWS_NvM_00708] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_GetDataIndex.c()
8.3.1.4 NvM_SetBlockProtection
[SWS_NvM_00450] d
Service Name NvM_SetBlockProtection
Syntax Std_ReturnType NvM_SetBlockProtection (
NvM_BlockIdType BlockId,
boolean ProtectionEnabled
)
Service ID [hex] 0x03
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
ProtectionEnabled TRUE: Write protection shall be enabled FALSE: Write protection
shall be disabled
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The block was enabled/disabled as requested
E_NOT_OK: An error occured.
Description Service for setting/resetting the write protection for a NV block.
Available via NvM.h
c(SRS_Mem_00127)
[SWS_NvM_00016] dThe function NvM_SetBlockProtection shall set/reset the write
protection for the corresponding NV block by setting the write protection attribute in the
administrative part of the corresponding NVRAM block.c(SRS_Mem_00127)
[SWS_NvM_00709] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_SetBlockProtection.c()
8.3.1.5 NvM_GetErrorStatus
[SWS_NvM_00451] d
Service Name NvM_GetErrorStatus
Syntax Std_ReturnType NvM_GetErrorStatus (
NvM_BlockIdType BlockId,
NvM_RequestResultType* RequestResultPtr
)
Service ID [hex] 0x04
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
5
4
Parameters (out) RequestResultPtr Pointer to where to store the request result. See NvM_Request
ResultType .
Return value Std_ReturnType E_OK: The block dependent error/status information was read
successfully.
E_NOT_OK: An error occured.
Description Service to read the block dependent error/status information.
Available via NvM.h
c(SRS_Mem_00020)
[SWS_NvM_00015] dThe function NvM_GetErrorStatus shall read the block depen-
dent error/status information in the administrative part of a NVRAM block. The status/
error information of a NVRAM block shall be set by a former or current asynchronous
request.c(SRS_Mem_00020)
[SWS_NvM_00710] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_GetErrorStatus.c()
8.3.1.6 NvM_GetVersionInfo
[SWS_NvM_00452] d
Service Name NvM_GetVersionInfo
Syntax void NvM_GetVersionInfo (
Std_VersionInfoType* versioninfo
)
Service ID [hex] 0x0f
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) versioninfo Pointer to where to store the version information of this module.
Return value None
Description Service to get the version information of the NvM module.
Available via NvM.h
c()
8.3.1.7 NvM_SetRamBlockStatus
[SWS_NvM_00453] d
Service Name NvM_SetRamBlockStatus
Syntax Std_ReturnType NvM_SetRamBlockStatus (
NvM_BlockIdType BlockId,
boolean BlockChanged
)
Service ID [hex] 0x05
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
BlockChanged TRUE: Validate the permanent RAM block or the explicit
synchronization and mark block as changed. FALSE: Invalidate
the permanent RAM block or the explicit synchronization and
mark block as unchanged.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The status of the permanent RAM block or the explicit
synchronization was changed as requested.
E_NOT_OK: An error occurred.
Description Service for setting the RAM block status of a permanent RAM block or the status of the explicit
synchronization of a NVRAM block.
Available via NvM.h
c(SRS_Mem_08545)
[SWS_NvM_00240] dThe function NvM_SetRamBlockStatus shall only work on
NVRAM blocks with a permanently configured RAM block or on NVRAM blocks config-
ured to support explicit synchronization, that have NvMBlockUseSetRamBlockStatus
enabled and shall have no effect to other NVRAM blocks.c(SRS_Mem_08546)
[SWS_NvM_00241] dThe function NvM_SetRamBlockStatus shall assume that a
changed permanent RAM block or the content of the RAM mirror in the NvM module (
in case of explicit synchronization) is valid (basic assumption).c(SRS_Mem_08545)
[SWS_NvM_00405] dWhen the "BlockChanged" parameter passed to the function Nv
M_SetRamBlockStatus is FALSE the corresponding RAM block is either invalid or un-
changed (or both).c(SRS_Mem_08545)
[SWS_NvM_00406] dWhen the "BlockChanged" parameter passed to the function Nv
M_SetRamBlockStatus is TRUE, the corresponding permanent RAM block or the con-
tent of the RAM mirror in the NvM module ( in case of explicit synchronization) is valid
and changed.c()
[SWS_NvM_00121] dFor blocks with a permanently configured RAM, the function Nv
M_SetRamBlockStatus shall request the recalculation of CRC in the background, i.e.
the CRC recalculation shall be processed by the NvM_MainFunction, if the given "Block
Changed" parameter is TRUE and CRC calculation in RAM is configured (i.e. NvMCalc
RamBlockCrc == TRUE).c()
8.3.1.8 NvM_SetBlockLockStatus
[SWS_NvM_00548] d
Service Name NvM_SetBlockLockStatus
Syntax void NvM_SetBlockLockStatus (
NvM_BlockIdType BlockId,
boolean BlockLocked
)
Service ID [hex] 0x13
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
BlockLocked TRUE: Mark the RAM.block as locked FALSE: Mark the
RAM.block as unlocked
Parameters (inout) None
Parameters (out) None
Return value None
Description Service for setting the lock status of a permanent RAM block or of the explicit synchronization
of a NVRAM block.
Available via NvM.h
c(SRS_Mem_08546)
[SWS_NvM_00732] dThe function NvM_SetBlockLockStatus shall only work on
NVRAM blocks with a permanently configured RAM block or on NVRAM blocks con-
figured to support explicit synchronization and shall have no effect to other NVRAM
blocks.
Hint: This function is to be used mainly by DCM, but it can also be used by complex
device drivers. The function is not included in the ServicePort interface.c()
8.3.1.9 NvM_CancelJobs
[SWS_NvM_00535] d
Service Name NvM_CancelJobs
Syntax Std_ReturnType NvM_CancelJobs (
NvM_BlockIdType BlockId
)
Service ID [hex] 0x10
Sync/Async Synchronous
Reentrancy Reentrant
5
4
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: The job was successfully removed from queue.
E_NOT_OK: The job could not be found in the queue.
Description Service to cancel all jobs pending for a NV block.
Available via NvM.h
c(SRS_Mem_08560)
[SWS_NvM_00536] dThe function NvM_CancelJobs shall cancel all jobs pending in
the queue for the specified NV Block. If requested the result type for the canceled
blocks is NVM_REQ_CANCELED.c(SRS_Mem_08560)
[SWS_NvM_00537] dA currently processed job is not canceled, and shall continue
even after the call of NvM_CancelJobs.c()
[SWS_NvM_00225] dThe function NvM_CancelJobs shall set the block specific re-
quest result for the specified NVRAM block to NVM_REQ_CANCELED if the request
is accepted.c()
Hint: The intent is just to empty the queue during the cleanup phase in case of termi-
nation or restart of a partition, to avoid later end of job notification.
[SWS_NvM_00984] dThe function NvM_CancelJobs shall set the canceled block’s
RAM block state to INVALID/UNCHANGED.c()
8.3.2.1 NvM_ReadBlock
[SWS_NvM_00454] d
Service Name NvM_ReadBlock
Syntax Std_ReturnType NvM_ReadBlock (
NvM_BlockIdType BlockId,
void* NvM_DstPtr
)
Service ID [hex] 0x06
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) NvM_DstPtr Pointer to the RAM data block.
5
4
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to copy the data of the NV block to its corresponding RAM block.
Available via NvM.h
c(SRS_LIBS_08533, SRS_Mem_00016)
[SWS_NvM_00010] dThe job of the function NvM_ReadBlock shall copy the data of
the NV block to the corresponding RAM block.c(SRS_Mem_00016)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00195] dThe function NvM_ReadBlock shall take over the given parame-
ters, queue the read request in the job queue and return.c(SRS_Mem_00016)
[SWS_NvM_00196] dIf the function NvM_ReadBlock is provided with a valid RAM
block address then it is used.c(SRS_Mem_00016)
[SWS_NvM_00898] dIf the function NvM_ReadBlock is provided with NULL_PTR as a
RAM block address and it has a permanent RAM block configured then the permanent
RAM block is used.c(SRS_Mem_00016)
[SWS_NvM_00899] dIf the function NvM_ReadBlock is provided with NULL_PTR as a
RAM block address and it has the explicit synchronization configured then the explicit
synchronization is used.c(SRS_Mem_00016)
[SWS_NvM_00278] dThe job of the function NvM_ReadBlock shall provide the possi-
bility to copy NV data to a temporary RAM block although the NVRAM block is config-
ured with a permanent RAM block or explicit synchronization callbacks. In this case,
the parameter NvM_DstPtr has to be unequal to the NULL pointer. Otherwise a DET-
Parameter error (see Section 7.3) shall be emitted.c()
[SWS_NvM_00198] dThe function NvM_ReadBlock shall set the RAM block state to
INVALID/UNCHANGED immediately when the block is successfully enqueued.c()
[SWS_NvM_00199] dThe job of the function NvM_ReadBlock shall initiate a read at-
tempt on the second NV block if the passed BlockId references a NVRAM block of type
NVM_BLOCK_REDUNDANT and the read attempts on the first NV block fail.c()
[SWS_NvM_00340] dIn case of NVRAM block management type NVM_BLOCK_
DATASET, the job of the function NvM_ReadBlock shall copy only that NV block to
the corresponding RAM block which is selected via the data index in the administrative
block.c()
[SWS_NvM_00355] dThe job of the function NvM_ReadBlock shall not copy the NV
block to the corresponding RAM block if the NVRAM block management type is NVM_
BLOCK_DATASET and the NV block selected by the dataset index is invalidate.c()
[SWS_NvM_00651] dThe job of the function NvM_ReadBlock shall not copy the NV
block to the corresponding RAM block if the NVRAM block management type is NVM_
BLOCK_DATASET and the NV block selected by the dataset index is inconsistent.c()
[SWS_NvM_00354] dThe job of the function NvM_ReadBlock shall copy the ROM
block to RAM and set the request result to NVM_REQ_OK if the NVRAM block man-
agement type is NVM_BLOCK_DATASET and the dataset index points at a ROM
block.c()
[SWS_NvM_00200] dThe job of the function NvM_ReadBlock shall set the RAM block
to valid and assume it to be unchanged after a successful copy process of the NV block
to RAM.c()
[SWS_NvM_00366] dThe job of the function NvM_ReadBlock shall set the RAM block
to valid and assume it to be changed if the default values are copied to the RAM
successfully.c()
[SWS_NvM_00206] dThe job of the function NvM_ReadBlock shall set the request
result to NVM_REQ_OK if the NV block was copied successfully from NV memory to
RAM.c()
[SWS_NvM_00341] dThe job of the function NvM_ReadBlock shall set the request re-
sult to NVM_REQ_NV_INVALIDATED if the MemIf reports MEMIF_BLOCK_INVALID.c
()
[SWS_NvM_00652] dThe job of the function NvM_ReadBlock shall report no error to
the DEM if the MemIf reports MEMIF_BLOCK_INVALID.c()
[SWS_NvM_00358] dThe job of the function NvM_ReadBlock shall set the request
result to NVM_REQ_INTEGRITY_FAILED if:
• the MemIf reports MEMIF_BLOCK_INCONSISTENT and
• NvMRomBlockDataAddress is not configured (no ROM block with default data is
available) for the block and
• NvMInitBlockCallback is not configured (no init callback) for the block.
c()
[SWS_NvM_00653] dThe job of the function NvM_ReadBlock shall report NVM_E_
INTEGRITY_FAILED to the DEM if the MemIf reports MEMIF_BLOCK_INCONSIS-
TENT.c()
Note: After the production of an ECU / a car, on the production line all blocks shall have
been written with valid data (may be default data) and all diagnostic events (errors)
shall have been deleted. If the process does not allow to write all NV blocks during
production than the NvM will report diagnostic events (errors) because of blocks that
were never written and reported as MEMIF_BLOCK_INCONSISTENT by MemIf.
[SWS_NvM_00359] dThe job of the function NvM_ReadBlock shall set the request
result to NVM_REQ_NOT_OK if:
[SWS_NvM_00204] dThe job of the function NvM_ReadBlock shall set the request
result to NVM_REQ_INTEGRITY_FAILED if:
• a CRC mismatch occurs and
• NvMRomBlockDataAddress is not configured (no ROM block with default data is
available) for the block and
• NvMInitBlockCallback is not configured (no init callback) for the block.
c()
[SWS_NvM_00712] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_ReadBlock.c()
8.3.2.2 NvM_WriteBlock
[SWS_NvM_00455] d
Service Name NvM_WriteBlock
Syntax Std_ReturnType NvM_WriteBlock (
NvM_BlockIdType BlockId,
const void* NvM_SrcPtr
)
Service ID [hex] 0x07
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
NvM_SrcPtr Pointer to the RAM data block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to copy the data of the RAM block to its corresponding NV block.
Available via NvM.h
c(SRS_Mem_00017)
[SWS_NvM_00410] dThe job of the function NvM_WriteBlock shall copy the data of
the RAM block to its corresponding NV block.c(SRS_Mem_00017)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00749] dThe function NvM_WriteBlock shall return with E_NOT_OK, if a
locked NVRAM block is referenced by the passed BlockId parameter. and a DET error
(see Section 7.3) shall be emitted.c()
[SWS_NvM_00208] dThe function NvM_WriteBlock shall take over the given parame-
ters, queue the write request in the job queue and return.c(SRS_Mem_08541)
[SWS_NvM_00209] dThe function NvM_WriteBlock shall check the NVRAM block pro-
tection when the request is enqueued but not again before the request is executed.c
()
[SWS_NvM_00300] dThe function NvM_WriteBlock shall cancel a pending job imme-
diately in a destructive way if the passed BlockId references a NVRAM block configured
to have immediate priority. The immediate job shall be the next active job to be pro-
cessed.c()
[SWS_NvM_00210] dIf the function NvM_WriteBlock is provided with a valid RAM
block address then it is used.c(SRS_Mem_00017)
[SWS_NvM_00900] dIf the function NvM_WriteBlock is provided with NULL_PTR as a
RAM block address and it has a permanent RAM block configured then the permanent
RAM block is used.c(SRS_Mem_00017)
[SWS_NvM_00901] dIf the function NvM_WriteBlock is provided with NULL_PTR as a
RAM block address and it has the explicit synchronization configured then the explicit
synchronization is used.c(SRS_Mem_00017)
[SWS_NvM_00280] dThe job of the function NvM_WriteBlock shall provide the pos-
sibility to copy a temporary RAM block to a NV block although the NVRAM block is
configured with a permanent RAM block or explicit synchronization callbacks. In this
case, the parameter NvM_SrcPtr has to be unequal to a NULL pointer. Otherwise a
DET-Parameter error (see Section 7.3) shall be emittedc()
[SWS_NvM_00212] dThe job of the function NvM_WriteBlock shall request a CRC
recalculation before the RAM block will be copied to NV memory if the NV block is
configured with CRC [SWS_NvM_00180].c()
[SWS_NvM_00852] dThe job of the function NvM_WriteBlock shall skip writing and
consider the job as successfully finished if the NvMBlockUseCRCCompMechanism
attribute of the NVRAM Block is set to true and the RAM block CRC calculated by
the write job is equal to the CRC calculated during the last successful read or write
job. This mechanism shall not be applied to blocks for which a loss of redundancy has
been detected.c(SRS_Mem_00136)
[SWS_NvM_00338] dThe job of the function NvM_WriteBlock shall copy the RAM block
to the corresponding NV block which is selected via the data index in the administra-
tive block if the NVRAM block management type of the given NVRAM block is NVM_
BLOCK_DATASET.c()
[SWS_NvM_00303] dIf the block is successfully enqueued and if the RAM block state
is VALID/UNCHANGED or INVALID/UNCHANGED, the function NvM_WriteBlock shall
set the RAM block state to VALID/CHANGED.c()
Note: If the block has an explicit synchronization callback (NvM_WriteRamBlockTo
Nvm) configured the validation will be done just after NvM_WriteRamBlockToNvm is
successfully processed.
Note/Hint: The job of the function NvM_WriteBlock shall assume a referenced perma-
nent RAM block or the RAM mirror in the NvM module in case of explicit synchroniza-
tion to be valid when the request is passed to the NvM module.
[SWS_NvM_00213] dThe job of the function NvM_WriteBlock shall check the number
of write retries using a write retry counter to avoid infinite loops. Each negative result
reported by the memory interface shall be followed by an increment of the retry counter.
In case of a retry counter overrun, the job of the function NvM_WriteBlock shall set the
request result to NVM_REQ_NOT_OK.c(SRS_Mem_08554)
[SWS_NvM_00659] dThe job of the function NvM_WriteBlock shall check the number
of write retries using a write retry counter to avoid infinite loops. Each negative result
reported by the memory interface shall be followed by an increment of the retry counter.
In case of a retry counter overrun, the job of the function NvM_WriteBlock shall report
NVM_E_REQ_FAILED to the DEM.c()
[SWS_NvM_00216] dThe configuration parameter NVM_MAX_NUM_OF_WRITE_
RETRIES shall prescribe the maximum number of write retries for the job of the func-
tion NvM_WriteBlock when RAM block data cannot be written successfully to the cor-
responding NV block.c()
Note: For more information on NvMMaxNumOfWriteRetries, see chapter 10.2.2.
[SWS_NvM_00760] dThe job of the function NvM_WriteBlock shall copy the data con-
tent of the RAM block to both corresponding NV blocks if the NVRAM block manage-
ment type of the processed NVRAM block is NVM_BLOCK_REDUNDANT.c()
[SWS_NvM_00761] dIf the processed NVRAM block is of type NVM_BLOCK_REDUN-
DANT the job of the function NvM_WriteBlock shall start to copy the data of the RAM
block to NV block which has not been read during the jobs started by NvM_ReadBlock,
NvM_ReadPRAMBlock or NvM_ReadAll then continue to copy the other NV block.c()
[SWS_NvM_00284] dThe job of the function NvM_WriteBlock shall set NVM_REQ_
OK as request result if the passed BlockId references a NVRAM block of type NVM_
BLOCK_REDUNDANT and at least one of the NV blocks has been written success-
fully.c()
[SWS_NvM_00328] dThe job of the function NvM_WriteBlock shall set the write pro-
tection flag in the administrative block immediately if the NVRAM block is configured
with NvMWriteBlockOnce == TRUE and the data has been written successfully to the
NV block.c()
[SWS_NvM_00713] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_WriteBlock.c()
Hint: To avoid the situation that in case of redundant NVRAM blocks two different
NV blocks are containing different but valid data at the same time, each client of the
function NvM_WriteBlock may call NvM_InvalidateNvBlock in advance.
8.3.2.3 NvM_RestoreBlockDefaults
[SWS_NvM_00456] d
Service Name NvM_RestoreBlockDefaults
Syntax Std_ReturnType NvM_RestoreBlockDefaults (
NvM_BlockIdType BlockId,
void* NvM_DestPtr
)
Service ID [hex] 0x08
Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) NvM_DestPtr Pointer to the RAM data block.
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to restore the default data to its corresponding RAM block.
Available via NvM.h
c(SRS_Mem_00018)
[SWS_NvM_00012] dThe job of the function NvM_RestoreBlockDefaults shall restore
the default data to its corresponding RAM block.c(SRS_Mem_00018)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00224] dThe function NvM_RestoreBlockDefaults shall take over the
given parameters, queue the request in the job queue and return.c()
[SWS_NvM_00267] dThe job of the function NvM_RestoreBlockDefaults shall load the
default data from a ROM block if a ROM block is configured.c(SRS_Mem_00018)
[SWS_NvM_00266] dThe NvM module’s environment shall call the function NvM_
RestoreBlockDefaults to obtain the default data if no ROM block is configured for a
NVRAM block and an application callback routine is configured via the parameter Nv
MInitBlockCallback.c(SRS_Mem_00018)
8.3.2.4 NvM_EraseNvBlock
[SWS_NvM_00457] d
Service Name NvM_EraseNvBlock
Syntax Std_ReturnType NvM_EraseNvBlock (
NvM_BlockIdType BlockId
)
Service ID [hex] 0x09
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to erase a NV block.
Available via NvM.h
c(SRS_Mem_08544)
[SWS_NvM_00415] dThe job of the function NvM_EraseNvBlock shall erase a NV
block.c(SRS_Mem_08544)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00231] dThe function NvM_EraseNvBlock shall take over the given pa-
rameters, queue the request and return.c()
[SWS_NvM_00418] dThe function NvM_EraseNvBlock shall queue the request to
erase in case of disabled write protection.c()
[SWS_NvM_00416] dThe job of the function NvM_EraseNvBlock shall leave the con-
tent of the RAM block unmodified.c()
[SWS_NvM_00959] dThe job of the function NvM_EraseNvBlock shall leave the write
protection unchanged for the blocks configured with NVM_WRITE_BLOCK_ONCE
(TRUE).c()
[SWS_NvM_00661] dThe function NvM_EraseNvBlock shall return with E_NOT_OK if
a ROM block of a dataset NVRAM block is referenced.c()
[SWS_NvM_00662] dNvM_EraseNvBlock: The NvM module shall not re-check the
write protection before fetching the job from the job queue.c()
[SWS_NvM_00269] dIf the referenced NVRAM block is of type NVM_BLOCK_RE-
DUNDANT, the function NvM_EraseNvBlock shall only succeed when both NV blocks
have been erased.c()
[SWS_NvM_00271] dThe job of the function NvM_EraseNvBlock shall set the request
result to NVM_REQ_NOT_OK if the processing of the service fails.c()
8.3.2.5 NvM_InvalidateNvBlock
[SWS_NvM_00459] d
Service Name NvM_InvalidateNvBlock
Syntax Std_ReturnType NvM_InvalidateNvBlock (
NvM_BlockIdType BlockId
)
Service ID [hex] 0x0b
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to invalidate a NV block.
Available via NvM.h
c(SRS_Mem_08011)
[SWS_NvM_00421] dThe job of the function NvM_InvalidateNvBlock shall invalidate a
NV block.c(SRS_Mem_08011)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00422] dThe job of the function NvM_InvalidateNvBlock shall leave the
RAM block unmodified.c()
[SWS_NvM_00960] dThe job of the function NvM_InvalidateNvBlock shall leave the
write protection unchanged for the blocks configured with NVM_WRITE_BLOCK_
ONCE (TRUE).c()
[SWS_NvM_00424] dThe function NvM_InvalidateNvBlock shall queue the request if
the write protection of the corresponding NV block is disabled.c()
[SWS_NvM_00239] dThe function NvM_InvalidateNvBlock shall take over the given
parameters, queue the request and return.c()
8.3.2.6 NvM_ReadPRAMBlock
[SWS_NvM_00764] d
Service Name NvM_ReadPRAMBlock
Syntax Std_ReturnType NvM_ReadPRAMBlock (
NvM_BlockIdType BlockId
)
Service ID [hex] 0x16
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to copy the data of the NV block to its corresponding permanent RAM block.
Available via NvM.h
c(SRS_LIBS_08533, SRS_Mem_00016)
[SWS_NvM_00765] dThe job of the function NvM_ReadPRAMBlock shall copy the
data of the NV block to the permanent RAM block.c(SRS_Mem_00016)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00766] dThe function NvM_ReadPRAMBlock shall take over the given
parameters, queue the read request in the job queue and return.c(SRS_Mem_00016)
[SWS_NvM_00792] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_ReadPRAMBlock.c()
[SWS_NvM_00882] dThe job of the function NvM_ReadPRAMBlock shall load the de-
fault values according to processing of NvM_RestorePRAMBlockDefaults (also set the
request result to NVM_REQ_RESTORED_DEFAULTS) if the read request passed to
the underlying layer fails (MemIf reports MEMIF_JOB_FAILED or MEMIF_BLOCK_IN-
CONSISTENT) and if the default values are available.c()
8.3.2.7 NvM_WritePRAMBlock
[SWS_NvM_00793] d
Service Name NvM_WritePRAMBlock
Syntax Std_ReturnType NvM_WritePRAMBlock (
NvM_BlockIdType BlockId
)
Service ID [hex] 0x17
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to copy the data of the permanent RAM block to its corresponding NV block.
Available via NvM.h
c(SRS_Mem_00017)
[SWS_NvM_00794] dThe job of the function NvM_WritePRAMBlock shall copy the
data of the permanent RAM block to its corresponding NV block.c(SRS_Mem_00017)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00797] dThe function NvM_WritePRAMBlock shall return with E_NOT_
OK, if a locked NVRAM block is referenced by the passed BlockId parameter. and a
DET error (see Section 7.3) shall be emitted.c()
[SWS_NvM_00798] dThe function NvM_WritePRAMBlock shall take over the given
parameters, queue the write request in the job queue and return.c(SRS_Mem_08541)
[SWS_NvM_00799] dThe function NvM_WritePRAMBlock shall check the NVRAM
block protection when the request is enqueued but not again before the request is
executed.c()
[SWS_NvM_00800] dThe function NvM_WritePRAMBlock shall cancel a pending job
immediately in a destructive way if the passed BlockId references a NVRAM block
configured to have immediate priority. The immediate job shall be the next active job
to be processed.c()
[SWS_NvM_00801] dThe job of the function NvM_WritePRAMBlock shall request a
CRC recalculation before the RAM block will be copied to NV memory if the NV block
is configured with CRC [SWS_NvM_00180].c()
[SWS_NvM_00853] dThe job of the function NvM_WritePRAMBlock shall skip writing
and consider the job as successfully finished if the NvMBlockUseCRCCompMecha-
nism attribute of the NVRAM Block is set to true and the RAM block CRC calculated
by the write job is equal to the CRC calculated during the last successful read or write
job. This mechanism shall not be applied to blocks for which a loss of redundancy has
been detected.c(SRS_Mem_00136)
[SWS_NvM_00802] dThe job of the function NvM_WritePRAMBlock shall copy the
RAM block to the corresponding NV block which is selected via the data index in the
administrative block if the NVRAM block management type of the given NVRAM block
is NVM_BLOCK_DATASET.c()
[SWS_NvM_00803] dIf the block is successfully enqueued and if the RAM block state is
VALID/UNCHANGED or INVALID/UNCHANGED, the function NvM_WritePRAMBlock
shall set the RAM block state to VALID/CHANGED.c()
Note: If the block has an explicit synchronization callback (NvM_WriteRamBlockTo
Nvm) configured the validation will be done just after NvM_WriteRamBlockToNvm is
successfully processed.
Note/Hint: The job of the function NvM_WritePRAMBlock shall assume a referenced
permanent RAM block or the RAM mirror in the NvM module in case of explicit syn-
chronization to be valid when the request is passed to the NvM module.
[SWS_NvM_00804] dThe job of the function NvM_WritePRAMBlock shall check the
number of write retries using a write retry counter to avoid infinite loops. Each nega-
tive result reported by the memory interface shall be followed by an increment of the
retry counter. In case of a retry counter overrun, the job of the function NvM_Write
PRAMBlock shall set the request result to NVM_REQ_NOT_OK.c(SRS_Mem_08554)
[SWS_NvM_00805] dThe job of the function NvM_WritePRAMBlock shall check the
number of write retries using a write retry counter to avoid infinite loops. Each nega-
tive result reported by the memory interface shall be followed by an increment of the
retry counter. In case of a retry counter overrun, the job of the function NvM_Write
PRAMBlock shall report NVM_E_REQ_FAILED to the DEM.c()
[SWS_NvM_00806] dThe configuration parameter NVM_MAX_NUM_OF_WRITE_
RETRIES shall prescribe the maximum number of write retries for the job of the func-
tion NvM_WritePRAMBlock when RAM block data cannot be written successfully to
the corresponding NV block.c()
Note: For more information on NvMMaxNumOfWriteRetries, see chapter 10.2.2.
8.3.2.8 NvM_RestorePRAMBlockDefaults
[SWS_NvM_00813] d
Service Name NvM_RestorePRAMBlockDefaults
Syntax Std_ReturnType NvM_RestorePRAMBlockDefaults (
NvM_BlockIdType BlockId
)
Service ID [hex] 0x18
Sync/Async Asynchronous
Reentrancy Non Reentrant
5
4
Parameters (in) BlockId The block identifier uniquely identifies one NVRAM block
descriptor. A NVRAM block descriptor contains all needed
information about a single NVRAM block.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: request has been accepted
E_NOT_OK: request has not been accepted
Description Service to restore the default data to its corresponding permanent RAM block.
Available via NvM.h
c(SRS_Mem_00018)
[SWS_NvM_00814] dThe job of the function NvM_RestorePRAMBlockDefaults shall
restore the default data to its corresponding permanent RAM block.c(SRS_Mem_-
00018)
Note: The error/status NVM_REQ_OK will be set if the job succeeds. (See SWS_Nv
M_00270)
[SWS_NvM_00815] dThe function NvM_RestorePRAMBlockDefaults shall take over
the given parameters, queue the request in the job queue and return.c()
[SWS_NvM_00816] dThe job of the function NvM_RestorePRAMBlockDefaults shall
load the default data from a ROM block if a ROM block is configured.c(SRS_Mem_-
00018)
[SWS_NvM_00817] dThe NvM module’s environment shall call the function NvM_Re-
storePRAMBlockDefaults to obtain the default data if no ROM block is configured for a
NVRAM block and an application callback routine is configured via the parameter Nv
MInitBlockCallback.c(SRS_Mem_00018)
[SWS_NvM_00818] dThe function NvM_RestorePRAMBlockDefaults shall return with
E_NOT_OK if the block management type of the given NVRAM block is NVM_BLOCK_
DATASET, at least one ROM block is configured and the data index points at a NV
block.c()
[SWS_NvM_00819] dThe function NvM_RestorePRAMBlockDefaults shall set the
RAM block state to INVALID/UNCHANGED immediately when the block is success-
fully enqueued.c()
[SWS_NvM_00820] dThe job of the function NvM_RestorePRAMBlockDefaults shall
validate and assume a RAM block to be changed if the requested RAM block is perma-
nent or after explicit synchronization callback (NvMReadRamBlockFromNvCallback)
that is called returns E_OK and the copy process of the default data to RAM was suc-
cessful .c()
[SWS_NvM_00821] dThe job of the function NvM_RestorePRAMBlockDefaults shall
request a recalculation of CRC from a RAM block after the copy process/validation if a
CRC is configured for this RAM block.c()
[SWS_NvM_00822] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_RestorePRAMBlockDefaults.c()
Hint: For the block management type NVM_BLOCK_DATASET, the application has to
ensure that a valid dataset index is selected (pointing to ROM data).
[SWS_NvM_00884] dIf the block has no ROM default data and no NvMInitBlockCall-
back configured for it then the function NvM_RestorePRAMBlockDefaults shall leave
the block status unchanged and return E_NOT_OK as result.c()
[SWS_NvM_00886] dIf the block has no default data, it has no InitBlockCallbackFunc-
tion configured and the development error detection is enabled then the NvM_Re-
storePRAMBlockDefaults API shall report the error NVM_E_BLOCK_WITHOUT_DE-
FAULTS error to the Det module.c()
8.3.3.1 NvM_ReadAll
[SWS_NvM_00460] d
Service Name NvM_ReadAll
Syntax void NvM_ReadAll (
void
)
Service ID [hex] 0x0c
Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Initiates a multi block read request.
Available via NvM.h
c(SRS_LIBS_08533)
[SWS_NvM_00356] dThe multi block service NvM_ReadAll shall provide two distinct
functionalities.
• Initialize the management data for all NVRAM blocks (see SWS_NvM_00304 ff)
• Copy data to the permanent RAM blocks or call explicit synchronization call-
back(NvM_ReadRamBlockFromNvm) for those NVRAM blocks which are con-
figured accordingly.
Note: The two functionalities can be implemented in one loop.c()
[SWS_NvM_00243] dThe function NvM_ReadAll shall signal the request to the NvM
module and return. The NVRAM Manager shall defer the processing of the requested
ReadAll until all single block job queues are empty.c()
[SWS_NvM_00304] dThe job of the function NvM_ReadAll shall set each proceeding
block specific request result for NVRAM blocks in advance.c()
[SWS_NvM_00667] dThe job of the function NvM_ReadAll shall set the multi block
request result to NVM_REQ_PENDING in advance.c()
[SWS_NvM_00895] dThe job of the function NvM_ReadAll shall set the multi block
request result to NVM_REQ_OK if no NVRAM block processing fails.c(SRS_Mem_-
00020)
Note: When the result of an individual block processing (in the context of a multi-block
job) is different than NVM_REQ_OK, the individual block processing is considered as
failed.
[SWS_NvM_00244] dThe job of the function NvM_ReadAll shall iterate over all user
NVRAM blocks, i.e. except for reserved Block Ids 0 (multi block request result) and 1
(NV configuration ID), beginning with the lowest Block Id.c()
[SWS_NvM_00245] dBlocks of management type NVM_BLOCK_DATASET shall not
be loaded automatically upon start-up. Thus the selection of blocks, which belong to
block management type NVM_BLOCK_DATASET, shall not be possible for the service
NvM_ReadAll.c()
[SWS_NvM_00362] dThe NvM module shall initiate the recalculation of the RAM CRC
for every NVRAM block with a valid permanent RAM block or explicit synchronization
callback configured and NvmCalcRamBlockCrc == TRUE during the processing of Nv
M_ReadAll.c()
Note:
If a block processed by the job of the function NvM_ReadAll has explicit synchroniza-
tion configured for it then the block owner should provide the related RAM data for
the comparison. The call made by NvM to the explicit synchronization ’write’ callback
should be successful.
[SWS_NvM_00364] dThe job of the function NvM_ReadAll shall treat the data for every
recalculated RAM CRC which matches the stored RAM CRC as valid and set the block
specific request result to NVM_REQ_OK.c()
Note: This mechanism enables the NVRAM Manager to avoid overwriting of maybe
still valid RAM data with outdated NV data.
[SWS_NvM_00246] dThe job of the function NvM_ReadAll shall validate the configu-
ration ID by comparing the stored NVRAM configuration ID vs. the compiled NVRAM
configuration ID.c()
[SWS_NvM_00669] dNvM_ReadAll: The NVRAM block with the block ID 1 (redundant
type with CRC) shall be reserved to contain the stored NVRAM configuration ID.c()
[SWS_NvM_00247] dThe job of the function NvM_ReadAll shall process the nor-
mal runtime preparation for all configured NVRAM blocks in case of configuration ID
match.c()
[SWS_NvM_00670] dThe job of the function NvM_ReadAll shall set the error/status
information field of the corresponding NVRAM block’s administrative block to NVM_
REQ_OK in case of configuration ID match.c()
[SWS_NvM_00305] dThe job of the function NvM_ReadAll shall report the extended
production error NVM_E_REQ_FAILED to the DEM if the configuration ID cannot be
read because of an error detected by one of the subsequent SW layers.c()
[SWS_NvM_00671] dThe job of the function NvM_ReadAll shall set the error status
field of the reserved NVRAM block to NVM_REQ_INTEGRITY_FAILED if the configu-
ration ID cannot be read because of an error detected by one of the subsequent SW
layers. The NvM module shall behave in the same way as if a configuration ID mis-
match was detected.c()
[SWS_NvM_00307] dThe job of the function NvM_ReadAll shall set the error/status
information field of the reserved NVRAM block with ID 1 to NVM_REQ_NOT_OK in the
case of configuration ID mismatch.c()
[SWS_NvM_00306] dIn case the NvM module can not read the configuration ID be-
cause the corresponding NV blocks are empty or invalidated, the job of the function Nv
M_ReadAll shall not report an extended production error or a production error to the
DEM.c()
[SWS_NvM_00672] dIn case the NvM module can not read the configuration ID be-
cause the corresponding NV blocks are empty or invalidated, the job of the function Nv
M_ReadAll shall set the error/status information field in this NVRAM block’s adminis-
trative block to NVM_REQ_NV_INVALIDATED.c()
[SWS_NvM_00673] dNvM_ReadAll: In case the NvM module can not read the configu-
ration ID because the corresponding NV blocks are empty or invalidated, NVM module
shall update the configuration ID from the RAM block assigned to the reserved NVRAM
block with ID 1 according to the new (compiled) configuration ID. The NvM module shall
behave the same way as if the configuration ID matched.c()
[SWS_NvM_00248] dThe job of the function NvM_ReadAll shall ignore a configuration
ID mismatch and behave normal if NvMDynamicConfiguration == FALSE.c()
Note: For more information on NvMDynamicConfiguration, see chapter 10.2.2.
[SWS_NvM_00249] dThe job of the function NvM_ReadAll shall process an extended
runtime preparation for all blocks which are configured with NvMResistantToChanged
Sw == FALSE and NvMDynamicConfiguration == TRUE and configuration ID mismatch
occurs.c()
[SWS_NvM_00674] dThe job of the function NvM_ReadAll shall process the normal
runtime preparation of all NVRAM blocks when they are configured with NvMResistant
ToChangedSw == TRUE and NvMDynamicConfiguration == TRUE and if a configura-
tion ID mismatch occurs.c()
[SWS_NvM_00314] dThe job of the function NvM_ReadAll shall mark every NVRAM
block that has been configured with NVM_WRITE_BLOCK_ONCE (TRUE) as write
protected if that block is valid and with consistent data. This write protection cannot be
cleared by NvM_SetBlockProtection.c()
[SWS_NvM_00315] dThe job of the function NvM_ReadAll shall only invalidate a
NVRAM block of management type NVM_BLOCK_REDUNDANT if both NV blocks
have been invalidated.c()
[SWS_NvM_00718] dThe NvM module’s environment shall use the multi block request
NvM_ReadAll to load and validate the content of configured permanent RAM or to do
the explicit synchronization for configured blocks during start-up [SWS_NvM_00091].c
()
[SWS_NvM_00118] dThe job of the function NvM_ReadAll shall process only the per-
manent RAM blocks or call explicit synchronization callback (NvM_ReadRamBlock
FromNvm) for blocks which are configured with NvmSelectBlockForReadall == TRUE.c
()
[SWS_NvM_00287] dThe job of the function NvM_ReadAll shall set the request result
to NVM_REQ_BLOCK_SKIPPED for each NVRAM block configured to be processed
by the job of the function NvM_ReadAll (NvMSelectBlockForReadAll is checked) and
which has not been read during processing of the NvM_ReadAll job.c()
[SWS_NvM_00308] dThe job of the function NvM_ReadAll shall restore the default
data to the corresponding RAM blocks either if configured by the parameter NvMRom
BlockDataAddress or by the parameter NvMInitBlockCallback, and set the error/status
field in the administrative block to NVM_REQ_RESTORED_DEFAULTS when process-
ing the extended runtime preparation.c()
[SWS_NvM_00309] dWhen executing the extended runtime preparation, the job of
the function NvM_ReadAll shall treat the affected NVRAM blocks as invalid or blank
in order to allow rewriting of blocks configured with NVM_BLOCK_WRITE_ONCE ==
TRUE.c()
[SWS_NvM_00310] dThe job of the function NvM_ReadAll shall update the configura-
tion ID from the RAM block assigned to the reserved NVRAM block with ID 1 according
to the new (compiled) configuration ID, mark the NVRAM block to be written during Nv
M_WriteAll and request a CRC recalculation if a configuration ID mismatch occurs and
if the NVRAM block is configured with NvMDynamicConfiguration == TRUE.c()
[SWS_NvM_00311] dThe NvM module shall allow applications to send any request
for the reserved NVRAM Block ID 1 if (and only if) NvMDynamicConfiguration is set to
TRUE, including NvM_WriteBlock and NvM_WritePRAMBlock.c()
[SWS_NvM_00312] dThe NvM module shall not send a request for invalidation of the
reserved configuration ID NVRAM block to the underlying layer, unless requested so
by the application. This shall ensure that the NvM module’s environment can rely on
this block to be only invalidated at the first start-up of the ECU or if desired by the
application.c()
8.3.3.2 NvM_WriteAll
[SWS_NvM_00461] d
Service Name NvM_WriteAll
Syntax void NvM_WriteAll (
void
)
Service ID [hex] 0x0d
Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Initiates a multi block write request.
Available via NvM.h
c(SRS_LIBS_08535)
[SWS_NvM_00018] dThe job of the function NvM_WriteAll shall synchronize the con-
tents of permanent RAM blocks to their corresponding NV blocks or call explicit syn-
chronization callback (NvM_WriteRamBlockToNvm) on shutdown.c()
[SWS_NvM_00733] dIf NVRAM block ID 1 (which holds the configuration ID of the
memory layout) is marked as "to be written during NvM_WriteAll", the job of the func-
tion NvM_WriteAll shall write this block in a final step (last write operation) to prevent
memory layout mismatch in case of a power loss failure during write operation.c()
[SWS_NvM_00254] dThe function NvM_WriteAll shall signal the request to the NvM
module and return. The NVRAM Manager shall defer the processing of the requested
WriteAll until all single block job queues are empty.c()
[SWS_NvM_00549] dThe job of the function NvM_ WriteAll shall set each proceeding
block specific request result for NVRAM blocks and the multi block request result to
NVM_REQ_PENDING in advance.c()
[SWS_NvM_00896] dThe job of the function NvM_WriteAll shall set the multi block
request result to NVM_REQ_OK if no NVRAM block processing fails.c(SRS_Mem_-
00020)
Note: When the result of an individual block processing (in the context of a multi-block
job) is different than NVM_REQ_OK, the individual block processing is considered as
failed.
[SWS_NvM_00252] dThe job of the function NvM_WriteAll shall process only the per-
manent RAM blocks or call explicit synchronization callback (NvM_WriteRamBlockTo
Nvm) for all blocks for which the corresponding NVRAM block parameter NvMSelect
BlockForWriteAll is configured to true.c()
[SWS_NvM_00432] dThe job of the function NvM_WriteAll shall check the write-
protection for each RAM block in advance.c()
[SWS_NvM_00682] dThe job of the function NvM_WriteAll shall check the "valid/mod-
ified" state for each RAM block in advance.c()
[SWS_NvM_00433] dThe job of the function NvM_WriteAll shall only write the content
of a RAM block to its corresponding NV block for non write-protected NVRAM blocks.c
()
[SWS_NvM_00474] dThe job of the function NvM_WriteAll shall correct the redundant
data (if configured) if the redundancy has been lost. In this case the job of the function
NvM_WriteAll shall ignore write protection for this block in order to be able to repair it.c
()
Note: If NvM implementation detects loss of redundancy during read operation the user
(application) should ensure that redundant block is read (e.g. during NvM_ReadAll by
configuring the block to be read during NvM_ReadAll). If the block is not read then the
NVM will not be able to correct the redundant block’s data.
[SWS_NvM_00434] dThe job of the function NvM_WriteAll shall skip every write-
protected NVRAM block without error notification.c()
[SWS_NvM_00750] dThe job of the function NvM_WriteAll shall skip every locked
NVRAM block without error notification.c()
[SWS_NvM_00854] dThe job of the function NvM_WriteAll shall skip an NVRAM block
if the NvMBlockUseCRCCompMechanism attribute is set to true and the RAM block
CRC calculated by the write job is equal to the CRC calculated during the last suc-
cessful read or write job. This mechanism shall not be applied to blocks for which a
loss of redundancy has been detected.c(SRS_Mem_00136)
[SWS_NvM_00298] dThe job of the function NvM_WriteAll shall set the request result
to NVM_REQ_BLOCK_SKIPPED for each NVRAM block configured to be processed
by the job of the function NvM_WriteAll (NvMSelectBlockForWriteAll is checked) and
which has not been written during processing of the NvM_WriteAll job.c()
[SWS_NvM_00339] dIn case of NVRAM block management type NVM_BLOCK_
DATASET, the job of the function NvM_WriteAll shall copy only the RAM block to
the corresponding NV block which is selected via the data index in the administrative
block.c()
[SWS_NvM_00253] dThe job of the function NvM_WriteAll shall request a CRC recal-
culation and renew the CRC from a NVRAM block before writing the data if a CRC is
configured for this NVRAM block.c()
[SWS_NvM_00296] dThe job of the function NvM_WriteAll shall check the number of
write retries by a write retry counter to avoid infinite loops. Each unsuccessful result
reported by the MemIf module shall be followed by an increment of the retry counter.c
()
[SWS_NvM_00683] dThe job of the function NvM_WriteAll shall set the block specific
request result to NVM_REQ_NOT_OK if the write retry counter becomes greater than
the configured NVM_MAX_NUM_OF_WRITE_RETRIES.c()
[SWS_NvM_00684] dThe job of the function NvM_WriteAll shall report NVM_E_REQ_
FAILED to the DEM if the write retry counter becomes greater than the configured
NVM_MAX_NUM_OF_WRITE_RETRIES.c()
[SWS_NvM_00762] dThe job of the function NvM_WriteAll shall copy the data content
of the RAM block to both corresponding NV blocks if the NVRAM block management
type of the processed NVRAM block is NVM_BLOCK_REDUNDANT.c()
[SWS_NvM_00763] dIf the processed NVRAM block is of type NVM_BLOCK_REDUN-
DANT the job of the function NvM_WriteAll shall start to copy the data of the RAM block
to NV block which has _not_ been read during the jobs started by NvM_ReadBlock, Nv
M_ReadPRAMBlock or NvM_ReadAll then continue to copy the other NV block.c()
[SWS_NvM_00337] dThe job of the function NvM_WriteAll shall set the single block re-
quest result to NVM_REQ_OK if the processed NVRAM block is of type NVM_BLOCK_
REDUNDANT and at least one of the NV blocks has been written successfully.c()
[SWS_NvM_00238] dThe job of the function NvM_WriteAll shall complete the job in a
non-destructive way for the NVRAM block currently being processed if a cancellation
of NvM_WriteAll is signaled by a call of NvM_CancelWriteAll.c()
[SWS_NvM_00237] dThe NvM module shall set the multi block request result to NVM_
REQ_CANCELED in case of cancellation of NvM_WriteAll.c()
[SWS_NvM_00685] dNvM_WriteAll: The NvM module shall anyway report the error
code condition, due to a failed NVRAM block write, to the DEM.c()
[SWS_NvM_00318] dThe job of the function NvM_WriteAll shall set the multi block
request result to NVM_REQ_NOT_OK if the processing of at least one NVRAM block
fails.c()
Note: When the result of an individual block processing (in the context of a multi-block
job) is different than NVM_REQ_OK, the individual block processing is considered as
failed.
[SWS_NvM_00329] dIf the job of the function NvM_WriteAll has successfully written
data to NV memory for a NVRAM block configured with NvMWriteBlockOnce == TRUE,
the job shall immediately set the corresponding write protection flag in the administra-
tive block.c()
[SWS_NvM_00720] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_WriteAll.c()
No other multiblock request shall be pending when the NvM module’s environment calls
the function NvM_WriteAll.
Note: To avoid the situation that in case of redundant NVRAM blocks two different NV
blocks are containing different but valid data at the same time, each client of the NvM_
WriteAll service may call NvM_InvalidateNvBlock in advance.
[SWS_NvM_00971] dThe multi block service NvM_WriteAll shall only be provided by
the NvM master.c()
8.3.3.3 NvM_CancelWriteAll
[SWS_NvM_00458] d
Service Name NvM_CancelWriteAll
Syntax void NvM_CancelWriteAll (
void
)
Service ID [hex] 0x0a
Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Service to cancel a running NvM_WriteAll request.
Available via NvM.h
c(SRS_Mem_08558, SRS_Mem_08540)
[SWS_NvM_00019] dThe function NvM_CancelWriteAll shall cancel a running NvM_
WriteAll request. It shall terminate the NvM_WriteAll request in a way that the data
consistency during processing of a single NVRAM block is not compromisedc(SRS_-
Mem_08540)
[SWS_NvM_00232] dThe function NvM_CancelWriteAll shall signal the request to the
NvM module and return.c()
[SWS_NvM_00233] dThe function NvM_CancelWriteAll shall be without any effect if
no NvM_WriteAll request is pending.c()
[SWS_NvM_00234] dThe function NvM_CancelWriteAll shall treat multiple requests to
cancel a running NvM_WriteAll request as one request, i.e. subsequent requests will
be ignored.c()
[SWS_NvM_00235] dThe request result of the function NvM_CancelWriteAll shall be
implicitly given by the result of the NvM_WriteAll request to be canceled.c()
8.3.3.4 NvM_ValidateAll
[SWS_NvM_00855] d
Service Name NvM_ValidateAll
Syntax void NvM_ValidateAll (
void
)
Service ID [hex] 0x19
Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Initiates a multi block validation request.
Available via NvM.h
c(SRS_Mem_00137)
[SWS_NvM_00856] dIf auto validation is configured for an NVRAM Block (NvMBlock
UseAutoValidation == TRUE), the function NvM_ValidateAll shall set the RAM Block
status to "VALID / CHANGED".c(SRS_Mem_00137)
[SWS_NvM_00857] dFor blocks which meet the conditions of SWS_NvM_00856 and
in addition have CRC calculation in RAM configured the function NvM_ValidateAll shall
request the recalculation of CRC in the background, i.e. the CRC recalculation shall
be processed by the NvM_MainFunction.c(SRS_Mem_00137)
[SWS_NvM_00858] dThe function NvM_ValidateAll shall signal the request to the NvM
module and return. The NVRAM Manager shall defer the processing of the requested
NvM_ValidateAll function until all single block job queues are empty.c(SRS_Mem_-
00137)
[SWS_NvM_00859] dThe NvM module’s environment shall have initialized the NvM
module before it calls the function NvM_ValidateAll.c(SRS_Mem_00137)
[SWS_NvM_00860] dThe job of the function NvM_ValidateAll shall process only the
permanent RAM blocks or call explicit synchronization callback (NvM_WriteRamBlock
ToNvm) for all blocks for which the corresponding NVRAM Block parameter NvMBlock
UseAutoValidation is configured to true.c(SRS_Mem_00137)
[SWS_NvM_00861] dThe job of the function NvM_ValidateAll shall set each proceed-
ing block specific request result for NVRAM blocks and the multi block request result to
NVM_REQ_PENDING in advance.c(SRS_Mem_00137)
[SWS_NvM_00862] dThe job of the function NvM_ValidateAll shall set the block spe-
cific request result to NVM_REQ_OK if the RAM block was successfully validated.c
(SRS_Mem_00137)
8.3.3.5 NvM_FirstInitAll
[SWS_NvM_91001] d
Service Name NvM_FirstInitAll
Syntax void NvM_FirstInitAll (
void
)
Service ID [hex] 0x14
Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description The function initiates a multi block first initialization request. The job of the function does not
care if a block exists in the non-volatile memory or not OR if it is valid (i.e. not corrupted) or not,
when processing it.
Available via NvM.h
c()
For each processed block, the job of the function will either write it with default data (if
it is not of type DATASET and it has default data) or invalidate the block (if it is of type
DATASET or without default data).
The term "default data" means the data from the ROM block (if any) or the one provided
inside the InitBlockCallback (if any) by the related block owner.
If NvM_FirstInitAll is called after NvM_ReadAll, then an inconsistency between the Nv
M user’s expectation of RAM block contents and the actual RAM block contents can
occur. Even worse, also concurrent writes to the RAM block content from NvM user
side and NvM_FirstInitAll could occur. Hence, calling NvM_FirstInitAll after NvM_Read
All should generally be avoided.
In light of the above, the following requirements apply:
[SWS_NvM_00912] dThe job of the function NvM_FirstInitAll shall also process the
block with ID 1 (which holds the configuration ID of the NvM module), if this block has
been configured to be processed by it and dynamic configuration is enabled.c()
Note: The reason behind this is to allow the blocks that are Write Once Only to be
written via the NvM_WriteBlock API with valid values, after being initialized by the job
of the function NvM_FirstInitAll.
[SWS_NvM_00933] dThe locked status of a block shall be completely ignored by the
NvM_FirstInitAll functionality.c()
Note: The block locking needs to be handled by the caller of the NvM_FirstInitAll or
by the block owner (which should know about the execution of the NvM_FirstInitAll
function and related job). This is due to the fact that, upon successful completion of
the job of the NvM_FirstInitAll, all selected blocks should have a well known and well
defined state.
[SWS_NvM_00934] dIf a block that has either permanent RAM or explicit synchroniza-
tion has been successfully written into the non-volatile memory by the job of the func-
tion NvM_FirstInitAll then its RAM block state shall be set to VALID / UNCHANGED.c
()
[SWS_NvM_00935] dIf a block that has either permanent RAM or explicit synchroniza-
tion has been successfully invalidated by the job of the function NvM_FirstInitAll then
its RAM block state shall be left untouched.c()
[SWS_NvM_00936] dThe job of the function NvM_FirstInitAll shall not be started while
there are single block requests that need to be processed by the NvM module.c()
[SWS_NvM_00937] dThe job of the function NvM_FirstInitAll, once started, shall not be
interrupted by any single block requests except write requests for immediate blocks.c()
[SWS_NvM_00938] dIf the NvM module is not initialized and the function NvM_FirstInit
All is called, it shall report the Det error NVM_E_UNINIT and return without performing
any other activities.c()
[SWS_NvM_00939] dIf a multi block operation is PENDING and the function NvM_
FirstInitAll is called, it shall report the Det error NVM_E_BLOCK_PENDING and return
without performing any other activities.c()
Note: The error NVM_E_BLOCK_PENDING is used to indicate that another multiblock
operation is accepted but not completed by NvM. This is due to the fact that the NvM
module can only accept and process one multiblock operation at a time.
[SWS_NvM_00940] dThe job of the function NvM_FirstInitAll shall set the multi block
request result to NVM_REQ_NOT_OK if the processing of at least one NVRAM block
fails.c()
Note: When the result of an individual block processing (in the context of a multi-block
job) is different than NVM_REQ_OK, the individual block processing is considered as
failed.
[SWS_NvM_00462] d
Service Name NvM_JobEndNotification
Syntax void NvM_JobEndNotification (
void
)
Service ID [hex] 0x11
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Function to be used by the underlying memory abstraction to signal end of job without error.
Available via NvM_MemIf.h
c()
[SWS_NvM_00111] dThe callback function NvM_JobEndNotification is used by the
underlying memory abstraction to signal end of job without error.
Note: Successful job end notification of the memory abstraction:
• Read finished & OK
• Write finished & OK
• Erase finished & OK
This routine might be called in interrupt context, depending on the calling function. All
memory abstraction modules should be configured to use the same mode (callback/
polling).c()
[SWS_NvM_00440] dThe NvM module shall only provide the callback function NvM_
JobEndNotification if polling mode is disabled via NvMPollingMode.c()
Note: The function NvM_JobEndNotification is affected by the common 10.2.2 config-
uration parameters.
[SWS_NvM_00463] d
Service Name NvM_JobErrorNotification
Syntax void NvM_JobErrorNotification (
void
)
Service ID [hex] 0x12
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description Function to be used by the underlying memory abstraction to signal end of job with error.
Available via NvM_MemIf.h
c(SRS_Mem_00125)
[SWS_NvM_00112] dThe callback function NvM_JobErrorNotification is to be used by
the underlying memory abstraction to signal end of job with error.
• Note: Unsuccessful job end notification of the memory abstraction:
• Read aborted or failed
• Write aborted or failed
• Erase aborted or failed
This routine might be called in interrupt context, depending on the calling function. All
memory abstraction modules should be configured to use the same mode (callback/
polling).
c()
[SWS_NvM_00441] dThe NvM module shall only provide the callback function NvM_
JobErrorNotification if polling mode is disabled via NvMPollingMode.c()
Note: The function NvM_Job ErrorNotification is affected by the common 10.2.2 con-
figuration parameters.
[SWS_NvM_00464] d
Service Name NvM_MainFunction
Syntax void NvM_MainFunction (
void
)
Service ID [hex] 0x0e
Description Service for performing the processing of the NvM jobs.
Available via SchM_NvM.h
The following table defines all interfaces which are required to fulfill the core function-
ality of the module.
[SWS_NvM_00465] d
API Function Header File Description
MemIf_Cancel MemIf.h Invokes the "Cancel" function of the underlying
memory abstraction module selected by the
parameter DeviceIndex.
MemIf_EraseImmediateBlock MemIf.h Invokes the "EraseImmediateBlock" function of the
underlying memory abstraction module selected by
the parameter DeviceIndex.
MemIf_GetJobResult MemIf.h Invokes the "GetJobResult" function of the
underlying memory abstraction module selected by
the parameter DeviceIndex.
MemIf_GetStatus MemIf.h Invokes the "GetStatus" function of the underlying
memory abstraction module selected by the
parameter DeviceIndex.
MemIf_InvalidateBlock MemIf.h Invokes the "InvalidateBlock" function of the
underlying memory abstraction module selected by
the parameter DeviceIndex.
MemIf_Read MemIf.h Invokes the "Read" function of the underlying
memory abstraction module selected by the
parameter DeviceIndex.
MemIf_Write MemIf.h Invokes the "Write" function of the underlying
memory abstraction module selected by the
parameter DeviceIndex.
c(SRS_BSW_00383, SRS_BSW_00384)
The following table defines all interfaces which are required to fulfill an optional func-
tionality of the module.
[SWS_NvM_00466] d
API Function Header File Description
Crc_CalculateCRC16 Crc.h This service makes a CRC16 calculation on Crc_
Length data bytes.
Crc_CalculateCRC32 Crc.h This service makes a CRC32 calculation on Crc_
Length data bytes.
Crc_CalculateCRC8 Crc.h This service makes a CRC8 calculation on Crc_
Length data bytes, with SAE J1850 parameters
Dem_SetEventStatus Dem.h Called by SW-Cs or BSW modules to report monitor
status information to the Dem. BSW modules calling
Dem_SetEventStatus can safely ignore the return
value. This API will be available only if ({Dem/Dem
ConfigSet/DemEventParameter/DemEvent
ReportingType} == STANDARD_REPORTING)
Det_ReportError Det.h Service to report development errors.
c(SRS_BSW_00383, SRS_BSW_00384)
In this chapter, all interfaces are listed for which the target function can be configured.
The target function is usually a callback function. The names of these interfaces are
not fixed because they are configurable.
[SWS_NvM_00113] dThe notification of a caller via an asynchronous callback routine
(NvMSingleBlockCallback) shall be optionally configurable for all NV blocks.c()
Note: For more information on NvMSingleBlockCallback, see chapter 10.2.3.
[SWS_NvM_00740] dIf a callback is configured for a NVRAM block, every asyn-
chronous block request to the block itself shall be terminated with an invocation of
the callback routine.c()
[SWS_NvM_00742] dIf no callback is configured for a NVRAM block, there shall be no
asynchronous notification of the caller in case of an asynchronous block request.c()
[SWS_NvM_00260] dA common callback entry (NvMMultiBlockCallback) which is not
bound to any NVRAM block shall be optionally configurable for all asynchronous multi
block requests (including NvM_CancelWriteAll).c()
[SWS_NvM_00467] d
Service Name NvM_SingleBlockCallbackFunction
Syntax Std_ReturnType NvM_SingleBlockCallbackFunction (
NvM_BlockRequestType BlockRequest,
NvM_RequestResultType JobResult
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) BlockRequest The request type (read, write, ... etc.) of the previous processed
block job
JobResult The request result of the previous processed block job.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: callback function has been processed successfully
any other: callback function has been processed unsuccessfully
Description Per block callback routine to notify the upper layer that an asynchronous single block request
has been finished.
Available via NvM_Externals.h
[SWS_NvM_00468] d
Service Name NvM_MultiBlockCallbackFunction
Syntax Std_ReturnType NvM_MultiBlockCallbackFunction (
NvM_MultiBlockRequestType MultiBlockRequest,
NvM_RequestResultType JobResult
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) MultiBlockRequest The request type (read, write, ... etc.) of the previous processed
multi block job
JobResult The request result of the previous processed multi block job.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: callback function has been processed successfully
any other: callback function has been processed unsuccessfully
5
4
Description Common callback routine to notify the upper layer that an asynchronous multi block request has
been finished.
Available via NvM_Externals.h
[SWS_NvM_00469] d
Service Name NvM_InitBlockCallbackFunction
Syntax Std_ReturnType NvM_InitBlockCallbackFunction (
NvM_InitBlockRequestType InitBlockRequest
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) InitBlockRequest The request type (read, restore, ... etc.) of the currently
processed block
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: callback function has been processed successfully
any other: callback function has been processed unsuccessfully
Description Per block callback routine which shall be called by the NvM module when default data needs to
be restored in RAM, and a ROM block is not configured.
Available via NvM_Externals.h
Note: Please refer to NvMInitBlockCallback in chapter 10. The init block callback func-
tion might be called in interrupt context only if there is no callback configured in NvM
that belongs to a SW-C.
[SWS_NvM_00967] dIf the block is configured with CalcRamBlockCrc and if the return
value for NvMInitBlockCallback is E_OK then NvM shall synchronize the data with the
NvM mirror before calculating the CRC over it. (SRS_Mem_08538, SRS_LIBS_08533,
SRS_Mem_00016, SRS_Mem_00018)c()
[SWS_NvM_00539] d
Service Name NvM_WriteRamBlockToNvm
Syntax Std_ReturnType NvM_WriteRamBlockToNvm (
void* NvMBuffer
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) NvMBuffer the address of the buffer where the data shall be written to
Return value Std_ReturnType E_OK: callback function has been processed successfully
any other: callback function has been processed unsuccessfully
Description Block specific callback routine which shall be called in order to let the application copy data
from RAM block to NvM module’s mirror.
Available via NvM_Externals.h
c(SRS_BSW_00457)
[SWS_NvM_00541] dThe RAM to NvM copy callback shall be a function pointer.c()
Note: Please refer to NvMWriteRamBlockToNvCallback in chapter 10.
[SWS_NvM_00540] d
Service Name NvM_ReadRamBlockFromNvm
Syntax Std_ReturnType NvM_ReadRamBlockFromNvm (
const void* NvMBuffer
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) NvMBuffer the address of the buffer where the data can be read from
Parameters (inout) None
Parameters (out) None
5
4
Return value Std_ReturnType E_OK: callback function has been processed successfully
any other: callback function has been processed unsuccessfully
Description Block specific callback routine which shall be called in order to let the application copy data
from NvM module’s mirror to RAM block.
Available via NvM_Externals.h
c(SRS_LIBS_08533, SRS_BSW_00457)
[SWS_NvM_00542] dThe NvM to RAM copy callback shall be a function pointer.c()
Note: Please refer to NvMReadRamBlockFromNvCallback in chapter 10.
8.7.1 Client-Server-Interfaces
8.7.1.1 NvM_Admin
[SWS_NvM_00737] d
Name NvMAdmin
Comment –
IsService true
Variation –
Possible Errors 0 E_OK Operation successful
1 E_NOT_OK Operation failed
Operation SetBlockProtection
Comment Service for setting/resetting the write protection for a NV block.
Mapped to API NvM_SetBlockProtection
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass3;
Parameters ProtectionEnabled
Type boolean
Direction IN
Comment –
Variation –
Possible Errors E_OK
E_NOT_OK
c()
8.7.1.2 NvM_Mirror
[SWS_NvM_00738] d
Name NvMMirror
Comment –
IsService true
Variation –
Possible Errors 0 E_OK Operation successful
1 E_NOT_OK Operation failed
Operation ReadRamBlockFromNvM
Comment Block specific callback routine which shall be called in order to let the application copy data
from NvM module’s mirror to RAM block.
Mapped to API NvM_ReadRamBlockFromNvm
Variation –
Parameters SrcPtr
Type ConstVoidPtr
Direction IN
Comment The parameter "SrcPtr" shall be typed by an ImplementationDataType of
category DATA_REFERENCE with the pointer target void to pass an address
(pointer) to the RAM Block.
Variation –
Possible Errors E_OK
E_NOT_OK
Operation WriteRamBlockToNvM
Comment Block specific callback routine which shall be called in order to let the application copy data
from RAM block to NvM module’s mirror.
Mapped to API NvM_WriteRamBlockToNvm
Variation –
Parameters DstPtr
Type VoidPtr
Direction IN
Comment The parameter "DstPtr" shall be typed by an ImplementationDataType of
category DATA_REFERENCE with the pointer target void to pass an address
(pointer) to the RAM Block.
Variation –
Possible Errors E_OK
E_NOT_OK
c()
8.7.1.3 NvM_NotifyInitBlock
[SWS_NvM_00736] d
Name NvMNotifyInitBlock
Comment Callback that is called by the NvM module when default data needs to be restored to the RAM
image
IsService true
Variation –
5
4
Possible Errors 0 E_OK RAM block content was updated
1 RTE_E_RAM_ RAM block content was not changed
UNCHANGED
Operation InitBlock
Comment This callback is called if the initialization of a block has completed.
Mapped to API –
Variation –
Parameters InitBlockRequest
Type NvM_InitBlockRequestType
Direction IN
Comment –
Variation –
Possible Errors –
c()
8.7.1.4 NvM_NotifyJobFinished
[SWS_NvM_00735] d
Name NvMNotifyJobFinished
Comment Callback that is called when a job has finished
IsService true
Variation –
Possible Errors 0 E_OK Operation successful
Operation JobFinished
Comment Callback that gets called if a job has finished
Mapped to API –
Variation –
BlockRequest
Parameters
Type NvM_BlockRequestType
Direction IN
Comment –
Variation –
JobResult
Type NvM_RequestResultType
Direction IN
Comment –
Variation –
Possible Errors E_OK
c()
8.7.1.5 NvM_Service
[SWS_NvM_00734] d
Name NvMService
Comment –
IsService true
Variation –
Possible Errors 0 E_OK Operation successful
1 E_NOT_OK Operation failed
Operation EraseBlock
Comment Service to erase a NV block.
Mapped to API NvM_EraseNvBlock
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass3;
Operation GetDataIndex
Comment Service for getting the currently set DataIndex of a dataset NVRAM block
Mapped to API NvM_GetDataIndex
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
WHERE
isConfigClass2;
Parameters DataIndex
Type uint8
Direction OUT
Comment –
Variation –
Possible Errors E_OK
E_NOT_OK
Operation GetErrorStatus
Comment Service to read the block dependent error/status information.
Mapped to API NvM_GetErrorStatus
Variation –
Parameters RequestResult
Type NvM_RequestResultType
Direction OUT
Comment –
Variation –
5
4
Possible Errors E_OK
E_NOT_OK
Operation InvalidateNvBlock
Comment Service to invalidate a NV block.
Mapped to API NvM_InvalidateNvBlock
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass3;
Operation ReadBlock
Comment Service to copy the data of the NV block to its corresponding RAM block.
Mapped to API NvM_ReadBlock
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass2 OR isConfigClass3;
Parameters DstPtr
Type VoidPtr
Direction IN
Comment The parameter "DstPtr" shall be typed by an ImplementationDataType of
category DATA_REFERENCE with the pointer target void to pass an address
(pointer) to the RAM Block.
Variation –
Possible Errors E_OK
E_NOT_OK
Operation ReadPRAMBlock
Comment –
Mapped to API –
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass2 OR isConfigClass3;
Operation RestoreBlockDefaults
Comment Service to restore the default data to its corresponding RAM block.
Mapped to API NvM_RestoreBlockDefaults
5
4
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass2 OR isConfigClass3;
Parameters DstPtr
Type VoidPtr
Direction IN
Comment The parameter "DstPtr" shall be typed by an ImplementationDataType of
category DATA_REFERENCE with the pointer target void to pass an address
(pointer) to the RAM Block.
Variation –
Possible Errors E_OK
E_NOT_OK
Operation RestorePRAMBlockDefaults
Comment –
Mapped to API –
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass2 OR isConfigClass3;
Operation SetDataIndex
Comment Service for setting the DataIndex of a dataset NVRAM block.
Mapped to API NvM_SetDataIndex
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
blockMgmTypes = ECV.subEltList("NvM/NvMBlockDescriptor/
NvMBlockManagementType");
isMgd(mgmtType) = mgmtType.value() == "NVM_BLOCK_DATASET";
datasetMgdCount = blockMgmTypes.filter(isMgd).count();
WHERE
(isConfigClass2 OR isConfigClass3) AND (datasetMgdCount GT 0);
Parameters DataIndex
Type uint8
Direction IN
Comment –
Variation –
Possible Errors E_OK
E_NOT_OK
Operation SetRamBlockStatus
Comment Service for setting the RAM block status of an NVRAM block.
Mapped to API NvM_SetRamBlockStatus
Variation LET
nvmBlockUseSetRamBlockStatus = ECV.subEltList("NvM/
NvMBlockDescriptor/NvMBlockUseSetRamBlockStatus");
useSetRamBlockStatus(useApi) = useApi.value() == true;
useSetRamBlockStatusCount = nvmBlockUseSetRamBlockStatus.filter(
useSetRamBlockStatus).count();
WHERE
(useSetRamBlockStatusCount GT 0);
Parameters BlockChanged
Type boolean
Direction IN
Comment –
Variation –
Possible Errors E_OK
E_NOT_OK
Operation WriteBlock
Comment Service to copy the data of the RAM block to its corresponding NV block.
Mapped to API NvM_WriteBlock
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass2 OR isConfigClass3;
Parameters SrcPtr
Type ConstVoidPtr
Direction IN
Comment The parameter "SrcPtr" shall be typed by an ImplementationDataType of
category DATA_REFERENCE with the pointer target void to pass an address
(pointer) to the RAM Block.
Variation –
Possible Errors E_OK
E_NOT_OK
Operation WritePRAMBlock
Comment –
Mapped to API –
Variation FOR
configClass : ECV.subEltList("NvM/NvMCommon/NvMApiConfigClass");
LET
isConfigClass2 = configClass.value() == "NVM_API_CONFIG_CLASS_2";
isConfigClass3 = configClass.value() == "NVM_API_CONFIG_CLASS_3";
WHERE
isConfigClass2 OR isConfigClass3;
c()
[SWS_NvM_00470] d
Name NvM_RequestResultType
Kind Type
Derived from uint8
Range NVM_REQ_OK 0x00 The last asynchronous request
has been finished successfully.
This shall be the default value
after reset. This status shall have
the value 0.
NVM_REQ_NOT_OK 0x01 The last asynchronous read/write/
control request has been finished
unsuccessfully.
NVM_REQ_PENDING 0x02 An asynchronous read/write/
control request is currently
pending.
NVM_REQ_INTEGRITY_ 0x03 The result of the last
FAILED asynchronous request
NvM_ReadBlock or NvM_ReadAll
is a data integrity failure.
Note: In case of
NvM_ReadBlock
the content of the RAM block has
changed but has become invalid.
The application is responsible to
renew and validate the RAM block
content.
NVM_REQ_BLOCK_ 0x04 The referenced block was skipped
SKIPPED during execution of NvM_ReadAll
or NvM_WriteAll, e.g. Dataset
NVRAM blocks (NvM_ReadAll) or
NVRAM blocks without a
permanently configured RAM
block.
NVM_REQ_NV_ 0x05 The referenced NV block is
INVALIDATED invalidated.
5
4
NVM_REQ_CANCELED 0x06 The multi block request NvM_
WriteAll was canceled by calling
NvM_CancelWriteAll. Or Any
single block job request (NvM_
ReadBlock, NvM_WriteBlock, Nv
M_EraseNvBlock, NvM_Invalidate
NvBlock and NvM_RestoreBlock
Defaults) was canceled by calling
NvM_CancelJobs.
NVM_REQ_RESTORED_ 0x08 The referenced NV block had the
DEFAULTS default values copied to the RAM
image.
Description This is an asynchronous request result returned by the API service NvM_GetErrorStatus. The
availability of an asynchronous request result can be additionally signaled via a callback function.
Variation –
Available via Rte_NvM_Type.h
c()
[SWS_NvM_00471] d
Name NvM_BlockIdType
Kind Type
Derived from uint16
Range 0..2ˆ(16- NvMDataset – –
SelectionBits)-1
Description Identification of a NVRAM block via a unique block identifier.
Reserved NVRAM block IDs: 0 -> to derive multi block request results via NvM_GetErrorStatus 1
-> redundant NVRAM block which holds the configuration ID
Variation –
Available via Rte_NvM_Type.h
c()
[SWS_NvM_91123] d
Name NvM_InitBlockRequestType
Kind Type
Derived from uint8
Range NVM_INIT_READ_BLOCK 0x00 NvM_ReadBlock/ NvM_Read
PRAMBlock is requested on the
block
5
4
NVM_INIT_RESTORE_ 0x01 NvM_RestoreBlockDefaults/ Nv
BLOCK_DEFAULTS M_RestorePRAMBlockDefaults is
requested on the block
NVM_INIT_READ_ALL_ 0x02 NvM_ReadAll is processing this
BLOCK block
NVM_INIT_FIRST_INIT_ 0x03 NvM_FirstInitAll is processing this
ALL block
Description Identifies the type of request performed on a block when signaled via the callback function
Variation –
Available via Rte_NvM_Type.h
c()
[SWS_NvM_91002] d
Name NvM_BlockRequestType
Kind Type
Derived from uint8
Range NVM_READ_BLOCK 0x00 NvM_ReadBlock/ NvM_Read
PRAMBlock was performed on
the block
NVM_WRITE_BLOCK 0x01 NvM_WriteBlock/ NvM_Write
PRAMBlock was performed on
the block
NVM_RESTORE_BLOCK_ 0x02 NvM_RestoreBlockDefaults/ Nv
DEFAULTS M_RestorePRAMBlockDefaults
was performed on the block
NVM_ERASE_NV_BLOCK 0x03 NvM_EraseNvBlock was
performed on the block
NVM_INVALIDATE_NV_ 0x04 NvM_InvalidateNvBlock was
BLOCK performed on the block
NVM_READ_ALL_BLOCK 0x05 NvM_ReadAll has finished
processing this block
Description Identifies the type of request performed on a block when signaled via the callback function
Variation –
Available via Rte_NvM_Type.h
c() Note: Calling the single block callback with NVM_READ_ALL_BLOCK can be used
to trigger an RTE Event that initializes a SW-C (see note below SWS_NvM_00281) as
opposed to calling the single block callback with NVM_READ_BLOCK which is used to
notify an already initialized SW-C of the result of a pending read block job. Therefore
separate literals/values are specified.
8.7.3 Ports
8.7.3.1 NvM_PAdmin_{Block}
[SWS_NvM_00843] d
Name PAdmin_{Block}
Kind ProvidedPort Interface NvMAdmin
Description –
Port Defined Type NvM_BlockIdType
Argument Value(s)
Value FOR
nvBlockDescriptor : ECV.subEltList("NvM/
NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
BlockId = nvBlockDescriptor.subElt("
NvMNvramBlockIdentifier").value();
Variation FOR
nvBlockDescriptor : ECV.subEltList("NvM/NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
UsePort = nvBlockDescriptor.subElt("NvMBlockUsePort").value() == true;
WHERE
UsePort;
c()
8.7.3.2 NvM_PM_{Block}
[SWS_NvM_00844] d
Name PM_{Block}
Kind RequiredPort Interface NvMMirror
Description –
Variation FOR
nvBlockDescriptor : ECV.subEltList("NvM/NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
UsePort = nvBlockDescriptor.subElt("NvMBlockUsePort").value()
== true;
UsePortSyncMech = nvBlockDescriptor.subElt("NvMBlockUseSyncMechanism")
.value() == true;
WHERE
UsePort AND UsePortSyncMech;
c()
8.7.3.3 NvM_PNIB_{Block}
[SWS_NvM_00845] d
Name PNIB_{Block}
Kind RequiredPort Interface NvMNotifyInitBlock
Description –
Variation FOR
nvBlockDescriptor : ECV.subEltList("NvM/NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
UsePort = nvBlockDescriptor.subElt("NvMBlockUsePort").
value() == true;
InitBlockCallbackDef = nvBlockDescriptor.subElt("
NvMInitBlockCallback").isDefined();
InitBlockCallbackFncDef = nvBlockDescriptor.subElt("
NvMInitBlockCallback/NvMInitBlockCallbackFnc").isDefined();
WHERE
UsePort AND InitBlockCallbackDef AND NOT InitBlockCallbackFncDef;
c()
8.7.3.4 NvM_PNJF_{Block}
[SWS_NvM_00846] d
Name PNJF_{Block}
Kind RequiredPort Interface NvMNotifyJobFinished
Description –
Variation FOR
nvBlockDescriptor : ECV.subEltList("NvM/NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
UsePort = nvBlockDescriptor.subElt("NvMBlockUsePort").
value() == true;
SingleBlockCallbackDef = nvBlockDescriptor.subElt("
NvMSingleBlockCallback").isDefined();
SingleBlockCallbackFncDef = nvBlockDescriptor.subElt("
NvMSingleBlockCallback/NvMSingleBlockCallbackFnc").isDefined();
WHERE
UsePort AND SingleBlockCallbackDef AND NOT SingleBlockCallbackFncDef;
c()
8.7.3.5 NvM_PS_{Block}
[SWS_NvM_00847] d
Name PS_{Block}
Kind ProvidedPort Interface NvMService
Description –
Port Defined Type NvM_BlockIdType
Argument Value(s)
Value FOR
nvBlockDescriptor : ECV.subEltList("NvM/
NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
BlockId = nvBlockDescriptor.subElt("
NvMNvramBlockIdentifier").value();
Variation FOR
nvBlockDescriptor : ECV.subEltList("NvM/NvMBlockDescriptor");
LET
Block = nvBlockDescriptor.shortname();
UsePort = nvBlockDescriptor.subElt("NvMBlockUsePort").value() == true;
WHERE
UsePort;
c()
9 Sequence diagrams
9.1.1 NvM_Init
9.1.2 NvM_SetDataIndex
9.1.3 NvM_GetDataIndex
9.1.4 NvM_SetBlockProtection
9.1.5 NvM_GetErrorStatus
9.1.6 NvM_GetVersionInfo
is the same, only the processed number of blocks and the block types may vary. The
result of the asynchronous function is obtained by polling requests to the error/status
information.
Figure 9.7: UML sequence diagram for asynchronous call with polling
Figure 9.8: UML sequence diagram for asynchronous call with callback
The following diagram shows the effect of a cancel operation applied to a running NvM_
WriteAll multi block request. The running NvM_WriteAll function completes the actual
NVRAM block and stops further writes.
The following diagrams show the interractions between NvM and BswM in terms of
single block operation and multiblock operation.
Figure 9.10: NvM interraction with BswM in case of a single block operation
Figure 9.13: NvM interraction with BswM in case of a single block cancellation
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
NvM.
Chapter 10.3 specifies published information of the module NvM.
10.2.1 NvM
Included Containers
Container Name Multiplicity Scope / Dependency
NvMBlockCiphering 0..65535 Container for a chiphering of the Block.
Tags: atp.Status=draft
NvMBlockDescriptor 1..65536 Container for a management structure to configure the
composition of a given NVRAM Block Management Type. Its
multiplicity describes the number of configured NVRAM blocks,
one block is required to be configured. The NVRAM block
descriptors are condensed in the NVRAM block descriptor table.
NvMCommon 1 Container for common configuration options.
NvmDemEventParameterRefs 0..1 Container for the references to DemEventParameter elements
which shall be invoked using the API Dem_SetEventStatus in
case the corresponding error occurs. The EventId is taken from
the referenced DemEventParameter’s DemEventId symbolic
value. The standardized errors are provided in this container and
can be extended by vendor-specific error references.
10.2.2 NvMCommon
4
Link time –
Post-build time –
Scope / Dependency scope: local
4
Scope / Dependency scope: local
4
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: local
4
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: ECU
4
Type EcucIntegerParamDef
Range 0 .. 7
Default value 0
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
4
Description Defines the number of queue entries for the standard job queue.
Multiplicity 1
Type EcucIntegerParamDef
Range 1 .. 65535
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
4
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.2.3 NvMBlockDescriptor
4
Range NVM_CRC16 (Default) CRC16 will be used if NVM_BLOCK_
USE_CRC==true.
NVM_CRC32 CRC32 is selected for this NVRAM block if NVM_
BLOCK_USE_CRC==true.
NVM_CRC8 CRC8 is selected for this NVRAM block if NVM_
BLOCK_USE_CRC==true.
Post-Build Variant Multiplicity false
Post-Build Variant Value false
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
dependency: NVM_BLOCK_USE_CRC, NVM_CALC_RAM_BLOCK_CRC
4
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
4
Post-build time –
Scope / Dependency scope: local
4
Description If this parameter is true it defines whether:
• the port with interface ’NvMMirror’ for synchronization mechanism callbacks
are generated if the parameter NvMBlockUseSyncMechanism is configured
TRUE;
• the port with interface ’NvMNotifyInitBlock’ for initialization block callback is
generated if NvMInitBlockCallback parameter is configured (independent of the
content);
• the port with interface ’NvMNotifyJobFinished’ for single block callback is
generated if NvMSingleBlockCallback parameter is configured (independent of
the content);
• the port with interface ’NvMAdmin’ for SetBlockProtection operation is
generated.
Multiplicity 1
Type EcucBooleanParamDef
Default value –
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
4
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
4
Post-Build Variant Value false
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
dependency: NVM_BLOCK_USE_CRC
4
Description Configuration parameter to perform the link between the NVM_NVRAM_BLOCK_
IDENTIFIER used by the SW-Cs and the FEE_BLOCK_NUMBER expected by the
memory abstraction modules. The parameter value equals the FEE_BLOCK_
NUMBER or EA_BLOCK_NUMBER shifted to the right by NvMDatasetSelectionBits
bits. (ref. to chapter 7.1.2.1).
Calculation Formula: value = TargetBlockReference.[Ea/Fee]BlockConfiguration.[Ea/
Fee]BlockNumber >> NvMDatasetSelectionBits
Multiplicity 1
Type EcucIntegerParamDef
Range 1 .. 65534
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
dependency: FEE_BLOCK_NUMBER, EA_BLOCK_NUMBER
4
Multiplicity 1
Type EcucIntegerParamDef
Range 1 .. 255
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
dependency: NVM_BLOCK_MANAGEMENT_TYPE
4
Description Defines whether a NVRAM block shall be treated resistant to configuration changes or
not. If there is no default data available at configuration time then the application shall
be responsible for providing the default initialization data. In this case the application
has to use NvM_GetErrorStatus()to be able to distinguish between first initialization
and corrupted data.
true: NVRAM block is resistant to changed software. false: NVRAM block is not
resistant to changed software.
Multiplicity 1
Type EcucBooleanParamDef
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
4
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
dependency: NVM_BLOCK_MANAGEMENT_TYPE, NVM_NV_BLOCK_NUM
4
Scope / Dependency scope: local
dependency: NVM_RAM_BLOCK_DATA_ADDRESS
4
Multiplicity 1
Type EcucBooleanParamDef
Default value –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
NvMInitBlockCallback 0..1 The presence of this container indicates, that a block specific
callback routine is called if no ROM data is available for
initialization of the NVRAM block. If the container is not present,
no callback routine is called for initialization of the NVRAM block
with default data.
In case the container has a NvMInitBlockCallbackFnc, the NvM
will call this function.
In case there is no NvMInitBlockCallbackFnc, the NvM will have
an port PNIB_{Block}.
NvMSingleBlockCallback 0..1 The presence of this container indicates, that the block specific
callback routine which shall be invoked on termination of each
asynchronous single block request [SWS_NvM_00113] If the
container is not present, no callback routine is called..
In case the container has a NvMSingleBlockCallbackFnc, the Nv
M will call this function.
In case there is no NvMSingleBlockCallbackFnc, the NvM will
have an port PNJF_{Block}.
NvMTargetBlockReference 1 This parameter is just a container for the parameters for EA and
FEE
10.2.4 NvMInitBlockCallback
4
Description Entry address of a block specific callback routine which shall be called if no ROM data
is available for initialization of the NVRAM block.
If not configured, no specific callback routine shall be called for initialization of the
NVRAM block with default data.
Multiplicity 0..1
Type EcucFunctionNameDef
Default value –
Regular Expression –
Post-Build Variant Multiplicity false
Post-Build Variant Value false
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
No Included Containers
10.2.5 NvMSingleBlockCallback
4
Post-Build Variant Multiplicity false
Post-Build Variant Value false
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: local
No Included Containers
10.2.6 NvMTargetBlockReference
Container Choices
Container Name Multiplicity Scope / Dependency
NvMEaRef 0..1 EEPROM Abstraction
NvMFeeRef 0..1 Flash EEPROM Emulation
10.2.7 NvMEaRef
4
Scope / Dependency scope: local
No Included Containers
10.2.8 NvMFeeRef
No Included Containers
10.2.9 NvmDemEventParameterRefs
4
Multiplicity 0..1
Type Symbolic name reference to DemEventParameter
Post-Build Variant Multiplicity false
Post-Build Variant Value false
Multiplicity Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: ECU
4
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.2.10 NvMBlockCiphering
4
Description This value specified the block length in case ciphered data is stored in NV RAM - in that
case the plain data length may not match the ciphered data length.
This value needs be filled out, if the ciphering, encryption and decryption, of the data is
enabled for this block. It will be used instead of the NvMNvBlockLength to access the
NV RAM.
Hint: This value can be equal or bigger than ’NvMNvBlockLength’ depending on the
characteristics of the referenced CSM Job inside ’NvMNameOfEncryptionJob’ (e.g.
CSM job adds padding information).
Tags: atp.Status=draft
Multiplicity 1
Type EcucIntegerParamDef
Range 1 .. 65535
Default value 16
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: local
4
Link time –
Post-build time –
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: ECU
No Included Containers