DEENESPTFRRUARHIKOZHNL

NVRAM Manager (NvM)

ModulNvM (NVRAM Manager)
BSW-Modul-ID20
Standard-Header#include "NvM.h"
SWS-SpezifikationAUTOSAR_SWS_NVRAMManager.pdf
ClusterMemory Services

Module guideAI-GENERATED

Manages non-volatile data blocks and synchronizes them asynchronously between RAM and NV memory.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: 1d912b11517a Provenance Open questions (1)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Manages non-volatile data blocks and synchronizes them asynchronously between RAM and NV memory.

The NVRAM Manager (NvM) is the single point of access to non-volatile memory. It copies NVRAM blocks implicitly between RAM and NV memory [SWS_NvM_00038]. At startup, NvM_ReadAll triggered by the BswM fills the RAM blocks; during shutdown, NvM_WriteAll saves modified blocks. Single requests such as NvM_WriteBlock are queued asynchronously, processed according to priority, and acknowledged via status or callback [SWS_NvM_00185]. The NvM handles read errors using retries, redundant copies, and default data; users must still check the block status themselves.

The NVRAM Manager (NvM) is the single point of access to non-volatile memory [SWS_NvM_00384]. It copies blocks implicitly between NVRAM and RAM; the application works directly with the RAM data [SWS_NvM_00038]. Toward lower layers, it uses the Memory Abstraction Interface with Fee or Ea [SWS_NvM_00051]. It reports states to the BswM, and errors to DEM and DET [SWS_NvM_00745] [SWS_NvM_00592].

kontext nutzer NvM user (SW-C via RTE, BSW modules) nvm NvM (NVRAM Manager) nutzer->nvm Single jobs NvM_ReadBlock, NvM_WriteBlock, … bswm BswM bswm->nvm NvM_Init, NvM_ReadAll, NvM_WriteAll, NvM_CancelWriteAll nvm->nutzer SingleBlock, InitBlock, and mirror callbacks nvm->bswm BswM_NvM_CurrentJobMode, BswM_NvM_CurrentBlockMode memif MemIf nvm->memif Read/write jobs, MemIf_GetJobResult dem Dem nvm->dem Produktionsfehler det Det nvm->det Entwicklungsfehler crc Crc nvm->crc CRC-Berechnung fee Fee / Ea memif->fee Forwarding fee->nvm NvM_JobEndNotification, NvM_JobErrorNotification

Context diagram: Integration of the NvM between users, BswM, MemIf/Fee/Ea, as well as DEM and DET. Sources: [SWS_NvM_00384] [SWS_NvM_00465] [SWS_NvM_00746]

Each NVRAM block consists of an NV block, a RAM block, and an Administrative Block, optionally supplemented by a ROM block containing default data [SWS_NvM_00138]. The types Native, Redundant, and Dataset exist; they differ in the number of NV and ROM blocks [SWS_NvM_00557] [SWS_NvM_00558] [SWS_NvM_00559]. The NvM synchronizes the RAM block implicitly directly or explicitly via a RAM mirror with callbacks [SWS_NvM_00511].

The lifecycle proceeds in three steps:

Single requests such as NvM_WriteBlock are queued and then set to NVM_REQ_PENDING [SWS_NvM_00185]. Optionally, the NvM uses a dedicated queue for immediate requests [SWS_NvM_00378]. The result is provided by NvM_GetErrorStatus or a configured callback [SWS_NvM_00015] [SWS_NvM_00740].

Asynchronous single-block job with notificationNvM-AnwenderNvMBswMBSW-TaskMemIfNvM_WriteBlock(BlockId, NvM_SrcPtr)einreihen, Blockergebnis:NVM_REQ_PENDINGoptNvMBswMBlockStatusInformation == TRUEBswM_NvM_CurrentBlockMode(BlockId, NVM_REQ_PENDING)E_OKloopUntil the write job is completedNvM_MainFunction()Schreibauftrag / Status abfragenJob-ErgebnisoptNvMSingleBlockCallback konfiguriertNvM_SingleBlockCallbackFunction(NVM_WRITE_BLOCK, JobResult)optNvMBswMBlockStatusInformation == TRUEBswM_NvM_CurrentBlockMode(BlockId, Ergebnis)NvM_GetErrorStatus(BlockId, RequestResultPtr)E_OK, Ergebnis

Sequence diagram: An asynchronous write request is queued, processed in NvM_MainFunction, and acknowledged via callback, BswM notification, and status query. Sources: [SWS_NvM_00185] [SWS_NvM_00347] [SWS_NvM_00891], SWS NvM p. 160

The NvM handles read errors via three stages:

Interpretation: The order of stages likely follows the enumeration in the Error Description. Question Q-027e7f981e4d0a43 (open) The NvM retries write errors up to NVM_MAX_NUM_OF_WRITE_RETRIES and then reports NVM_E_REQ_FAILED to the DEM [SWS_NvM_00684]. Users check the status of their blocks themselves [SWS_NvM_00694].

Role in the memory stack: single point of access to non-volatile memory

The NVRAM Manager (NvM) consolidates access to non-volatile data. The environment accesses the non-volatile memory exclusively via the NvM, which provides a callback interface for this purpose [SWS_NvM_00384]. Access is implicit: the NvM copies blocks between NVRAM and shared RAM. Observing synchronization rules, the application works directly with the RAM data [SWS_NvM_00038] [SWS_NvM_00692]. A block is selected via its configured block ID [SWS_NvM_00069] [SWS_NvM_00471]. Upper layers include only NvM.h for this purpose [SWS_NvM_00691]. The diagram for implicit updating shows the division of work: other parts of the basic software trigger the saving and restoring of all blocks depending on the ECU state. The SW-C only accesses the contents of its RAM blocks (SWS NvM p. 121).

Toward lower layers, the NvM works against the Memory Abstraction Interface. Together with Fee or Ea, it provides a virtual linear 32-bit address space [SWS_NvM_00051] [SWS_NvM_00465]. The NvM calculates checksums via the Crc module [SWS_NvM_00466]. It learns of the completion of a lower-layer job in two ways:

Production errors are sent to the DEM [SWS_NvM_00592], development errors to the DET [SWS_NvM_00614]. The NvM reports job states to the BswM [SWS_NvM_00745] [SWS_NvM_00746].

kontext nutzer NvM user (SW-C via RTE, BSW modules) nvm NvM (NVRAM Manager) nutzer->nvm Single jobs NvM_ReadBlock, NvM_WriteBlock, … bswm BswM bswm->nvm NvM_Init, NvM_ReadAll, NvM_WriteAll, NvM_CancelWriteAll nvm->nutzer SingleBlock, InitBlock, and mirror callbacks nvm->bswm BswM_NvM_CurrentJobMode, BswM_NvM_CurrentBlockMode memif MemIf nvm->memif Read/write jobs, MemIf_GetJobResult dem Dem nvm->dem Produktionsfehler det Det nvm->det Entwicklungsfehler crc Crc nvm->crc CRC-Berechnung fee Fee / Ea memif->fee Forwarding fee->nvm NvM_JobEndNotification, NvM_JobErrorNotification

Context diagram: The NvM mediates between users and BswM on one side and MemIf/Fee/Ea on the other. It reports errors to DEM and DET. Sources: [SWS_NvM_00384] [SWS_NvM_00745] [SWS_NvM_00746] [SWS_NvM_00465] [SWS_NvM_00466], Error Description p. 43

Structure of an NVRAM block and the three management types

An NVRAM block consists of the mandatory components NV block, RAM block, and Administrative Block. A ROM block with default data is optional [SWS_NvM_00138] [SWS_NvM_00139] [SWS_NvM_00020]. The composition is defined at configuration time by the block descriptor [SWS_NvM_00140]. The individual components:

The NvM supports the types NVM_BLOCK_NATIVE, NVM_BLOCK_REDUNDANT, and NVM_BLOCK_DATASET [SWS_NvM_00137]. They differ in the number of NV and ROM blocks [SWS_NvM_00557] [SWS_NvM_00558] [SWS_NvM_00559] (SWS NvM p. 10). For dataset blocks:

blockaufbau nvram NVRAM-Block (BlockId, Verwaltungstyp) nv NV-Block Header (opt.), Daten, CRC (opt.) nvram->nv NATIVE: 1 REDUNDANT: 2 DATASET: 1..m ram RAM block: permanent, temporary, or RAM mirror nvram->ram genau 1 rom ROM-Block (optional) Defaultdaten nvram->rom NATIVE/REDUNDANT: 0..1 DATASET: 0..n adm Administrative Block Index, Attribute, Fehler-/Status nvram->adm genau 1

Collaboration diagram (block structure): Mandatory and optional components of an NVRAM block with cardinalities per management type. Sources: [SWS_NvM_00138] [SWS_NvM_00557] [SWS_NvM_00558] [SWS_NvM_00559] [SWS_NvM_00134], SWS NvM p. 10

Lifecycle: NvM_Init, NvM_ReadAll, and NvM_WriteAll

The BswM calls NvM_Init exclusively [SWS_NvM_00693]. NvM_Init resets queues and state machines and internally signals \"INIT DONE\" [SWS_NvM_00399]. It initializes neither RAM blocks nor underlying modules [SWS_NvM_00091] [SWS_NvM_00193]. The configuration pointer is always NULL_PTR [SWS_NvM_00881]. Only after that does NvM_MainFunction process requests [SWS_NvM_00257].

The RAM blocks are subsequently filled by NvM_ReadAll [SWS_NvM_00718]. The call only signals the request. Processing is deferred until the single-block requests are completed [SWS_NvM_00243]. After that, the job runs in three steps:

  1. First, it compares the stored configuration ID with the compiled configuration ID [SWS_NvM_00073]. In case of a mismatch, the behavior depends on NvMDynamicConfiguration: with NvMDynamicConfiguration == FALSE, the mismatch is ignored [SWS_NvM_00248]. Otherwise, blocks that are not resistant to change receive default data [SWS_NvM_00249] [SWS_NvM_00674] (NV Data Handling p. 15).
  2. Then it iterates over the user blocks, excluding block IDs 0 and 1 [SWS_NvM_00244]. In doing so, it only processes blocks with a permanent RAM block or explicit synchronization [SWS_NvM_00118].
  3. Finally, it sets the overall result to NVM_REQ_OK or NVM_REQ_NOT_OK [SWS_NvM_00895] [SWS_NvM_00301].

In the mode management example, the BswM rule NvMReadAllFinished starts the remaining initialization only after completion of NvM_ReadAll (Mode Management Guide p. 31).

Start: NvM_Init and NvM_ReadAllBSW-TaskBswMNvMMemIf / Fee / EaUse Case: InitialisierungNvM_Init(NULL_PTR)Reset queues and states,“INIT DONE” – RAM blocks unchangedNvM_Init()Use Case: Multiblock-Auftrag NvM_ReadAllNvM_ReadAll()NvM_ReadAll()optNvMBswMMultiBlockJobStatusInformation == TRUEBswM_NvM_CurrentJobMode(ReadAll, NVM_REQ_PENDING)NvM_MainFunction()first step: stored andkompilierte Konfigurations-ID vergleichenloopper user block for NvM_ReadAll (excluding block IDs 0 and 1)NvM_MainFunction()NV-Block lesenJob-Ergebnisfill RAM block or mirror,Blockergebnis setzenoptNvMBswMMultiBlockJobStatusInformation == TRUEBswM_NvM_CurrentJobMode(ReadAll, Ergebnis)BswM_MainFunction()Regel NvMReadAllFinished:restliche BSW-Initialisierung

Sequence diagram: Asynchronous startup with NvM_Init, NvM_ReadAll, and notification of the multi-block state to the BswM. Sources: [SWS_NvM_00693] [SWS_NvM_00243] [SWS_NvM_00073] [SWS_NvM_00888] [SWS_NvM_00889], NV Data Handling p. 20

At shutdown, the BswM calls NvM_WriteAll [SWS_NvM_00092]. The job behaves as follows:

Users mark modified blocks with NvM_SetRamBlockStatus(…, TRUE), provided the API is enabled [SWS_NvM_00406] [SWS_NvM_00408]. For dirty-flag blocks, the RTE takes over this call (NV Data Handling p. 41).

NvM_CancelWriteAll is reserved for the BswM [SWS_NvM_00703] and remains without effect if NvM_WriteAll is not running [SWS_NvM_00233]. The current block is terminated non-destructively [SWS_NvM_00238]. The remaining blocks and the multi-block result receive NVM_REQ_CANCELED [SWS_NvM_00236] [SWS_NvM_00237] (SWS NvM p. 161).

Two additional multi-block requests supplement the lifecycle:

A queue length of one applies to all multi-block requests [SWS_NvM_00380].

Shutdown: NvM_WriteAll and NvM_CancelWriteAllBSW-TaskBswMNvMNvM_WriteAll()NvM_WriteAll()loopper block with permanent RAM or explicit synchronizationNvM_MainFunction()check “valid/modified”; protected andskip locked blocks; writealtAbbruch angefordertNvM_CancelWriteAll()NvM_CancelWriteAll()NvM_MainFunction()terminate current block non-destructively,remaining blocks: NVM_REQ_CANCELEDBswM_NvM_CurrentJobMode(WriteAll, NVM_REQ_CANCELED)regular completionBswM_NvM_CurrentJobMode(WriteAll, Ergebnis)Regel NvMWriteAllFinished:EcuM_GoDown

Sequence diagram: Shutdown with NvM_WriteAll and optional cancellation by NvM_CancelWriteAll. Sources: [SWS_NvM_00092] [SWS_NvM_00682] [SWS_NvM_00238] [SWS_NvM_00237] [SWS_NvM_00889], Mode Management Guide p. 37

Single requests: queues, priorities, and feedback

Single-block requests such as NvM_ReadBlock, NvM_WriteBlock, or NvM_RestoreBlockDefaults are asynchronous. The function accepts the parameters, queues the request, and returns [SWS_NvM_00195] [SWS_NvM_00208] [SWS_NvM_00224]. Afterward, the block result is set to NVM_REQ_PENDING [SWS_NvM_00185]. In case of a queue overflow, the function returns E_NOT_OK [SWS_NvM_00184]. A block is only queued if it is not already pending or being processed [SWS_NvM_00385].

Other services act synchronously in the caller's context, such as NvM_SetDataIndex [SWS_NvM_00448] and NvM_GetErrorStatus (SWS NvM p. 158). NvM_CancelJobs removes pending requests of a block; however, a running job is continued [SWS_NvM_00536] [SWS_NvM_00537].

Processing takes place serialized according to priority [SWS_NvM_00162]. If NvMJobPrioritization is active, the NvM uses two queues, one of them for immediate write requests (crash data) [SWS_NvM_00564] [SWS_NvM_00378]. Such an NvM_WriteBlock destructively aborts a pending job [SWS_NvM_00300]. NvM_MainFunction then restarts the aborted job [SWS_NvM_00258]. Without prioritization, the NvM works in order of arrival, without immediate jobs [SWS_NvM_00379]. Requests received during a multi-block request are queued and executed subsequently [SWS_NvM_00568] [SWS_NvM_00569].

Each asynchronous request stores its result in the error/status field [SWS_NvM_00175]. NvM_GetErrorStatus reads this field [SWS_NvM_00015]. In addition, there are two optional feedback paths:

Asynchronous single-block job with notificationNvM-AnwenderNvMBswMBSW-TaskMemIfNvM_WriteBlock(BlockId, NvM_SrcPtr)einreihen, Blockergebnis:NVM_REQ_PENDINGoptNvMBswMBlockStatusInformation == TRUEBswM_NvM_CurrentBlockMode(BlockId, NVM_REQ_PENDING)E_OKloopUntil the write job is completedNvM_MainFunction()Schreibauftrag / Status abfragenJob-ErgebnisoptNvMSingleBlockCallback konfiguriertNvM_SingleBlockCallbackFunction(NVM_WRITE_BLOCK, JobResult)optNvMBswMBlockStatusInformation == TRUEBswM_NvM_CurrentBlockMode(BlockId, Ergebnis)NvM_GetErrorStatus(BlockId, RequestResultPtr)E_OK, Ergebnis

Sequence diagram: Asynchronous write request with BswM status notifications, callback, and status query. Sources: [SWS_NvM_00185] [SWS_NvM_00347] [SWS_NvM_00740] [SWS_NvM_00890] [SWS_NvM_00891], SWS NvM p. 160

RAM block synchronization and block state

The NvM features two ways to synchronize data with the application's RAM block. With implicit synchronization, it works directly on this RAM block. The application provides the block and does not access it until the request completes [SWS_NvM_00698] [SWS_NvM_00699]. If it passes NULL_PTR, the NvM uses the permanent RAM block [SWS_NvM_00898] [SWS_NvM_00900]. A temporary block via pointer is still possible [SWS_NvM_00278]. The PRAM services always operate on the permanent RAM block [SWS_NvM_00765] [SWS_NvM_00794]. In the RTE scenario, this block is a Per-Instance-Memory (NV Data Handling p. 32).

With explicit synchronization (NvMBlockUseSyncMechanism), the exchange takes place via an internal RAM mirror [SWS_NvM_00511]. There is exactly one such mirror, sized according to the largest affected block [SWS_NvM_00513]. The NvM calls NvMWriteRamBlockToNvCallback or NvMReadRamBlockFromNvCallback [SWS_NvM_00515] [SWS_NvM_00516]. If a callback returns E_NOT_OK, it retries the call in the next cycle, up to NvMRepeatMirrorOperations times [SWS_NvM_00579] [SWS_NvM_00840]. The application may still modify the RAM block until the callback [SWS_NvM_00705]. A block uses either explicit synchronization or a permanent RAM block, not both [SWS_NvM_00904]. The mechanism allows shared blocks via an NvBlockSwComponentType (NV Data Handling p. 12).

Writing with explicit synchronizationAnwendung (SW-C/RTE)NvMBSW-TaskMemIfFill RAM block with dataNvM_WriteBlock(BlockId, NULL_PTR)E_OKRAM block may still be modifiedUntil callbackNvM_MainFunction()NvM_WriteRamBlockToNvm(NvMBuffer)(NvMWriteRamBlockToNvCallback)RAM-Block in RAM-Mirror kopierenaltReturn E_OKE_OKMirror-Inhalt in NV-Block schreibenReturn E_NOT_OKE_NOT_OKCallback in next NvM_MainFunctionerneut aufrufen (max. NvMRepeatMirrorOperations)

Sequence diagram: Write request with explicit synchronization via the RAM mirror, including retry upon E_NOT_OK. Sources: [SWS_NvM_00515] [SWS_NvM_00705] [SWS_NvM_00579] [SWS_NvM_00840], NV Data Handling p. 27

The NvM maintains a \"valid\"/\"invalid\" state for permanent RAM blocks and the mirror [SWS_NvM_00128] [SWS_NvM_00132]. The transitions in detail:

blockzustand invalid INVALID unchanged VALID / UNCHANGED invalid->unchanged NV-Daten erfolgreich gelesen changed VALID / CHANGED invalid->changed Defaultdaten geladen unchanged->invalid NvM_ReadBlock angenommen (permanenter RAM) unchanged->changed NvM_SetRamBlockStatus(TRUE) or NvM_ValidateAll changed->invalid NvM_ReadBlock angenommen (permanenter RAM) changed->unchanged erfolgreich in NV geschrieben

State diagram: RAM block states and the triggering events. Sources: [SWS_NvM_00198] [SWS_NvM_00200] [SWS_NvM_00366] [SWS_NvM_00406] [SWS_NvM_00472] [SWS_NvM_00856]

Configuration, protection mechanisms, and partition reference

Three API configuration classes exist for constrained resources [SWS_NvM_00149]. Class 1 does not support dataset blocks [SWS_NvM_00365]. The descriptor tables are generated [SWS_NvM_00143]. Users declare the memory requirements at configuration time [SWS_NvM_00030]. BSW modules do this via NvBlockNeeds (BSWMD Template p. 241). The ECU integrator derives the NvM configuration from this (Methodology p. 444).

Several protection mechanisms are available for individual blocks:

In case of partitioning, the NvM calls interfaces in the context of the respective assigned partition. General functions run in the master partition [SWS_NvM_00969]. NvM_ReadAll and NvM_WriteAll are offered only by the master [SWS_NvM_00970] [SWS_NvM_00971] [SWS_NvM_CONSTR00974]. SW-Cs reach the NvM via block-related ports:

Behavior in the event of an error

When reading, the NvM evaluates the notifications from the MemIf differently:

Several recovery stages take effect afterward:

  1. In case of CRC errors, configured read retries follow [SWS_NvM_00526].
  2. For redundant blocks, the NvM reads the second copy and attempts to restore redundancy [SWS_NvM_00199] [SWS_NvM_00531]. If this fails, it reports NVM_E_LOSS_OF_REDUNDANCY [SWS_NvM_00546].
  3. Finally, the NvM loads default data with the result NVM_REQ_RESTORED_DEFAULTS [SWS_NvM_00202]. The NV content remains unchanged in this process [SWS_NvM_00172].

If default data are missing, the RAM block remains invalid [SWS_NvM_00658] [SWS_NvM_00204]. Interpretation: The order of stages likely follows the enumeration in the Error Description (Error Description p. 62). Question (open) This source deviates from the requirements in two points. It mentions NVM_REQ_RESTORED_FROM_ROM instead of NVM_REQ_RESTORED_DEFAULTS. In addition, it summarizes the final failure generically as NVM_E_REQ_FAILED. The requirements mentioned above are normative.

lesefehler lesen Read NV block via MemIf pruef Result of MemIf and CRC check? lesen->pruef erfolg NVM_REQ_OK RAM-Block VALID / UNCHANGED pruef->erfolg in Ordnung inv NVM_REQ_NV_INVALIDATED, no Dem report pruef->inv MEMIF_BLOCK_INVALID retry Lesewiederholung (NVM_MAX_NUM_OF_READ_RETRIES) pruef->retry Error, retries remaining red NVM_BLOCK_REDUNDANT? pruef->red Error, retries exhausted retry->lesen zweit zweiten NV-Block lesen red->zweit yes def Defaultdaten vorhanden? (ROM-Block / Init-Callback) red->def no zweitok zweite Kopie in Ordnung? zweit->zweitok wieder Restore redundancy; on failure NVM_E_LOSS_OF_REDUNDANCY zweitok->wieder yes zweitok->def no wieder->erfolg restore Defaults in RAM laden NVM_REQ_RESTORED_DEFAULTS def->restore yes fail RAM block remains invalid, NVM_REQ_INTEGRITY_FAILED / NVM_REQ_NOT_OK, report to Dem def->fail no

Activity diagram: Read error handling from retry through the redundant copy to default data. Interpretation: The order follows the enumeration of the Error Description. Sources: [SWS_NvM_00526] [SWS_NvM_00199] [SWS_NvM_00202] [SWS_NvM_00341] [SWS_NvM_00658], Error Description p. 62

When writing, the NvM counts negative responses up to NVM_MAX_NUM_OF_WRITE_RETRIES [SWS_NvM_00213] [SWS_NvM_00216]. If the limit is exceeded, it sets NVM_REQ_NOT_OK and reports NVM_E_REQ_FAILED [SWS_NvM_00683] [SWS_NvM_00684] (Error Description p. 43). Two additional error scenarios:

The NvM reports incorrect usage to the DET if development error detection is enabled. Examples are NVM_E_UNINIT and NVM_E_BLOCK_PENDING [SWS_NvM_00614] [SWS_NvM_00615] as well as NVM_E_WRITE_PROTECTED [SWS_NvM_00962]. A multi-block request ends with NVM_REQ_NOT_OK as soon as a single block fails [SWS_NvM_00318]. Users check the status of their blocks themselves [SWS_NvM_00694]. After a failed read, they provide valid data before the next write [SWS_NvM_00696].

Further detailed evidence

AI-generated guideline based on R20-11 requirements and associated document locations. Document locations from other releases are supplementary. The linked specification texts remain authoritative.

NVRAM Manager (NvM)

Provides synchronous and asynchronous block-based data management for non-volatile storage (EEPROM, Flash).

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

function NvM_Init [SWS_NvM_00447] 📄 PDF

void NvM_Init (const NvM_ConfigType* ConfigPtr);

Service for resetting all internal variables.

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

Usage and Call Context

The function NvM_Init serves to synchronously reset all internal variables of the NVRAM Manager [SWS_NvM_00447]. It expects a pointer to the selected configuration data set as parameter ConfigPtr and has no return value [SWS_NvM_00447]. As a type 4 API, it is part of configuration classes 2 and 3 [SWS_NvM_00560], [SWS_NvM_00561]. The function is non-reentrant and may exclusively be called by the BSW Mode Manager [SWS_NvM_00447], [SWS_NvM_00693].

Initialization tasks

During the call, the function performs the following actions:

  • Resetting all internal variables, including state machines, job queues, and request flags, to their initial values [SWS_NvM_00399].
  • Setting the record index of all NVRAM blocks of type NVM_BLOCK_DATASET to zero [SWS_NvM_00192].
  • Internally setting the signal "INIT DONE", which is the prerequisite for job processing, queue management, and CRC recalculation in the module [SWS_NvM_00257], [SWS_NvM_00399].

Restrictions and Interaction

Due to strict ECU startup time requirements, NvM_Init does not initialize any configured NVRAM blocks [SWS_NvM_00091]. Permanent RAM block contents are not modified and synchronization callbacks are not called; this is reserved for the function NvM_ReadAll [SWS_NvM_00400]. Furthermore, NvM_Init initializes neither underlying drivers nor the memory hardware abstraction or external modules, as their initialization by the BSW Mode Manager is assumed [SWS_NvM_00157], [SWS_NvM_00193].

This usage note was generated automatically based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_SetBlockProtection [SWS_NvM_00450] 📄 PDF

Std_ReturnType NvM_SetBlockProtection (NvM_BlockIdType BlockId, boolean ProtectionEnabled);

Service for setting/ resetting the write protection for a NV block. Availabl e via Nv M.h

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

Usage and Semantics

The synchronous and reentrant function NvM_SetBlockProtection serves to set or reset the write protection for an NVRAM block via the corresponding attribute in the administrative block [SWS_NvM_00450], [SWS_NvM_00016]. It is assigned to API configuration class 3 [SWS_NvM_00560]. The environment of the NvM module can selectively enable or disable write protection via parameter ProtectionEnabled [SWS_NvM_00578]. The function returns E_OK upon successful execution and E_NOT_OK in case of an error [SWS_NvM_00450].

Restrictions and Concurrency

Changing the write protection is only permitted for blocks where NvMWriteBlockOnce is configured to FALSE, regardless of the value of parameter NvMBlockWriteProt [SWS_NvM_00325]. If NvMWriteBlockOnce is configured to TRUE, write protection must neither be enabled nor disabled [SWS_NvM_00398], [SWS_NvM_00577]; this protection cannot be removed even after read operations [SWS_NvM_00314], [SWS_NvM_00316], [SWS_NvM_00784]. Furthermore, a locked state set via NvM_SetBlockLockStatus cannot be modified by NvM_SetBlockProtection [SWS_NvM_00754]. As long as a single-block job is active or queued for the same block, the call is not permitted [SWS_NvM_00704].

Error handling

When development error detection (DET) is enabled, the function reports specific error states:

  • NVM_E_UNINIT if the NvM module is not yet initialized [SWS_NvM_00606].
  • NVM_E_PARAM_BLOCK_ID if the passed BlockId is out of the valid range [SWS_NvM_00609].
  • NVM_E_BLOCK_PENDING if an operation is already active or queued for the block [SWS_NvM_00607].
  • NVM_E_BLOCK_CONFIG if the block is configured with NvMWriteBlockOnce = TRUE [SWS_NvM_00608].
  • NVM_E_BLOCK_LOCKED if the block is locked [SWS_NvM_00759].

This usage note is based on the specification of the NVRAM Manager in AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_GetErrorStatus [SWS_NvM_00451] 📄 PDF

Std_ReturnType NvM_GetErrorStatus (NvM_BlockIdType BlockId, NvM_RequestResultType* RequestResultPtr);

Service to read the block dependent error/ status information.

function NvM_SetRamBlockStatus [SWS_NvM_00453] 📄 PDF

Std_ReturnType NvM_SetRamBlockStatus (NvM_BlockIdType BlockId, boolean BlockChanged);

Service for setting the RAM block status of a permanent RAM block or the status of the explicit synchronization of a NVRAM block.

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

The synchronous and reentrant function NvM_SetRamBlockStatus serves to set the RAM block status for permanent RAM blocks or for blocks with explicit synchronization [SWS_NvM_00453]. It is available in API configuration classes 2 and 3 [SWS_NvM_00561], [SWS_NvM_00560], provided it has been enabled via the configuration parameter NvMSetRamBlockStatusApi [SWS_NvM_00408].

Parameter BlockChanged controls whether the block is marked as valid and changed (TRUE) or as invalid and unchanged (FALSE) [SWS_NvM_00453], [SWS_NvM_00406]. When passing TRUE, the module assumes the validity of the data [SWS_NvM_00241]. The function returns E_OK upon a successful status change and E_NOT_OK in case of an error [SWS_NvM_00453].

If BlockChanged is set to TRUE, the function requests a checksum recalculation in NvM_MainFunction in the background if NvMCalcRamBlockCrc is configured [SWS_NvM_00121]. For blocks without permanent RAM with explicit synchronization, this job uses the write callback to obtain data [SWS_NvM_00906]. If this fails, configured retries occur per call of NvM_MainFunction [SWS_NvM_00907], [SWS_NvM_00908]. If all attempts remain unsuccessful, the job is nevertheless considered finished and the block remains marked as changed [SWS_NvM_00909].

Before the call, the NvM module must be initialized [SWS_NvM_00711]. If development error detection is active, the function reports NVM_E_UNINIT if the module is uninitialized [SWS_NvM_00643], NVM_E_PARAM_BLOCK_ID in case of invalid BlockId [SWS_NvM_00645], and NVM_E_BLOCK_PENDING if jobs are already running or queued [SWS_NvM_00644]. As long as a single-block job is active, the function must not be called for this block [SWS_NvM_00704]. A block lock set via NvM_SetBlockLockStatus cannot be modified via this [SWS_NvM_00754].

This usage note was generated automatically based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_SetBlockLockStatus [SWS_NvM_00548] 📄 PDF

void NvM_SetBlockLockStatus (NvM_BlockIdType BlockId, boolean BlockLocked);

Service for setting the lock status of a permanent RAM block or of the explicit synchronization of a NVRAM block.

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

Usage and Call Context

The synchronous and reentrant function NvM_SetBlockLockStatus serves to lock (BlockLocked = TRUE) or unlock (BlockLocked = FALSE) a permanently configured RAM block or the explicit synchronization of an NVRAM block [SWS_NvM_00548]. It belongs to the functional scope of API configuration classes 2 and 3 [SWS_NvM_00561], [SWS_NvM_00560]. The function is not included in the ServicePort interface and is primarily called by the DCM as well as by complex device drivers (CDD) [SWS_NvM_00732].

Restrictions and Interaction

The call affects only NVRAM blocks with a permanent RAM block or configured explicit synchronization; for all other blocks, it remains without effect [SWS_NvM_00732]. If a block is locked (BlockLocked = TRUE), the NvM ensures that the associated NV data are not modified: The block is skipped during NvM_WriteAll, and the services NvM_WriteBlock, NvM_WritePRAMBlock, NvM_InvalidateNvBlock as well as NvM_EraseNvBlock are rejected [SWS_NvM_00751]. During the next startup, the NvM is guaranteed to load the block from NV memory during NvM_ReadBlock or NvM_ReadPRAMBlock [SWS_NvM_00752]. The set lock status cannot be modified via NvM_SetRamBlockStatus nor via NvM_SetBlockProtection [SWS_NvM_00754]. Passing BlockLocked = FALSE restores regular processing [SWS_NvM_00753].

Error handling

When development error detection (DET) is enabled, the function reports specific development errors:

  • NVM_E_UNINIT, if the NvM module is not yet initialized at the time of the call [SWS_NvM_00728].
  • NVM_E_PARAM_BLOCK_ID, if the parameter BlockId is outside the permissible range [SWS_NvM_00731].
  • NVM_E_BLOCK_CONFIG, provided that the referenced NVRAM block is configured with the parameter NvMWriteBlockOnce = TRUE [SWS_NvM_00730].

This usage note is based on the AUTOSAR Classic specification R20-11 and summarizes the requirements regarding call, protection effect, and error handling of the API.

Implementer's Guide to follow (complexity I2)

function NvM_CancelJobs [SWS_NvM_00535] 📄 PDF

Std_ReturnType NvM_CancelJobs (NvM_BlockIdType BlockId);

Service to cancel all jobs pending for a NV block.

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

Usage and Semantics

The function NvM_CancelJobs, available via NvM.h, serves to synchronously cancel all queued jobs for a specific NVRAM block [SWS_NvM_00535], [SWS_NvM_00536]. The function is designed as reentrant and expects as a parameter the BlockId, which uniquely identifies the block descriptor of the NVRAM block concerned [SWS_NvM_00535]. The call returns E_OK if queued jobs could be successfully removed from the queue, and E_NOT_OK if no job was found in the queue for the specified block [SWS_NvM_00535].

Sequence and concurrency

A job that is already actively being processed at the time of the function call is not interrupted by NvM_CancelJobs, but continues to run until the end [SWS_NvM_00537]. If the cancellation request for waiting jobs is accepted, the service pre-sets the block-specific request result to NVM_REQ_CANCELED [SWS_NvM_00225], [SWS_NvM_00536]. The purpose of this cleanup is to clear the queue, for example upon termination or restart of a partition, and thus prevent subsequent notifications about completed jobs [SWS_NvM_00225].

Error Handling and Configuration

When development error detection (DET) is enabled, the function checks the preconditions: If the module is not yet initialized, the error NVM_E_UNINIT is reported [SWS_NvM_00648]. If the passed BlockId is outside the valid range, the DET message NVM_E_PARAM_BLOCK_ID is issued [SWS_NvM_00649]. NvM_CancelJobs is classified as a Type 2 API and is available in API configuration classes 2 and 3 [SWS_NvM_00561], [SWS_NvM_00560].

This usage note was generated automatically based on the AUTOSAR specification.

Implementer's Guide to follow (complexity I2)

function NvM_ReadBlock [SWS_NvM_00454] 📄 PDF

Std_ReturnType NvM_ReadBlock (NvM_BlockIdType BlockId, void* NvM_DstPtr);

Service to copy the data of the NV block to its corresponding RAM block.

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

Usage and Semantics

The function NvM_ReadBlock serves for asynchronously copying user data from NV memory into the associated RAM block [SWS_NvM_00010], [SWS_NvM_00454]. The call is reentrant [SWS_NvM_00454]. It accepts the parameters, queues the read request into the internal job queue, and immediately returns E_OK upon successful acceptance or E_NOT_OK upon rejection [SWS_NvM_00195], [SWS_NvM_00454].

If a pointer NvM_DstPtr is passed, data can be read into a temporary RAM buffer deviating from the block configuration; an invalid NULL pointer leads to a DET error in this scenario [SWS_NvM_00196], [SWS_NvM_00278]. A configured permanent RAM block is marked as invalid directly upon queuing or at the start of job processing [SWS_NvM_00198]. Only after a successful copy operation is the RAM block considered valid as well as unchanged [SWS_NvM_00200], and the job result changes to NVM_REQ_OK [SWS_NvM_00206].

Error Handling and Data Integrity

If a checksum is enabled for the block (NvMCalRamBlockCrC == TRUE), the job requests a recalculation after copying [SWS_NvM_00201]:

  • In the case of CRC errors, NVM_E_INTEGRITY_FAILED is reported to the DEM [SWS_NvM_00203]. If available, default values are loaded and the result is set to NVM_REQ_RESTORED_DEFAULTS [SWS_NvM_00202]. If ROM data and initialization callbacks are missing, NVM_REQ_INTEGRITY_FAILED results [SWS_NvM_00204].
  • If the memory driver reports MEMIF_JOB_FAILED and no replacement values are available, the job ends with NVM_REQ_NOT_OK [SWS_NvM_00359].

Special Features of the Block Types

  • Redundant: If reading the first copy fails, the second NV copy is automatically used [SWS_NvM_00199]. If both copies are invalid, the overall block is invalidated [SWS_NvM_00317].
  • Dataset: If the block selected via the dataset index is marked as invalid, copying to the RAM is omitted [SWS_NvM_00355].
  • Write-Once: Consistently read blocks with NVM_WRITE_BLOCK_ONCE set become permanently write-protected [SWS_NvM_00316].

This text was created by an AI and is based exclusively on the specifications of Release R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_WriteBlock [SWS_NvM_00455] 📄 PDF

Std_ReturnType NvM_WriteBlock (NvM_BlockIdType BlockId, const void* NvM_SrcPtr);

Service to copy the data of the RAM block to its corresponding NV block. Available vi a Nv M.h

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

The function NvM_WriteBlock serves to copy data of a RAM block to the assigned NV block [SWS_NvM_00455], [SWS_NvM_00410]. The call is executed reentrantly and asynchronously: The function accepts the passed parameters BlockId and NvM_SrcPtr, queues the write job in the internal job queue, and returns immediately [SWS_NvM_00208]. The return value indicates successful acceptance with E_OK or rejection of the job with E_NOT_OK [SWS_NvM_00455].

Regarding parameterization and data source, the following specifications apply:

  • If a valid RAM address is passed via NvM_SrcPtr, the write job uses this buffer [SWS_NvM_00210]. This also allows saving temporary RAM blocks for blocks that are actually permanently configured or have explicit synchronization [SWS_NvM_00280].
  • A configured permanent RAM block is assumed to be valid or is automatically validated before the copying process [SWS_NvM_00303].
  • If a checksum is configured for the NV block, the job requests a CRC recalculation before the write operation [SWS_NvM_00212].
  • For dataset blocks (NVM_BLOCK_DATASET), the target is selected via the data index stored in the administrative block [SWS_NvM_00338].
  • For redundant blocks (NVM_BLOCK_REDUNDANT), the job completes with NVM_REQ_OK as soon as at least one copy has been successfully written [SWS_NvM_00284].
  • If NvMWriteBlockOnce == TRUE is set, the job immediately enables write protection in the administrative block after successful writing [SWS_NvM_00328].
  • Write jobs for the reserved block ID 1 are only permitted when NvMDynamicConfiguration is enabled [SWS_NvM_00311].

Error handling and concurrency:

  • If development detection is active, NvM_WriteBlock reports the DET error NVM_E_UNINIT when the module is uninitialized [SWS_NvM_00619] as well as NVM_E_BLOCK_PENDING if the same block is already being processed or is queued [SWS_NvM_00620]. A missing source pointer for temporary buffers results in a DET parameter error [SWS_NvM_00280].
  • Negative responses from the memory interface increment the retry counter; after exceeding NVM_MAX_NUM_OF_WRITE_RETRIES, the job ends with NVM_REQ_NOT_OK [SWS_NvM_00213], [SWS_NvM_00216].
  • If the block is configured with immediate priority, NvM_WriteBlock destructively aborts a currently running job so that the write job is processed next [SWS_NvM_00300].

This usage note was generated automatically based on the AUTOSAR specification.

Implementer's Guide to follow (complexity I2)

function NvM_RestoreBlockDefaults [SWS_NvM_00456] 📄 PDF

Std_ReturnType NvM_RestoreBlockDefaults (NvM_BlockIdType BlockId, void* NvM_DestPtr);

Service to restore the default data to its corr esponding RAM block.

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

Usage and Semantics

The function NvM_RestoreBlockDefaults restores default data in the associated RAM block ([SWS_NvM_00456], [SWS_NvM_00012]). It operates asynchronously: after being called, it accepts the parameters, queues the request into the internal job queue, and returns immediately with E_OK upon successful acceptance or with E_NOT_OK upon rejection ([SWS_NvM_00456], [SWS_NvM_00224]). If a valid RAM address is passed via the output parameter NvM_DestPtr, this is used as the target address ([SWS_NvM_00435]). To copy ROM data into a temporary RAM block even though a permanent RAM block or synchronization callbacks are configured, the caller must mandatory pass a pointer not equal to NULL ([SWS_NvM_00436]).

Error Handling and Boundary Conditions

The function is non-reentrant ([SWS_NvM_00456]) and part of API configuration classes 2 and 3 ([SWS_NvM_00561], [SWS_NvM_00560]). If development error detection (DET) is active, it reports NVM_E_UNINIT if the module is still uninitialized ([SWS_NvM_00625]), NVM_E_PARAM_BLOCK_ID for an invalid BlockId ([SWS_NvM_00630]), and a parameter error if no valid target pointer is passed for temporary copying in permanently configured blocks ([SWS_NvM_00436]). The function fails synchronously with E_NOT_OK if the block is of type NVM_BLOCK_DATASET, at least one ROM block exists, and the current data index points to an NV block ([SWS_NvM_00353]).

Job Processing and Interaction

As part of asynchronous job processing, the service loads default values from a configured ROM block ([SWS_NvM_00267]). If a permanent RAM block is requested or an explicit synchronization callback (NvMReadRamBlockFromNvCallback) is used, the RAM block is invalidated prior to the copy operation or prior to the callback invocation ([SWS_NvM_00227]). After a successful copy operation or after the synchronization callback returns with E_OK, the RAM block is validated and marked as changed ([SWS_NvM_00228]). If a checksum is configured for the block, the job finally requests a CRC recalculation ([SWS_NvM_00229]). The same recovery logic is also used by NvM_ReadBlock and NvM_ReadAll as a fallback mechanism in case of faulty memory read access or CRC errors ([SWS_NvM_00202], [SWS_NvM_00293], [SWS_NvM_00657]).

This usage note was generated automatically based on the specification AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_EraseNvBlock [SWS_NvM_00457] 📄 PDF

Std_ReturnType NvM_EraseNvBlock (NvM_BlockIdType BlockId);

Service to erase a NV block.

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

The reentrant, asynchronous function NvM_EraseNvBlock ([SWS_NvM_00457]) of API configuration class 3 ([SWS_NvM_00560]) serves for erasing a non-volatile memory block based on the passed BlockId. If no write protection is active, the function accepts the parameters, queues the erase job into the internal job queue, and returns immediately ([SWS_NvM_00231], [SWS_NvM_00418]). The return value E_OK signals the successful acceptance of the job, while E_NOT_OK indicates rejection ([SWS_NvM_00457]).

Before the call, the NvM module must be fully initialized ([SWS_NvM_00715]). After queuing, write protection is not checked again before the job is retrieved from the queue ([SWS_NvM_00662]). For redundant blocks of type NVM_BLOCK_REDUNDANT, the erase operation is only considered successful once both redundant NV blocks have been erased ([SWS_NvM_00269]). The data content of an associated RAM block always remains unchanged by the job processing ([SWS_NvM_00416]).

A call is rejected if a ROM block of a dataset block is addressed ([SWS_NvM_00661]) or the block is locked via NvM_SetBlockLockStatus ([SWS_NvM_00751]). With development error detection (DET) activated, the function reports NVM_E_UNINIT if the module is uninitialized ([SWS_NvM_00631]), NVM_E_PARAM_BLOCK_ID for an invalid BlockId ([SWS_NvM_00635]), and NVM_E_BLOCK_LOCKED for a blocked block ([SWS_NvM_00757]). If the block does not have immediate priority or standard priority is configured, error NVM_E_BLOCK_CONFIG is reported and E_NOT_OK is returned if DET is active ([SWS_NvM_00357], [SWS_NvM_00636]). If the subsequent asynchronous execution fails, the request status is set to NVM_REQ_NOT_OK ([SWS_NvM_00271]) and NVM_E_REQ_FAILED is reported to the DEM ([SWS_NvM_00663]).

This usage note was generated automatically based on the specification.

Implementer's Guide to follow (complexity I2)

function NvM_InvalidateNvBlock [SWS_NvM_00459] 📄 PDF

Std_ReturnType NvM_InvalidateNvBlock (NvM_BlockIdType BlockId);

Service to invalidate a NV block.

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

The function NvM_InvalidateNvBlock is an asynchronous and reentrant service of API configuration class 3 for invalidating an NV block [SWS_NvM_00459], [SWS_NvM_00560]. The call prerequisite is that the NvM module must previously have been initialized by the module environment [SWS_NvM_00717]. The call accepts parameter BlockId, queues the request into the queue when write protection is deactivated, and returns with E_OK [SWS_NvM_00239], [SWS_NvM_00424]. If the job cannot be accepted, the function returns E_NOT_OK [SWS_NvM_00459].

A call is rejected synchronously with E_NOT_OK if a ROM block of a dataset block is specified via BlockId [SWS_NvM_00664]. If the block was previously locked via NvM_SetBlockLockStatus, the NvM rejects the job [SWS_NvM_00751] and reports the DET error NVM_E_BLOCK_LOCKED if the development error interface is active [SWS_NvM_00756]. If the block is already queued or in execution, the DET message NVM_E_BLOCK_PENDING is issued [SWS_NvM_00639].

The actual asynchronous job invalidates the referenced NV block [SWS_NvM_00421] taking the following constraints into account:

  • For redundant blocks (NVM_BLOCK_REDUNDANT), the job result is only set to NVM_REQ_OK once both redundant NV blocks have been successfully invalidated [SWS_NvM_00274]; the same mechanism is also used for NvM_FirstInitAll [SWS_NvM_00919], [SWS_NvM_00920].
  • For blocks with NVM_WRITE_BLOCK_ONCE, the job leaves the write protection unchanged [SWS_NvM_00960]. If no read operation preceded, the job reports the DET error NVM_E_WRITE_ONCE_STATUS_UNKNOWN [SWS_NvM_00958].
  • If an error occurs during asynchronous processing, the request result is set to NVM_REQ_NOT_OK [SWS_NvM_00275] and the production error NVM_E_REQ_FAILED is transmitted to the DEM [SWS_NvM_00666].

This usage note was generated by an AI and is based exclusively on the specification data from AUTOSAR R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_ReadPRAMBlock [SWS_NvM_00764] 📄 PDF

Std_ReturnType NvM_ReadPRAMBlock (NvM_BlockIdType BlockId);

Service to copy the data of the NV block to its corresponding permanent RAM block.

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

use

The asynchronous and reentrant function [SWS_NvM_00764] serves to copy data of an NV block into the associated permanent RAM block. The call takes over the BlockId, enqueues the read request into the internal job queue, and returns immediately [SWS_NvM_00766]. The return value E_OK confirms the acceptance of the job, whereas E_NOT_OK signals a rejection [SWS_NvM_00764]. The function belongs to the functional scope of API configuration classes 2 and 3 [SWS_NvM_00560], [SWS_NvM_00561].

Sequence and Synchronization

Upon successful enqueuing of the job or start of processing, the permanent RAM block is invalidated immediately [SWS_NvM_00767]. If an explicit synchronization is set up for the block, the application is allowed to modify the RAM block until the synchronization routine arrives; in this case, invalidation takes place directly before the call of NvMReadRamBlockFromNvCallback [SWS_NvM_00706], [SWS_NvM_00767]. If the NV data were transferred into the RAM without errors, the job completes with the status NVM_REQ_OK [SWS_NvM_00765], [SWS_NvM_00775].

Error Handling and Redundancy

For blocks of type NVM_BLOCK_REDUNDANT, the job automatically starts a read attempt on the second block if the first read attempt fails [SWS_NvM_00768]. For datasets (NVM_BLOCK_DATASET), copying is prevented if the NV block selected via the index is inconsistent [SWS_NvM_00771]; if the index references ROM data, these are loaded and the result is set to NVM_REQ_OK [SWS_NvM_00772]. If default data are configured and the NV block cannot be read while the RAM state is invalid, an implicit restoration takes place [SWS_NvM_00575], which classifies the RAM block as valid as well as changed [SWS_NvM_00774]; without configured default values, restoration is omitted [SWS_NvM_00572]. If NvM_SetBlockLockStatus was previously active, reloading from NV memory is enforced [SWS_NvM_00752].

This usage note was generated automatically based on the specification status of AUTOSAR CP R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_WritePRAMBlock [SWS_NvM_00793] 📄 PDF

Std_ReturnType NvM_WritePRAMBlock (NvM_BlockIdType BlockId);

Service to copy the data of the permanent RAM block to its corresponding NV block.

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

The reentrant, asynchronous function NvM_WritePRAMBlock initiates writing the data of a permanent RAM block into the associated NV block [SWS_NvM_00793], [SWS_NvM_00794]. The function is available in API configuration classes 2 and 3 [SWS_NvM_00561], [SWS_NvM_00560]. The reserved block ID 1 may only be passed if NvMDynamicConfiguration is set to TRUE [SWS_NvM_00311].

Upon passing, the function provides E_OK on successful acceptance or E_NOT_OK [SWS_NvM_00793]. If the referenced block is locked, the call fails with E_NOT_OK and the module reports a DET error [SWS_NvM_00797]. Block protection is already checked upon enqueuing into the job queue and is not validated again prior to job execution [SWS_NvM_00799]. If the NVRAM block has immediate priority, a running job is immediately destructively aborted and this write job is processed next [SWS_NvM_00800].

Prior to the actual transfer into the NV memory, the job requests a CRC recalculation, provided that the block is configured with CRC [SWS_NvM_00801]. A still invalid permanent RAM block is automatically validated [SWS_NvM_00803]. For redundant blocks (NVM_BLOCK_REDUNDANT), both NV blocks are written, beginning with the one that was not read during preceding read jobs [SWS_NvM_00807], [SWS_NvM_00808]. In the event of write errors, the number of retries is limited by NVM_MAX_NUM_OF_WRITE_RETRIES [SWS_NvM_00806]; in the event of an overflow, the NvM sets the job result to NVM_REQ_NOT_OK [SWS_NvM_00804] and reports NVM_E_REQ_FAILED to the DEM [SWS_NvM_00805].

With respect to concurrency, the following applies: With implicit synchronization, the application must no longer modify the buffer data after the call until the end of the job; read access remains permitted [SWS_NvM_00698]. With explicit synchronization, the buffer may be modified until the callback routine NvMWriteRamBlockToNvCallback is called [SWS_NvM_00705].

This text was generated by an AI and serves for technical orientation based on the specification.

Implementer's Guide to follow (complexity I2)

function NvM_RestorePRAMBlockDefaults [SWS_NvM_00813] 📄 PDF

Std_ReturnType NvM_RestorePRAMBlockDefaults (NvM_BlockIdType BlockId);

Service to restore the default data to its corresponding permanent RAM block.

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

Usage and Semantics

The function NvM_RestorePRAMBlockDefaults restores default data in the associated permanent RAM block ([SWS_NvM_00813], [SWS_NvM_00814]). The service operates asynchronously and accepts the identifier of the NVRAM block descriptor via the parameter BlockId ([SWS_NvM_00813]). Upon the call, the request is enqueued into the internal job queue ([SWS_NvM_00815]). The return value E_OK signals successful acceptance, whereas E_NOT_OK indicates a rejection ([SWS_NvM_00813]). If a ROM block is configured, the data are loaded from it within the scope of the asynchronous processing ([SWS_NvM_00816]).

Error Handling and Boundary Conditions

If neither ROM default data nor a callback routine NvMInitBlockCallback are configured for the block, the block status remains unchanged and the call provides E_NOT_OK ([SWS_NvM_00884]). When development error detection (DET) is enabled, specific errors are reported:

  • NVM_E_UNINIT: The module is not yet initialized ([SWS_NvM_00831]).
  • NVM_E_PARAM_BLOCK_ID: The passed BlockId is out of the valid range ([SWS_NvM_00834]).
  • NVM_E_BLOCK_PENDING: A job is already queued or in progress for the block ID ([SWS_NvM_00832]).
  • NVM_E_BLOCK_WITHOUT_DEFAULTS: Neither ROM default data nor an initialization callback exist ([SWS_NvM_00886]).
  • NVM_E_PARAM_ADDRESS: Neither a permanent RAM block nor explicit synchronization is configured ([SWS_NvM_00894]).

Concurrency and Interaction

The service is specified as non-reentrant ([SWS_NvM_00813]) and is available in API configuration classes 2 and 3 ([SWS_NvM_00561], [SWS_NvM_00560]). The same restoration logic is additionally used internally during NvM_ReadPRAMBlock if the underlying read operation fails ([SWS_NvM_00789], [SWS_NvM_00882]).

This usage note is based on the specifications of AUTOSAR Classic Release R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_ReadAll [SWS_NvM_00460] 📄 PDF

void NvM_ReadAll (void);

Initiates a multi block read request.

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

The function NvM_ReadAll asynchronously triggers a multi-block read job to initialize the RAM data blocks [SWS_NvM_00460], [SWS_NvM_00158]. It has no parameters, provides no return value, and is non-reentrant [SWS_NvM_00460]. The call signals the request to the NvM module and returns immediately; actual processing, however, is delayed until all single-block job queues are empty [SWS_NvM_00243].

At the beginning, the job validates the configuration ID during system startup by comparing the stored value with the compiled value [SWS_NvM_00073], [SWS_NvM_00246]:

  • If they match, standard preparation takes place for all configured blocks [SWS_NvM_00247].
  • A configuration difference is ignored if NvMDynamicConfiguration == FALSE is set [SWS_NvM_00248].
  • If NvMDynamicConfiguration == TRUE and NvMResistantToChangedSw == FALSE, an extended preparation is executed in case of a mismatch [SWS_NvM_00249].

The job then iterates over all user blocks, starting with the lowest block ID (excluding the reserved IDs 0 and 1) [SWS_NvM_00244]. Permanent RAM blocks or blocks with a configured synchronization callback NvM_ReadRamBlockFromNvm are taken into account, provided that NvmSelectBlockForReadall == TRUE is configured [SWS_NvM_00118]. Blocks that are selected but not read receive the result NVM_REQ_BLOCK_SKIPPED [SWS_NvM_00287].

For redundant blocks (NVM_BLOCK_REDUNDANT), the second NV block is automatically read if the first read attempt fails [SWS_NvM_00288]. After successful loading into RAM, the block status is set to "valid/unmodified" and the job result is set to NVM_REQ_OK [SWS_NvM_00251], [SWS_NvM_00290], [SWS_NvM_00291]. For blocks with NvMCalRamBlockCrC == TRUE, the job requests a CRC recalculation [SWS_NvM_00292]. If configured, NvMSingleBlockCallback is called for each block and MultiBlockCallback is called after the last block [SWS_NvM_00281].

This usage note is based on the specification requirements for AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I1)

function NvM_WriteAll [SWS_NvM_00461] 📄 PDF

void NvM_WriteAll (void);

Initiates a multi block write request.

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

Usage and Call Context

The function NvM_WriteAll asynchronously triggers a multi-block write job and has neither parameters nor return values [SWS_NvM_00461]. After the call, the function signals the request to the NvM module and returns immediately [SWS_NvM_00254]. The actual processing is deferred until all queues for single-block jobs are completely processed [SWS_NvM_00254]. The call typically occurs as part of the basic shutdown procedure by the BSW Mode Manager [SWS_NvM_00092].

Sequence and block processing

During shutdown, the job synchronizes permanent RAM blocks with the associated NV blocks or executes the explicit synchronization callback NvM_WriteRamBlockToNvm [SWS_NvM_00018]. Only blocks for which the configuration parameter NvMSelectBlockForWriteAll is set to true are considered [SWS_NvM_00252], as well as block 1 in case of differing configuration IDs when dynamic configuration is active [SWS_NvM_00310]. If a CRC is configured for an NVRAM block, the job requests a recalculation before the write operation and updates the checksum [SWS_NvM_00253]. For blocks with NvMWriteBlockOnce == TRUE, the job immediately sets the write protection flag in the administrative block after successful writing [SWS_NvM_00329].

Concurrency and Error Handling

  • Reentrancy: The function is non-reentrant [SWS_NvM_00461].
  • Error monitoring: To avoid infinite loops, a retry counter monitors the retries in case of unsuccessful responses from the MemIf module [SWS_NvM_00296].
  • Job results: If the processing of at least one block fails, the overall result is set to NVM_REQ_NOT_OK [SWS_NvM_00318]. For configured blocks that were not written, the individual result NVM_REQ_BLOCK_SKIPPED is set [SWS_NvM_00298]. For redundant blocks (NVM_BLOCK_REDUNDANT), the individual job is considered NVM_REQ_OK as soon as at least one of the NV blocks has been written successfully [SWS_NvM_00337].
  • Cancellation: A running job can be canceled by NvM_CancelWriteAll [SWS_NvM_00019]. This leads to the overall result NVM_REQ_CANCELED [SWS_NvM_00237], whereby the block currently being processed is completed in a non-destructive and data-consistent manner [SWS_NvM_00238].

This text was generated by an AI and serves as guidance. The AUTOSAR specification is authoritative.

Implementer's Guide to follow (complexity I1)

function NvM_CancelWriteAll [SWS_NvM_00458] 📄 PDF

void NvM_CancelWriteAll (void);

Service to cancel a running Nv M_ Write All request.

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

Usage and Semantics

The function NvM_CancelWriteAll serves to prematurely abort an ongoing multi-block write operation (NvM_WriteAll) [SWS_NvM_00458], [SWS_NvM_00019]. The call is asynchronous, non-reentrant, takes no parameters, and returns no return value [SWS_NvM_00458]. The function signals the abort request directly to the module and returns immediately [SWS_NvM_00232]. The request is not enqueued in the job queue; only one request of this type can be pending at any time [SWS_NvM_00420]. If no operation is active at the time of calling, the call has no effect [SWS_NvM_00233].

Sequence and Data Consistency

The abort is performed in such a way that the data consistency of the NVRAM block being processed at the time of the abort is not affected [SWS_NvM_00019]. The module completes this active block regularly and sets its status attribute to NVM_REQ_OK or NVM_REQ_NOT_OK depending on success, while all remaining still pending blocks are set to NVM_REQ_CANCELED [SWS_NvM_00236]. The overall result is implicitly predetermined by the result of the aborted operation [SWS_NvM_00235], is stored in a separate variable [SWS_NvM_00393], and can be queried via NvM_GetErrorStatus by specifying the reserved block ID 0 [SWS_NvM_00394]. In addition, an upper-layer callback (NvMMultiBlockCallback) can optionally be notified [SWS_NvM_00260]. If configured via NvMDrvModeSwitch, the job switches the memory devices to slow mode after the abort [SWS_NvM_00681].

Restrictions and Error Handling

Calling NvM_CancelWriteAll is functionally restricted and may only be done by the BSW Mode Manager (BswM) [SWS_NvM_00703]. In addition, the function belongs to API configuration class 2 [SWS_NvM_00561]. The module must have been initialized prior to the call [SWS_NvM_00716]; if development error detection (DET) is activated, calling in an uninitialized state leads to error message NVM_E_UNINIT [SWS_NvM_00637].

This usage note was generated automatically based on the AUTOSAR R20-11 specification.

Implementer's Guide to follow (complexity I1)

function NvM_ValidateAll [SWS_NvM_00855] 📄 PDF

void NvM_ValidateAll (void);

Initiates a multi block validation request.

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

The function NvM_ValidateAll initiates the asynchronous validation of multiple NVRAM blocks ([SWS_NvM_00855]) and belongs to API configuration class 3 ([SWS_NvM_00560]). It is non-reentrant, expects no parameters, and provides no return value ([SWS_NvM_00855]). Prior to the call, the NvM module must be initialized ([SWS_NvM_00859]).

Upon the call, the function signals the request to the module and returns immediately ([SWS_NvM_00858]). The actual execution is delayed, however, until all single-block job queues are completely processed ([SWS_NvM_00858]). For multi-block jobs, only a single slot in total is available in the job queue ([SWS_NvM_00380]). The overall result of the asynchronous job is maintained in a separate state variable ([SWS_NvM_00393]).

Within the scope of job processing, both the multi-block result and the results of the affected single blocks are pre-set to NVM_REQ_PENDING ([SWS_NvM_00861]). The processing considers exclusively blocks for which NvMBlockUseAutoValidation is configured to TRUE ([SWS_NvM_00856], [SWS_NvM_00860]):

  • Permanent RAM blocks are processed or the explicit synchronization via the callback NvM_WriteRamBlockToNvm is executed ([SWS_NvM_00860]).
  • The RAM block status is set to “VALID / CHANGED” ([SWS_NvM_00856]).
  • If CRC calculation in RAM is additionally configured, the job requests recalculation in the background, which is processed via NvM_MainFunction ([SWS_NvM_00857]).
  • After successful validation of the RAM block, the block-specific result changes to NVM_REQ_OK ([SWS_NvM_00862]).

This usage note was generated automatically based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I1)

function NvM_FirstInitAll [SWS_NvM_91001] 📄 PDF

void NvM_FirstInitAll (void);

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.

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

The function NvM_FirstInitAll initiates the asynchronous initial initialization of multiple configured blocks ([SWS_NvM_91001]). The service is non-reentrant, expects no parameters, and provides no return value ([SWS_NvM_91001]). During processing, it is not considered whether a block already exists in non-volatile memory or is valid or corrupted ([SWS_NvM_91001]). The queue length for multi-block jobs (from NvM_FirstInitAll, among others) is one, so that only a single multi-block job can be queued at the same time ([SWS_NvM_00380]).

Processing differs according to the management type of the block:

  • NATIVE: If default data is available, the NV block is written with it ([SWS_NvM_00913]). If the block has permanent RAM or explicit synchronization, the RAM is updated with the default data (ROM or init callback) as in NvM_RestoreBlockDefaults ([SWS_NvM_00915]); without permanent RAM and without explicit synchronization, the internal NvM buffer serves as RAM, leaving the RAM state untouched ([SWS_NvM_00914]). If default data is missing ([SWS_NvM_00919]) or a configured init callback fails with a return value other than E_OK ([SWS_NvM_00921]), the block is invalidated.
  • REDUNDANT: If default data is present, both block instances are written with it ([SWS_NvM_00916]), and if permanent RAM or explicit synchronization is present, the RAM is updated ([SWS_NvM_00918]); otherwise, the internal buffer is used ([SWS_NvM_00917]). If an init callback does not return E_OK, both instances are invalidated ([SWS_NvM_00922]).
  • DATASET: All blocks or NV block instances of this type configured for processing are invalidated without exception ([SWS_NvM_00923], [SWS_NvM_00924]).

If writing a NATIVE block with default data ([SWS_NvM_00925]), invalidating a NATIVE block ([SWS_NvM_00927]), or writing both instances of a REDUNDANT block ([SWS_NvM_00926]) fails, the job sets the overall result to NVM_REQ_NOT_OK.

This text was generated by an AI based on the specification R20-11.

Implementer's Guide to follow (complexity I1)

function NvM_JobEndNotification [SWS_NvM_00462] 📄 PDF

void NvM_JobEndNotification (void);

Function to be used by the underlying memory abstraction to signal end of job without error.

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

use

The synchronous callback function NvM_JobEndNotification is called by the underlying memory abstraction to signal the error-free end of a job to the NVRAM Manager [SWS_NvM_00462]. The function has neither parameters nor a return value and is available via the header file NvM_MemIf.h with service ID 0x11 [SWS_NvM_00462]. A successful notification of the memory abstraction includes error-free completed read, write, or erase operations [SWS_NvM_00111].

Concurrency and Limitations

The interface is specified as non-reentrant [SWS_NvM_00462]. Depending on the calling function within the memory abstraction, this routine can be executed in interrupt context [SWS_NvM_00111]. All modules of the memory abstraction should be configured to consistently use the same mode – callback or polling [SWS_NvM_00111].

Configuration and Interaction

The NvM module provides the callback function NvM_JobEndNotification only if polling mode is disabled via the configuration parameter NvMPollingMode [SWS_NvM_00440]. In addition, the function is influenced by general NvM configuration parameters [SWS_NvM_00440].

This usage note is based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I1)

function NvM_JobErrorNotification [SWS_NvM_00463] 📄 PDF

void NvM_JobErrorNotification (void);

Function to be used by the underlying memory abstraction to signal end of job with error.

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

The callback function NvM_JobErrorNotification ([SWS_NvM_00463]) serves the underlying memory abstraction layer to signal the faulty termination of an asynchronous job to the NVRAM Manager module (NvM). The call is synchronous and is specified as non-reentrant ([SWS_NvM_00463]).

Usage and signature

  • Interface: The function declaration is made available via the header file NvM_MemIf.h ([SWS_NvM_00463]).
  • Signature: According to void NvM_JobErrorNotification(void), the function has neither input, output, nor input/output parameters and returns no return value ([SWS_NvM_00463]).
  • Service ID: The function is identified via the hexadecimal identifier 0x12 ([SWS_NvM_00463]).

Configuration dependency and interaction

The NvM module only provides the callback function NvM_JobErrorNotification if polling mode is disabled via configuration parameter NvMPollingMode ([SWS_NvM_00441]). If polling is used, this notification mechanism is omitted. In addition, the function is influenced by the general configuration parameters according to [SWS_NvM_00028] wording not yet imported ([SWS_NvM_00441]).

Error Handling and Concurrency

The function serves exclusively for error reporting of jobs and defines neither its own error codes nor DET or DEM feedbacks ([SWS_NvM_00463]). Due to the classification as Non Reentrant, it is presumably the responsibility of the caller in the memory abstraction to ensure that no overlapping or interrupting calls occur ([SWS_NvM_00463]). Question Q-5f72d9d605c25922 (open)

This usage note was generated automatically based on the specification AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I1)

function NvM_MainFunction [SWS_NvM_00464] 📄 PDF

void NvM_MainFunction (void);

Service for performing the processing of the Nv M jobs.

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

use

The function NvM_MainFunction has neither passing parameters nor a return value (void NvM_MainFunction(void)) and is declared via SchM_NvM.h ([SWS_NvM_00464]). It serves for processing NVRAM Manager jobs ([SWS_NvM_00464], [SWS_NvM_00256]). After the completion of an asynchronous service, it executes configured callback routines to notify the upper layer ([SWS_NvM_00347]). In addition, it performs CRC recalculations requested in the background for NVRAM blocks ([SWS_NvM_00333]), such as as a result of NvM_SetRamBlockStatus ([SWS_NvM_00121]) or NvM_ValidateAll ([SWS_NvM_00857]).

Flow Control and Prioritization

If configured, the function monitors the immediate priority queue for requests with immediate priority ([SWS_NvM_00259]). If a regular request was destructively aborted by an immediate job, NvM_MainFunction restarts it after its completion ([SWS_NvM_00258]). If polling mode is active, it checks the status of the jobs passed to the lower layer ([SWS_NvM_00346]). During the processing of NvM_WriteAll, it cyclically polls the state of the memory driver abstraction via MemIf_GetStatus for MEMIF_BROADCAST_ID and holds back callbacks to the upper layer as long as MEMIF_BUSY_INTERNAL is reported ([SWS_NvM_00350]).

Error Handling and Retries

If application-specific callbacks fail, NvM_MainFunction controls the retries:

  • If NvMReadRamBlockFromNvCallback returns the value E_NOT_OK, the module repeats the call in the next cycle of NvM_MainFunction ([SWS_NvM_00839]).
  • If NvMWriteRamBlockToNvCallback returns E_NOT_OK, the repetition also takes place in the next call of NvM_MainFunction ([SWS_NvM_00840]).
  • If the explicit synchronization callback returns E_NOT_OK for NvM_SetRamBlockStatus, the module executes the configured retries with one attempt per call of NvM_MainFunction ([SWS_NvM_00908]).

This text was generated by an AI based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I2)

function NvM_SingleBlockCallbackFunction [SWS_NvM_00467] 📄 PDF

Std_ReturnType NvM_SingleBlockCallbackFunction (NvM_BlockRequestType BlockRequest, NvM_RequestResultType JobResult);

Per block callback routine to notify the upper layer that an asynchronous single block request has been finished.

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

use

The callback routine NvM_SingleBlockCallbackFunction synchronously notifies the upper layer of the completion of a previously initiated asynchronous single-block request [SWS_NvM_00467].

The function processes two passing parameters [SWS_NvM_00467]:

  • BlockRequest (type NvM_BlockRequestType): Passes the type of the previously executed block request, such as read or write operations [SWS_NvM_00467].
  • JobResult (type NvM_RequestResultType): Reports the overall result of the processed block job [SWS_NvM_00467].

As a return value, the function provides the type Std_ReturnType [SWS_NvM_00467]. Successful execution of the callback is signaled by returning E_OK; any other return value indicates unsuccessful execution [SWS_NvM_00467].

Error Handling and Concurrency

The interface does not specify any dedicated DET or DEM error messages [SWS_NvM_00467]. The result of the preceding job is transferred via the parameter JobResult, whereas errors within the callback processing itself are reported via the function return value [SWS_NvM_00467].

Regarding concurrency, the routine is declared as non-reentrant (Non Reentrant) [SWS_NvM_00467]. It is provided via the header NvM_Externals.h [SWS_NvM_00467]. The call by the NvM module is likely performed synchronously in the task context of the cyclic NvM job processing (interpretation). Question Q-f50640211851274f (open)

This usage note was generated by an AI based on the AUTOSAR R20-11 specification.

Implementer's Guide to follow (complexity I1)

function NvM_MultiBlockCallbackFunction [SWS_NvM_00468] 📄 PDF

Std_ReturnType NvM_MultiBlockCallbackFunction (NvM_MultiBlockRequestType MultiBlockRequest, NvM_RequestResultType JobResult);

Common callback routine to notify the upper layer that an asynchronous multi block request has been finished. Available v ia Nv M_ Externals.h

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

The callback routine NvM_MultiBlockCallbackFunction notifies the upper layer that a previously initiated asynchronous multi-block job has been completed [SWS_NvM_00468]. The declaration of the function is provided via the header file NvM_Externals.h [SWS_NvM_00468].

Call Context and Parameters

The call by the NVRAM manager is performed synchronously with the execution in the processing flow [SWS_NvM_00468]. Upon the call, two parameters are passed to the routine:

  • MultiBlockRequest (type NvM_MultiBlockRequestType): Identifies the concrete request type of the previously processed multi-block job, such as read or write accesses [SWS_NvM_00468].
  • JobResult (type NvM_RequestResultType): Transfers the final result of the processing of the preceding multi-block job to the upper layer [SWS_NvM_00468].

Return value and error handling

The routine returns a value of type Std_ReturnType to the calling module [SWS_NvM_00468]. The return value E_OK indicates that the callback function could be executed successfully; any other return value, however, signals failed processing [SWS_NvM_00468]. Specific error codes, DET or DEM messages are not defined in the scope of the specification for this function. Interpretation: The concrete consequences of a return value other than E_OK are likely implementation-specific, as the standard does not prescribe downstream error handling. Question Q-462dea7f3074ae9c (open)

Concurrency and Limitations

The function is specified as non-reentrant (Non Reentrant) [SWS_NvM_00468]. Within the calling system, it must therefore be ensured that no concurrent or interrupting multiple calls of this callback interface take place.

This text was generated by an AI based on the specification.

Implementer's Guide to follow (complexity I1)

function NvM_InitBlockCallbackFunction [SWS_NvM_00469] 📄 PDF

Std_ReturnType NvM_InitBlockCallbackFunction (NvM_InitBlockRequestType InitBlockRequest);

Per block callback routine which shall be called by the Nv M module when default data needs to be restored in RAM, and a RO M block is not configured. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_NVRAMManager

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

Usage and Call Context

The user-specific callback routine NvM_InitBlockCallbackFunction is called by the NvM module when default data for an NVRAM block must be restored in RAM and no corresponding ROM block is configured [SWS_NvM_00469]. The call is performed synchronously and the interface is declared via the header NvM_Externals.h [SWS_NvM_00469].

As a passing parameter, the function receives InitBlockRequest of type NvM_InitBlockRequestType [SWS_NvM_00469]. This value informs the routine about the specific request type of the currently processed block, such as reading or restoring data (read, restore) [SWS_NvM_00469].

Return Values and Error Handling

The routine returns a status value of type Std_ReturnType [SWS_NvM_00469]:

  • E_OK: Signals to the NvM module that the callback function has successfully initialized and processed the data in RAM [SWS_NvM_00469].
  • Any other return value: Indicates that the initialization could not be completed successfully [SWS_NvM_00469].

Specific error codes for DET or DEM are not specified for the interface itself [SWS_NvM_00469].

Concurrency and Execution Constraints

The interface is specified as synchronous and non-reentrant (Non Reentrant) [SWS_NvM_00469]. Because the NVRAM Manager waits synchronously for the return of the function, a blocking execution within the routine is likely to halt the further processing of the NvM immediately (interpretation). Question Q-c0e43c9871c4f2d0 (open)

This usage note was generated by an AI based on the AUTOSAR R20-11 specification.

Implementer's Guide to follow (complexity I1)

function NvM_WriteRamBlockToNvm [SWS_NvM_00539] 📄 PDF

Std_ReturnType NvM_WriteRamBlockToNvm (void* NvMBuffer);

Block specific callback routine which shall be called in order to let the application copy data from RAM block to Nv M module's mirror.

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

The block-specific callback function NvM_WriteRamBlockToNvm serves for explicit synchronization to copy application data from the RAM block into the internal RAM mirror of the NvM module [SWS_NvM_00539]. It is declaratively available via NvM_Externals.h and is called synchronously by the NvM [SWS_NvM_00539].

Usage and Parameters

The function passes as an output parameter the pointer NvMBuffer, which represents the destination address of the NvM mirror to which the data must be written [SWS_NvM_00539]. As a return value, the callback routine provides E_OK upon successful processing or any other value in the event of an erroneous course [SWS_NvM_00539].

Concurrency and Limitations

According to the specification, NvM_WriteRamBlockToNvm is designed as non-reentrant (Non Reentrant) [SWS_NvM_00539].

Interplay in the module

  • During shutdown, the job NvM_WriteAll synchronizes permanent RAM blocks or calls the callback routine NvM_WriteRamBlockToNvm for explicit synchronization [SWS_NvM_00018], provided that the parameter NvMSelectBlockForWriteAll is configured to true for the NVRAM block [SWS_NvM_00252].
  • The write jobs NvM_WriteBlock [SWS_NvM_00303] and NvM_WritePRAMBlock [SWS_NvM_00803] automatically validate a still invalid permanent RAM block after the call of NvM_WriteRamBlockToNvm.

This text was generated by an AI based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I1)

function NvM_ReadRamBlockFromNvm [SWS_NvM_00540] 📄 PDF

Std_ReturnType NvM_ReadRamBlockFromNvm (const void* NvMBuffer);

Block specific callback routine which shall be called in order to let the application copy data from Nv M module's mirror to RAM block.

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

The function NvM_ReadRamBlockFromNvm is a block-specific callback routine declared via NvM_Externals.h [SWS_NvM_00540]. Its purpose is to enable the application to copy data from the internal mirror buffer of the NvM module into the associated RAM block in order to perform an explicit synchronization [SWS_NvM_00540], [SWS_NvM_00118].

Usage and Semantics

  • Call context and concurrency: The call is performed synchronously and is specified as non-reentrant (Non Reentrant) [SWS_NvM_00540].
  • Parameters: The pointer NvMBuffer (type const void*) serves as the passing parameter. It passes the buffer address from which the data can be read and copied into the RAM block [SWS_NvM_00540].
  • Return value and error handling: The callback function returns a Std_ReturnType. The return value E_OK signals successful execution; any other return value indicates unsuccessful processing [SWS_NvM_00540].

Interaction

Within the scope of the multi-block service NvM_ReadAll, NvM_ReadRamBlockFromNvm is called for explicit synchronization for those NVRAM blocks that are configured accordingly and for which NvmSelectBlockForReadall == TRUE applies [SWS_NvM_00118], [SWS_NvM_00356]. This represents the alternative to direct copying into permanent RAM blocks, whereas NvM_ReadAll initializes the administrative data of the blocks [SWS_NvM_00356].

This text was generated by an AI system based on the specification requirements.

Implementer's Guide to follow (complexity I1)

type NvM_MultiBlockRequestType [SWS_NvM_91003] 📄 PDF

Identifies the type of request performed on multi block when signaled via the callback function or when reporting to Bsw M

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

The enumeration type NvM_MultiBlockRequestType is provided via the header file NvM.h and serves to uniquely identify an executed multi-block request [SWS_NvM_91003]. The type is used when the result or status of a multi-block operation is signaled via a callback function or reported to the BswM module [SWS_NvM_91003].

Value Range and Semantics

The enumeration defines the following values for differentiating multi-block jobs [SWS_NvM_91003]:

  • NVM_READ_ALL (0x00): Indicates that NvM_ReadAll was executed.
  • NVM_WRITE_ALL (0x01): Indicates that NvM_WriteAll was executed.
  • NVM_VALIDATE_ALL (0x02): Indicates that NvM_ValidateAll was executed.
  • NVM_FIRST_INIT_ALL (0x03): Indicates that NvM_FirstInitAll was executed.
  • NVM_CANCEL_WRITE_ALL (0x04): Indicates that NvM_CancelWriteAll was executed.

Interaction

By passing this type, invoked callbacks as well as the BswM can determine which concrete multi-block service triggered the notification. Interpretation: The feedback to the BswM presumably serves to couple follow-up actions or state transitions in the overall system to the completion of specific multi-block services. Question Q-69b4d985301acfeb (open)

This text was generated by an AI and serves as guidance. The referenced specifications are authoritative.

Implementer's Guide to follow (complexity I1)

type NvM_RequestResultType [SWS_NvM_00470] 📄 PDF

Type NvM_RequestResultType.

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

The type NvM_RequestResultType is based on uint8, is available via Rte_NvM_Type.h, and represents the asynchronous request result of read, write, and control jobs of the NVRAM Manager [SWS_NvM_00470]. The result is queried primarily via the API service NvM_GetErrorStatus and can additionally be signaled via a configured callback function [SWS_NvM_00470].

The value range represents various execution states and error cases [SWS_NvM_00470]:

  • NVM_REQ_OK (0x00): The last asynchronous job was completed successfully; this is also the default value after a reset.
  • NVM_REQ_NOT_OK (0x01): The asynchronous read, write, or control request was not completed successfully.
  • NVM_REQ_PENDING (0x02): An asynchronous request is currently still being processed.
  • NVM_REQ_INTEGRITY_FAILED (0x03): Data integrity error in NvM_ReadBlock or NvM_ReadAll. In the case of NvM_ReadBlock, the content of the RAM block has been modified, but has become invalid; the application is responsible for renewing and validating the content.
  • NVM_REQ_BLOCK_SKIPPED (0x04): The referenced block was skipped during NvM_ReadAll or NvM_WriteAll (e.g. dataset NVRAM blocks in NvM_ReadAll or blocks without a permanently configured RAM block).
  • NVM_REQ_NV_INVALIDATED (0x05): The referenced NV block is invalidated.
  • NVM_REQ_CANCELED (0x06): Cancellation of NvM_WriteAll by NvM_CancelWriteAll or cancellation of a single-block job (NvM_ReadBlock, NvM_WriteBlock, NvM_EraseNvBlock, NvM_InvalidateNvBlock, NvM_RestoreBlockDefaults) by NvM_CancelJobs.
  • NVM_REQ_RESTORED_DEFAULTS (0x08): The default values were successfully copied to the RAM image.

In interaction with redundant blocks (NVM_BLOCK_REDUNDANT), the function NvM_InvalidateNvBlock sets the request result NvM_RequestResultType to NVM_REQ_OK only when both NV blocks have been invalidated [SWS_NvM_00274].

This text was generated automatically. All information is based exclusively on the specification requirements of AUTOSAR version R20-11.

Implementer's Guide to follow (complexity I1)

type NvM_BlockIdType [SWS_NvM_00471] 📄 PDF

Identification of a NVRAM block via a unique block identifier. Reserved NVRAM block IDs: 0 - > to derive multi block request results via Nv M_ Get Error Status 1 - > redundant NVRAM block which holds the configuration ID

type NvM_InitBlockRequestType [SWS_NvM_91123] 📄 PDF

Identifies the type of request performed on a block when signaled via the callback function

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

The data type NvM_InitBlockRequestType is based on uint8 and is provided via the header file Rte_NvM_Type.h [SWS_NvM_91123]. It serves to identify the type of request performed on an NVRAM block when this is signaled via a corresponding callback function [SWS_NvM_91123].

The permissible value range comprises four request types [SWS_NvM_91123]:

  • NVM_INIT_READ_BLOCK (0x00): Indicates that NvM_ReadBlock or NvM_ReadPRAMBlock was requested for the block [SWS_NvM_91123].
  • NVM_INIT_RESTORE_BLOCK_DEFAULTS (0x01): Signals that NvM_RestoreBlockDefaults or NvM_RestorePRAMBlockDefaults was requested for the block [SWS_NvM_91123].
  • NVM_INIT_READ_ALL_BLOCK (0x02): Points out that the block is processed within the scope of NvM_ReadAll [SWS_NvM_91123].
  • NVM_INIT_FIRST_INIT_ALL (0x03): Identifies block processing during the execution of NvM_FirstInitAll [SWS_NvM_91123].

Using this enumeration value, the invoked application logic can distinguish whether it is an explicit single-block request (reading or restoring default values) or a global collective operation during system startup [SWS_NvM_91123]. Interpretation: The type is likely passed as a parameter to block-related initialization callbacks so that the application can provide default data according to the situation or make specific preparations. Question Q-42d0d469e305728e (open)

This usage note is based on the specification AUTOSAR Classic Release R20-11.

Implementer's Guide to follow (complexity I1)

type NvM_BlockRequestType [SWS_NvM_91002] 📄 PDF

Identifies the type of reques t performed on a block when signaled via the callback function

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

The enumeration type NvM_BlockRequestType is based on uint8 and is provided via the header Rte_NvM_Type.h [SWS_NvM_91002]. When notification is provided via a callback function, it serves to convey the type of request that was previously executed on an NVRAM block [SWS_NvM_91002].

The value range comprises six specific block requests [SWS_NvM_91002]:

  • NVM_READ_BLOCK (0x00): Signals that NvM_ReadBlock or NvM_ReadPRAMBlock was executed for the block [SWS_NvM_91002].
  • NVM_WRITE_BLOCK (0x01): Signals that NvM_WriteBlock or NvM_WritePRAMBlock was executed for the block [SWS_NvM_91002].
  • NVM_RESTORE_BLOCK_DEFAULTS (0x02): Signals that NvM_RestoreBlockDefaults or NvM_RestorePRAMBlockDefaults was executed [SWS_NvM_91002].
  • NVM_ERASE_NV_BLOCK (0x03): Signals that NvM_EraseNvBlock was executed on the block [SWS_NvM_91002].
  • NVM_INVALIDATE_NV_BLOCK (0x04): Signals that NvM_InvalidateNvBlock was executed on the block [SWS_NvM_91002].
  • NVM_READ_ALL_BLOCK (0x05): Signals that NvM_ReadAll has finished processing this block [SWS_NvM_91002].

In the application architecture, the value is likely evaluated as a parameter in callback routines to inform higher-level software components differentially about the completion of specific block operations [SWS_NvM_91002]. Question Q-467801b6b5e898a2 (open) In the absence of further specifications in the payload regarding error codes or concurrency, the specification details are limited to the type definition and the value range [SWS_NvM_91002].

This text was created by an AI; accuracy cannot be guaranteed.

Implementer's Guide to follow (complexity I1)

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

Record
AUTOSAR/AP/record/CP_MOD_NvM
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_NvM@rel:R20-11#42ca1621
Content hash
42ca1621
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_NVRAMManager.pdf#nameddest=SWS_NvM_00447

Initialization and status

Service to get the version information of the Nv M module.

void NvM_GetVersionInfo (Std_VersionInfoType* versioninfo);
NvM_Init function

Service for resetting all internal variables.

void NvM_Init (const NvM_ConfigType* ConfigPtr);

Services · Read…

NvM_ReadAll function

Initiates a multi block read request.

void NvM_ReadAll (void);
NvM_ReadBlock function

Service to copy the data of the NV block to its corresponding RAM block.

Std_ReturnType NvM_ReadBlock (NvM_BlockIdType BlockId, void* NvM_DstPtr);

Service to copy the data of the NV block to its corresponding permanent RAM block.

Std_ReturnType NvM_ReadPRAMBlock (NvM_BlockIdType BlockId);

Block specific callback routine which shall be called in order to let the application copy data from Nv M module's mirror to RAM block.

Std_ReturnType NvM_ReadRamBlockFromNvm (const void* NvMBuffer);

Services · Set…

Service for setting the lock status of a permanent RAM block or of the explicit synchronization of a NVRAM block.

void NvM_SetBlockLockStatus (NvM_BlockIdType BlockId, boolean BlockLocked);

Service for setting/ resetting the write protection for a NV block. Availabl e via Nv M.h

Std_ReturnType NvM_SetBlockProtection (NvM_BlockIdType BlockId, boolean ProtectionEnabled);

Service for setting the Data Inde x of a dataset NVRAM block.

Std_ReturnType NvM_SetDataIndex (NvM_BlockIdType BlockId, uint8 DataIndex);

Service for setting the RAM block status of a permanent RAM block or the status of the explicit synchronization of a NVRAM block.

Std_ReturnType NvM_SetRamBlockStatus (NvM_BlockIdType BlockId, boolean BlockChanged);

Services · Write…

NvM_WriteAll function

Initiates a multi block write request.

void NvM_WriteAll (void);

Service to copy the data of the RAM block to its corresponding NV block. Available vi a Nv M.h

Std_ReturnType NvM_WriteBlock (NvM_BlockIdType BlockId, const void* NvM_SrcPtr);

Service to copy the data of the permanent RAM block to its corresponding NV block.

Std_ReturnType NvM_WritePRAMBlock (NvM_BlockIdType BlockId);

Block specific callback routine which shall be called in order to let the application copy data from RAM block to Nv M module's mirror.

Std_ReturnType NvM_WriteRamBlockToNvm (void* NvMBuffer);

Services · Cancel…

Service to cancel all jobs pending for a NV block.

Std_ReturnType NvM_CancelJobs (NvM_BlockIdType BlockId);

Service to cancel a running Nv M_ Write All request.

void NvM_CancelWriteAll (void);

Services · Get…

Service for getting the currently set Data Index of a datase t NVRAM block

Std_ReturnType NvM_GetDataIndex (NvM_BlockIdType BlockId, uint8* DataIndexPtr);

Service to read the block dependent error/ status information.

Std_ReturnType NvM_GetErrorStatus (NvM_BlockIdType BlockId, NvM_RequestResultType* RequestResultPtr);

Services · Job…

Function to be used by the underlying memory abstraction to signal end of job without error.

void NvM_JobEndNotification (void);

Function to be used by the underlying memory abstraction to signal end of job with error.

void NvM_JobErrorNotification (void);

Services · Restore…

Service to restore the default data to its corr esponding RAM block.

Std_ReturnType NvM_RestoreBlockDefaults (NvM_BlockIdType BlockId, void* NvM_DestPtr);

Service to restore the default data to its corresponding permanent RAM block.

Std_ReturnType NvM_RestorePRAMBlockDefaults (NvM_BlockIdType BlockId);

Services · More

Service to erase a NV block.

Std_ReturnType NvM_EraseNvBlock (NvM_BlockIdType BlockId);

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.

void NvM_FirstInitAll (void);

Per block callback routine which shall be called by the Nv M module when default data needs to be restored in RAM, and a RO M block is not configured. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_NVRAMManager

Std_ReturnType NvM_InitBlockCallbackFunction (NvM_InitBlockRequestType InitBlockRequest);

Service to invalidate a NV block.

Std_ReturnType NvM_InvalidateNvBlock (NvM_BlockIdType BlockId);

Common callback routine to notify the upper layer that an asynchronous multi block request has been finished. Available v ia Nv M_ Externals.h

Std_ReturnType NvM_MultiBlockCallbackFunction (NvM_MultiBlockRequestType MultiBlockRequest, NvM_RequestResultType JobResult);

Per block callback routine to notify the upper layer that an asynchronous single block request has been finished.

Std_ReturnType NvM_SingleBlockCallbackFunction (NvM_BlockRequestType BlockRequest, NvM_RequestResultType JobResult);

Initiates a multi block validation request.

void NvM_ValidateAll (void);

Cyclic

Service for performing the processing of the Nv M jobs.

void NvM_MainFunction (void);

Types

Identification of a NVRAM block via a unique block identifier. Reserved NVRAM block IDs: 0 - > to derive multi block request results via Nv M_ Get Error Status 1 - > redundant NVRAM block which holds the configuration ID

Identifies the type of reques t performed on a block when signaled via the callback function

Configuration data structure of the Nv M module.

Identifies the type of request performed on a block when signaled via the callback function

Identifies the type of request performed on multi block when signaled via the callback function or when reporting to Bsw M

Type NvM_RequestResultType.