DEENESPTFRRUARHIKOZHNL

Flash EEPROM Emulation (Fee)

ModulFee (Flash EEPROM Emulation)
BSW-Modul-ID21
Standard-Header#include "Fee.h"
SWS-SpezifikationAUTOSAR_SWS_FlashEEPROMEmulation.pdf
ClusterMemory Services

Module guideAI-GENERATED

Emulates an EEPROM with logical blocks on flash memory and serves asynchronous read and write jobs.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: 82b558e5a038 Provenance Open questions (6)
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

Emulates an EEPROM with logical blocks on flash memory and serves asynchronous read and write jobs.

Fee maps the logical blocks of an emulated EEPROM onto flash memory and serves the jobs issued by the NVRAM Manager via MemIf. Read, write, and erase jobs are merely accepted and then processed asynchronously in Fee_MainFunction [SWS_Fee_00097]. Progress and result are indicated by Fee_GetStatus and Fee_GetJobResult. After Fee_Init, the module may initially be busy with internal management (MEMIF_BUSY_INTERNAL), but already accepts jobs SWS Fee p. 42. Write jobs always affect the entire block.

Fee maps the logical blocks of an emulated EEPROM onto flash memory. The BlockNumber simultaneously designates the start address of the block [SWS_Fee_00087]. Calls originate from the NVRAM Manager via the Memory Abstraction Interface, which selects the appropriate service via DeviceIndex SWS MemIf p. 18. Underneath operates the flash driver Fls. Fee provides feedback directly to the NVRAM Manager via NvM_JobEndNotification and NvM_JobErrorNotification [SWS_Fee_00098], [SWS_Fee_00099].

fee_kontext NvM NvM (NVRAM Manager) MemIf MemIf (Memory Abstraction Interface) NvM->MemIf MemIf_Read / MemIf_Write / MemIf_Cancel / MemIf_SetMode Fee Fee (Flash EEPROM Emulation) MemIf->Fee Fee_Read / Fee_Write / Fee_Cancel / Fee_GetStatus / Fee_GetJobResult Fee->NvM NvM_JobEndNotification / NvM_JobErrorNotification Fls Fls (Flash-Treiber) Fee->Fls Fls_Read / Fls_Write / Fls_Erase / Fls_Cancel / Fls_SetMode / Fls_BlankCheck Det DET Fee->Det Det_ReportError (optional) Fls->Fee Fee_JobEndNotification / Fee_JobErrorNotification EcuM EcuM EcuM->Fee Fee_Init SchM SchM (BSW Scheduler) SchM->Fee Fee_MainFunction (zyklisch)

Context diagram: Fee between MemIf and Fls, initialized by EcuM, cyclically triggered by SchM, with feedback directly to NvM. Sources: [SWS_Fee_00085], [SWS_Fee_00097], [SWS_Fee_00105].

EcuM calls Fee_Init with the selected configuration set; R20-11 lists this service as asynchronous [SWS_Fee_00085]. Thereafter, the status is set to MEMIF_BUSY_INTERNAL, but jobs are already accepted. Only repeated calls to Fee_MainFunction conclude internal management and lead to MEMIF_IDLE SWS Fee p. 42. Fee_GetStatus indicates the module state, Fee_GetJobResult the result of the last accepted job [SWS_Fee_00090], [SWS_Fee_00091].

fee_modulstatus start UNINIT MEMIF_UNINIT start->UNINIT BUSY_INTERNAL MEMIF_BUSY_INTERNAL UNINIT->BUSY_INTERNAL Fee_Init BUSY_INTERNAL->BUSY_INTERNAL Fee_MainFunction (administration running) IDLE MEMIF_IDLE BUSY_INTERNAL->IDLE Fee_MainFunction (Verwaltung beendet) BUSY MEMIF_BUSY BUSY_INTERNAL->BUSY Fee_Read / Fee_Write angenommen IDLE->BUSY Fee_Read / Fee_Write angenommen BUSY->IDLE Fee_Cancel BUSY->IDLE Auftrag beendet (Annahme)

State diagram: Module status from MEMIF_UNINIT via MEMIF_BUSY_INTERNAL to MEMIF_IDLE and MEMIF_BUSY; the return after regular job completion is an assumption. Sources: [SWS_Fee_00090], SWS Fee p. 28.

Read, write, invalidation, and erase jobs only report their acceptance with E_OK; they are processed asynchronously in Fee_MainFunction [SWS_Fee_00097]. Fee_Read reads arbitrary sections of a block, Fee_Write always the entire block with offset zero SWS Fee p. 28. During writing, the block is internally considered "corrupted". This marking is to be distinguished from invalidation by Fee_InvalidateBlock SWS Fee p. 21.

Fee_Cancel is synchronous in R20-11 and cancels a pending job via the flash driver [SWS_Fee_00089]. Without a pending job, it reports FEE_E_INVALID_CANCEL [SWS_Fee_91002]. Flash errors are detected by the driver. Fee reports them in two ways depending on the configuration: as MEMIF_JOB_FAILED for querying or via NvM_JobErrorNotification. Recovery is handled by the NVRAM Manager ErrorDescription p. 40. Fee reports incorrect operations such as missing initialization or invalid block numbers as development errors [SWS_Fee_00010].

Role in the NV memory stack: Flash memory as emulated EEPROM

Flash EEPROM Emulation (Fee) provides logical blocks to the upper layer and maps them onto flash memory. The BlockNumber simultaneously designates the start address of the block in memory [SWS_Fee_00087], [SWS_Fee_00088]. The NVRAM Manager does not call Fee directly, but via the Memory Abstraction Interface. MemIf_Read and MemIf_Write call the function of the abstraction module selected via DeviceIndex and forward its return value SWS MemIf p. 18, SWS MemIf p. 19. Downwards, Fee relies on the flash driver Fls. From there, it imports Fls_AddressType and Fls_LengthType, and from MemIf the status, result, and mode types [SWS_Fee_00084].

Feedback bypasses MemIf. MemIf itself provides no callbacks; the callback routines for the underlying abstraction modules are provided by the NVRAM Manager SWS MemIf p. 24. For this purpose, Fee calls NvM_JobEndNotification and NvM_JobErrorNotification [SWS_Fee_00098], [SWS_Fee_00099]. Conversely, the driver reports the end of its jobs to Fee via Fee_JobEndNotification and Fee_JobErrorNotification [SWS_Fee_00095], [SWS_Fee_00096]. Fee is initialized by EcuM and cyclically triggered by the Basic Software Scheduler SWS Fee p. 42.

fee_kontext NvM NvM (NVRAM Manager) MemIf MemIf (Memory Abstraction Interface) NvM->MemIf MemIf_Read / MemIf_Write / MemIf_Cancel / MemIf_SetMode Fee Fee (Flash EEPROM Emulation) MemIf->Fee Fee_Read / Fee_Write / Fee_Cancel / Fee_GetStatus / Fee_GetJobResult Fee->NvM NvM_JobEndNotification / NvM_JobErrorNotification Fls Fls (Flash-Treiber) Fee->Fls Fls_Read / Fls_Write / Fls_Erase / Fls_Cancel / Fls_SetMode / Fls_BlankCheck Det DET Fee->Det Det_ReportError (optional) Fls->Fee Fee_JobEndNotification / Fee_JobErrorNotification EcuM EcuM EcuM->Fee Fee_Init SchM SchM (BSW Scheduler) SchM->Fee Fee_MainFunction (zyklisch)

Context diagram: Fee is situated between MemIf and Fls. It is initialized by EcuM, cyclically triggered by SchM, and reports job completions directly to NvM. Sources: [SWS_Fee_00085], [SWS_Fee_00097], [SWS_Fee_00098], [SWS_Fee_00104], [SWS_Fee_00105], SWS MemIf p. 18.

As required driver services, R20-11 lists, among others, the following functions [SWS_Fee_00105]:

  • Fls_Read, Fls_Write, Fls_Erase, and Fls_Compare,
  • Fls_Cancel, Fls_GetStatus, Fls_GetJobResult, and Fls_SetMode,
  • Det_ReportRuntimeError.

Optionally, Det_ReportError and Fls_BlankCheck are added [SWS_Fee_00104]. A later version of the same requirement lists MemAcc_BlankCheck instead SWS Fee p. 40. For R20-11, the Fls variant remains normative.

Startup: From Fee_Init to readiness for acceptance

EcuM calls Fee_Init with a pointer to the selected configuration set [SWS_Fee_00085]. The type Fee_ConfigType is a structure with implementation-specific elements [SWS_Fee_00188]. Remarkably, R20-11 lists Fee_Init as asynchronous [SWS_Fee_00085]. According to the change history, the initialization does not have to be completed within Fee_Init, and the state machine was adapted accordingly SWS Fee p. 4.

The sequence diagram of the specification shows the sequence SWS Fee p. 42:

  1. After Fee_Init, the module status is set to MEMIF_BUSY_INTERNAL.
  2. Jobs can already be accepted in this state.
  3. The scheduler calls Fee_MainFunction until the internal management is completed.

A later version specifies that Fee_MainFunction then sets the status from MEMIF_BUSY_INTERNAL to MEMIF_IDLE. Management can take more than one call in this process SWS Fee p. 38. The older version of the diagram only shows the synchronous call by EcuM SWS Fee p. 38.

Hochlauf von FeeEcuMFeeSchMFee_Init(ConfigPtr)Modulstatus := MEMIF_BUSY_INTERNALFee_Init()jobs are already accepted from here onloopinternal administration still requiredFee_MainFunction()interne VerwaltungsoperationStatus bleibt MEMIF_BUSY_INTERNALFee_MainFunction()Fee_MainFunction()Verwaltung beendetModulstatus := MEMIF_IDLEFee_MainFunction()

Sequence diagram: Fee_Init transitions the module into MEMIF_BUSY_INTERNAL. Only repeated calls to Fee_MainFunction conclude internal management and lead to MEMIF_IDLE. Sources: [SWS_Fee_00085], [SWS_Fee_00097], SWS Fee p. 42.

Fee_MainFunction processes the requested read, write, and erase jobs as well as the internal management operations [SWS_Fee_00097]. As a scheduled function, it is called directly by the Basic Software Scheduler. It has neither parameters nor a return value and is non-reentrant SWS Fee p. 40.

Module status and job result as control variables

The upper layer controls its calls via two synchronous queries. Fee_GetStatus returns one of four values [SWS_Fee_00090]:

  • MEMIF_UNINIT: The module is not initialized.
  • MEMIF_IDLE: The module is idle.
  • MEMIF_BUSY: A job of the upper layer is in progress.
  • MEMIF_BUSY_INTERNAL: An internal management operation is running.

As an example of an internal management operation, the specification mentions the reorganization of the used flash memory (garbage collection) SWS Fee p. 30. New jobs are accepted in both MEMIF_IDLE and MEMIF_BUSY_INTERNAL and lead to MEMIF_BUSY SWS Fee p. 28. After regular job completion, the status is likely to fall back to MEMIF_IDLE. Question Q-beae785a1ba1cbec (open) The return to MEMIF_IDLE is explicitly documented here only for cancellation SWS Fee p. 29.

fee_modulstatus start UNINIT MEMIF_UNINIT start->UNINIT BUSY_INTERNAL MEMIF_BUSY_INTERNAL UNINIT->BUSY_INTERNAL Fee_Init BUSY_INTERNAL->BUSY_INTERNAL Fee_MainFunction (administration running) IDLE MEMIF_IDLE BUSY_INTERNAL->IDLE Fee_MainFunction (Verwaltung beendet) BUSY MEMIF_BUSY BUSY_INTERNAL->BUSY Fee_Read / Fee_Write angenommen IDLE->BUSY Fee_Read / Fee_Write angenommen BUSY->IDLE Fee_Cancel BUSY->IDLE Auftrag beendet (Annahme)

State diagram: Life cycle of the module status from MEMIF_UNINIT via MEMIF_BUSY_INTERNAL to MEMIF_IDLE and MEMIF_BUSY. The transition upon regular job completion is marked as an assumption. Sources: [SWS_Fee_00090], SWS Fee p. 42, SWS Fee p. 28, SWS Fee p. 29.

Fee_GetJobResult refers to the most recently accepted job [SWS_Fee_00091], SWS Fee p. 31. It distinguishes six results:

  • MEMIF_JOB_OK: The job finished successfully.
  • MEMIF_JOB_PENDING: The job is still pending or running.
  • MEMIF_JOB_CANCELED: The job was canceled.
  • MEMIF_JOB_FAILED: The job has failed.
  • MEMIF_BLOCK_INCONSISTENT: The block potentially contains corrupted data.
  • MEMIF_BLOCK_INVALID: The block has been invalidated; reading is not possible.

The status therefore describes the module, whereas the result describes the individual job; both are to be queried separately [SWS_Fee_00090].

Read, Write, and Block Management Jobs

The job services operate asynchronously: E_OK only indicates that the job was accepted [SWS_Fee_00087], [SWS_Fee_00088]. Fee_Read calculates the read address from the block start address and BlockOffset. Offset and length may take any value within their type range. This allows reading any number of bytes starting from any location within a block SWS Fee p. 26. If Fls_BlankCheck is configured in the flash driver, Fee_Read uses it to check in advance whether the area is readable. This avoids, for instance, erased but unprogrammed cells triggering ECC errors [SWS_Fee_00187].

In contrast, Fee_Write always writes the entire block; the offset is fixed to zero SWS Fee p. 28. This follows from the higher-level requirement that erase and write jobs always start at the virtual 64K boundary: A block is written completely or not at all RS MemHwAb p. 24. Upon acceptance, Fee sets the status to MEMIF_BUSY and the result to MEMIF_JOB_PENDING and returns E_OK. The same acceptance condition applies to Fee_Read SWS Fee p. 26.

To keep interrupted write operations detectable, Fee maintains internal correctness information for each block SWS Fee p. 21. At the start of a write operation, the block is marked as \"corrupted\", and after successful completion it is marked as \"not corrupted\" again. This information must be strictly separated from the validity that the upper layer sets with Fee_InvalidateBlock.

write job via NV memory stackNvMMemIfFeeSchMFlsUse Case: Annahme (synchron)MemIf_Write(DeviceIndex, BlockNumber, DataBufferPtr)Fee_Write(BlockNumber, DataBufferPtr)Offset fest 0 (ganzer Block)Status := MEMIF_BUSYErgebnis := MEMIF_JOB_PENDINGE_OKE_OKUse Case: Abarbeitung (asynchron)Fee_MainFunction()Block als „corrupted“ markierenFls_Write(…) (Annahme)Fee_JobEndNotification()Block als „not corrupted“ markierenErgebnis := MEMIF_JOB_OKoptBenachrichtigung konfiguriertNvM_JobEndNotification()

Sequence diagram: A write job is accepted synchronously, but completed asynchronously via Fee_MainFunction and the driver feedback. In the process, the block is first marked as \"corrupted\" and finally as \"not corrupted\" again. Sources: [SWS_Fee_00088], [SWS_Fee_00095], [SWS_Fee_00098], SWS Fee p. 28, SWS Fee p. 21, SWS Fee p. 37.

Fee_InvalidateBlock declares a logical block invalid [SWS_Fee_00092]. To do so, it calls the erase function of the driver and/or modifies internal management information, which itself must be stored non-volatilely SWS Fee p. 32. If the upper layer reads such a block later, Fee_MainFunction sets the result to MEMIF_BLOCK_INVALID. If configured, it also calls the error notification of the upper layer SWS Fee p. 38.

Fee_EraseImmediateBlock [SWS_Fee_00094] is intended for diagnostic or similar system services. They use it to erase the area for immediate data in advance if needed. Whether a physical erase is performed is determined by the implementation SWS Fee p. 35. For Fee_InvalidateBlock and Fee_EraseImmediateBlock, R20-11 explicitly specifies the return value E_NOT_OK only when DET is enabled [SWS_Fee_00092], [SWS_Fee_00094].

Notifications, Cancellation, and Mode Switch

The flash driver reports the successful completion of a driver job via Fee_JobEndNotification [SWS_Fee_00095]. Fee then performs the necessary block management and, if configured, calls the job end notification of the upper layer. A result still set to MEMIF_JOB_PENDING is set to MEMIF_JOB_OK SWS Fee p. 37. Depending on the architecture of the memory stack, callbacks can execute at interrupt level and propagate upward across multiple layers. Their execution time must therefore remain short; whether calls at interrupt level are permissible is determined by the system design SWS Fee p. 36.

Fee_Cancel calls the cancel function of the flash driver [SWS_Fee_00089]. The upper layer reaches the service via MemIf_Cancel SWS MemIf p. 20. Cancellation takes effect only in the MEMIF_BUSY status: Fee calls the driver cancellation, resets its internal variables, and returns to MEMIF_IDLE. If DET is enabled, Fee checks beforehand whether the module is initialized SWS Fee p. 29.

Releases diverge regarding Fee_Cancel. The cited later version classifies the service as asynchronous, whereas R20-11 classifies it as synchronous [SWS_Fee_00089]. For R20-11, the synchronous classification is authoritative.

fee_cancel start aufruf Fee_Cancel() aufgerufen start->aufruf d_det DET active and status MEMIF_UNINIT? aufruf->d_det e_uninit FEE_E_UNINIT melden d_det->e_uninit yes d_busy job pending (status MEMIF_BUSY)? d_det->d_busy no ende e_uninit->ende Abbruch (Annahme) fls call cancellation function of the flash driver d_busy->fls yes e_cancel FEE_E_INVALID_CANCEL melden d_busy->e_cancel no reset reset internal variables, status := MEMIF_IDLE fls->reset reset->ende e_cancel->ende

Activity diagram: Fee_Cancel branches according to DET check and module status. Only a pending job is cancelled; otherwise FEE_E_INVALID_CANCEL is reported. Sources: [SWS_Fee_00089], [SWS_Fee_91002], [SWS_Fee_00010], SWS Fee p. 29.

Fee_SetMode switches the operating mode of the underlying flash driver [SWS_Fee_00086]. The corresponding diagram shows the call chain NvM → MemIf_SetMode → Fee_SetMode → Fls_SetMode SWS Fee p. 39. Fee_GetVersionInfo is the only reentrant Fee service [SWS_Fee_00093]. If DET is enabled, it checks the passed pointer for NULL SWS Fee p. 34.

Configuration and Integration

Fee receives the configuration via the Fee_ConfigType passed to Fee_Init [SWS_Fee_00085], [SWS_Fee_00188]. The include structure of an earlier specification version shows the following partitioning SWS Fee p. 11:

  • Fee_Cfg.h includes MemIf_Types.h and Fls.h, optionally also NvM_Cbk.h.
  • Fee_Lcfg.c and Fee_PBcfg.c contain the configuration data.
  • The scheduler is connected via SchM_Fee.h, DET optionally via Det.h.

For R20-11, this diagram serves for orientation only. If Fee is implemented as a vendor-specific library, the sequence diagrams are binding only for the relationships to EcuM and MemIf, not for the calls to the driver SWS Fee p. 42.

Behavior in the event of an error

Fee defines five codes as development errors [SWS_Fee_00010]:

  • FEE_E_UNINIT (0x01): Service called prior to initialization.
  • FEE_E_INVALID_BLOCK_NO (0x02): Invalid block number.
  • FEE_E_INVALID_BLOCK_OFS (0x03): Invalid block offset.
  • FEE_E_PARAM_POINTER (0x04): Invalid data pointer.
  • FEE_E_INVALID_BLOCK_LEN (0x05): Invalid length specification.

R20-11 adds two further codes [SWS_Fee_91002]. FEE_E_BUSY (0x06) applies to calls while a user job is being processed. FEE_E_INVALID_CANCEL (0x08) applies to Fee_Cancel without a pending job. Accordingly, a new job issued in the MEMIF_BUSY status is likely to be rejected and answered with E_NOT_OK. Question Q-92062834653929da (open) The associated rule is only incompletely available here SWS Fee p. 28.

Errors of the flash memory are detected by the flash driver; how Fee reacts to them is implementation-specific ErrorDescription p. 40. Depending on the configuration, reporting occurs via one of two paths. Either MemIf queries Fee_GetJobResult and receives MEMIF_JOB_FAILED, or Fee actively calls NvM_JobErrorNotification. Recovery is handled by the NVRAM Manager. The upper layer detects an uninitialized module by MEMIF_UNINIT in Fee_GetStatus ErrorDescription p. 53, [SWS_Fee_00090].

notification of a flash errorFlsFeeMemIfNvMFee_JobErrorNotification() (Annahme)implementierungsspezifische FehlerbehandlungErgebnis := MEMIF_JOB_FAILEDaltCallback konfiguriertNvM_JobErrorNotification()Abfrage per PollingFee_GetJobResult()MEMIF_JOB_FAILEDrecovery by the NVRAM Manager

Sequence diagram: A driver error reaches the upper layer either via callback to NvM or via polling of Fee_GetJobResult. Sources: [SWS_Fee_00096], [SWS_Fee_00099], [SWS_Fee_00091], ErrorDescription p. 40.

Regarding data consistency, a diagram from R22-11 describes the information chain ErrorDescription p. 64:

  1. Fee checks the consistency of the read data and forwards an error to the NVRAM Manager.
  2. The NVRAM Manager reports NVM_E_INTEGRITY_FAILED to DEM.
  3. It initiates the configured recoveries: read retry, redundant block, or ROM block.
  4. If these fail, it sets the result NVM_REQ_INTEGRITY_FAILED.

On the Fee side, this presumably corresponds to the result MEMIF_BLOCK_INCONSISTENT [SWS_Fee_00091]. Question Q-a1846c349d831e17 (open)

fee_konsistenz Fee Fee Fee->Fee (1) check consistency of the read data NvM NvM (NVRAM Manager) Fee->NvM (2) Fehlerstatus weiterleiten NvM->NvM (4) Wiederherstellung: read retry, redundanter Block, ROM-Block Dem DEM NvM->Dem (3) NVM_E_INTEGRITY_FAILED Ergebnis job result of NvM NvM->Ergebnis (5)/(6) Wiederherstellung gescheitert: NVM_REQ_INTEGRITY_FAILED

Collaboration diagram: A consistency error is forwarded from Fee to NvM. NvM reports it to DEM, attempts recovery, and sets the NvM result if it fails (as of R22-11). Sources: ErrorDescription p. 64.

Further detailed evidence

Detailed rules covering acceptance conditions, callback behavior, and the main function originate partly from later versions of the specification, e.g., SWS Fee p. 38. Where they differ from R20-11, this is noted above. The key references:

AI-generated guide based on specification excerpts for Fee (classic, R20-11). The linked requirements are authoritative. Citations from other releases are marked as such; assumptions are marked as interpretation.

Flash EEPROM Emulation (Fee)

Provides emulation of EEPROM-like data blocks on Flash memory devices.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

function Fee_Init [SWS_Fee_00085] 📄 PDF

void Fee_Init (const Fee_ConfigType* ConfigPtr);

Service to initialize the FEE module.

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

The function Fee_Init serves as the central service for initializing the flash EEPROM emulation module (FEE) [SWS_Fee_00085]. The call is made via the interface declared in Fee.h with the service ID 0x00 [SWS_Fee_00085]. As the only input parameter, ConfigPtr is passed, which serves as a pointer to the selected configuration data set of type const Fee_ConfigType* [SWS_Fee_00085]. Additional input/output parameters or pure output parameters are not defined, and the function provides no return value (void) [SWS_Fee_00085].

Although it is a fundamental initialization function, the execution semantics is explicitly classified in the specification as asynchronous (Asynchronous) [SWS_Fee_00085]. Interpretation: Since the function acts asynchronously, calling Fee_Init presumably only initiates the module initialization, while time-consuming initialization steps are completed non-blockingly in the background [SWS_Fee_00085]. Question Q-7d91ac2e51869606 (open)

For concurrency and call context, the specification specifies that Fee_Init is non-reentrant (Non Reentrant) [SWS_Fee_00085]. Consequently, the function must not be called concurrently or nested from different contexts at any time [SWS_Fee_00085].

This usage note was created by an AI and is based exclusively on the specification AUTOSAR Classic Release R20-11.

Implementer's Guide to follow (complexity I1)

function Fee_SetMode [SWS_Fee_00086] 📄 PDF

void Fee_SetMode (MemIf_ModeType Mode);

Function to switch the mode of the underlying Flash Driver

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

Usage and Call Context

The function Fee_SetMode serves to switch the operating mode of the underlying flash driver ([SWS_Fee_00086]). It is provided via header file Fee.h with Service ID 0x01 ([SWS_Fee_00086]). As its only input parameter, the service expects Mode (of type MemIf_ModeType), which specifies the desired operating mode of the flash driver ([SWS_Fee_00086]). Neither output parameters nor a return value (void) are passed ([SWS_Fee_00086]).

Asynchronous Semantics and Concurrency

The interface is specified as asynchronous ([SWS_Fee_00086]). Since no function value is returned after the call, the actual switching process of the flash hardware is likely to take place with a time delay in the background. Question Q-9dbc267f51e150af (open) Regarding the call context, Fee_SetMode is classified as non-reentrant (Non Reentrant) ([SWS_Fee_00086]). Callers must therefore ensure that the function is not called concurrently or preemptively from different threads or tasks.

Error Handling and Interaction

In the present specification excerpt, no specific error codes, DET error messages, or DEM events are defined for Fee_SetMode ([SWS_Fee_00086]). Likewise, no direct relationships to further requirements are indicated. Interpretation: Any verification of invalid mode values is likely handled driver-internally or in module Fee without an explicit error return to the caller. Question (open)

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

Implementer's Guide to follow (complexity I1)

function Fee_Read [SWS_Fee_00087] 📄 PDF

Std_ReturnType Fee_Read (uint16 BlockNumber, uint16 BlockOffset, uint8* DataBufferPtr, uint16 Length);

Service to initiate a read job.

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

use

The function Fee_Read serves to initiate an asynchronous read job in the Flash EEPROM Emulation module and is declared via the header file Fee.h [SWS_Fee_00087]. It has the service ID 0x02 and accepts the following input parameters [SWS_Fee_00087]:

  • Block Number: Number of the logical block, which also indicates its start address in the flash memory.
  • Block Offset: Read offset within the respective block.
  • Length: Number of bytes to be read from the block.
  • Data Buffer Ptr: Pointer to the target buffer for storing the read data.

As return value, the function provides Std_ReturnType: E_OK signals that the requested read job was accepted by the module; E_NOT_OK indicates that the job was rejected [SWS_Fee_00087].

Concurrency and Limitations

The call to Fee_Read is specified as non-reentrant (Non Reentrant) and asynchronous (Asynchronous) [SWS_Fee_00087].

Interaction with the Flash Driver

If the function Fls_BlankCheck is configured in the flash driver, Fee_Read must call this function [SWS_Fee_00187]. This serves to verify beforehand whether the memory area can be read without triggering, for example, ECC errors caused by erased but not yet programmed flash cells [SWS_Fee_00187].

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

Implementer's Guide to follow (complexity I1)

function Fee_Write [SWS_Fee_00088] 📄 PDF

Std_ReturnType Fee_Write (uint16 BlockNumber, const uint8* DataBufferPtr);

Service to initiate a write job.

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

Usage and Semantics

The function Fee_Write serves as a service for initiating a write job in the Flash EEPROM Emulation module according to [SWS_Fee_00088]. The declaration is available via the header Fee.h. The call is asynchronous: The function merely triggers the write operation and does not block until the physical completion of the write operation.

Two parameters are defined for passing the write data [SWS_Fee_00088]:

  • BlockNumber (uint16): Designates the logical block number and simultaneously defines the start address of this block in the EEPROM.
  • DataBufferPtr (const uint8*): Pointer to the data buffer containing the payload data to be written.

Return Values and Concurrency

The return value of type Std_ReturnType immediately signals whether the write job could be accepted by the module [SWS_Fee_00088]:

  • E_OK: The requested job was accepted by the module.
  • E_NOT_OK: The job was not accepted by the module.

Regarding concurrency, Fee_Write is specified as non-reentrant (Non Reentrant) [SWS_Fee_00088]. Callers must therefore ensure that the function is not called concurrently from different contexts. The service ID of the function is 0x03 [SWS_Fee_00088]. Interpretation: The physical transfer of the data is likely handled asynchronously in the background by subsequent module cycles after the return of E_OK. Question Q-8bedddcf2371f6bf (open)

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

function Fee_Cancel [SWS_Fee_00089] 📄 PDF

void Fee_Cancel (void);

Service to call the cancel function of the underlying flash driver.

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

The function Fee_Cancel is a synchronous service of module Fee for forwarding a cancellation request to the underlying flash driver [SWS_Fee_00089]. This service is declared via the header Fee.h and has the numeric service ID 0x04 [SWS_Fee_00089].

Usage and Call Context

The interface has the signature void Fee_Cancel (void) [SWS_Fee_00089]. According to the specification, the following parameter and execution characteristics apply to the call:

  • Parameters: The function expects no parameters; neither input, input/output, nor output parameters are present [SWS_Fee_00089].
  • Return value: No return value is returned to the caller [SWS_Fee_00089].
  • Synchronicity: The execution of the function call is specified as synchronous (Synchronous) [SWS_Fee_00089].

Concurrency and Limitations

Regarding concurrency behavior, Fee_Cancel is specified as non-reentrant (Non Reentrant) [SWS_Fee_00089]. Calling instances must therefore ensure that the function is not called in parallel or nested from different task or interrupt contexts.

Interaction and Error Handling

The central task of Fee_Cancel is to call the cancel function of the underlying flash driver [SWS_Fee_00089]. Specific error codes, return values, or error messages are not defined for this function in the payload. Since no error handling is described, the behavior in the event of an error presumably depends on the implementation of the called flash driver. Question Q-bb066b6c05a2eb12 (open)

This usage note was generated automatically and is based exclusively on the specification content of AUTOSAR release R20-11.

function Fee_GetStatus [SWS_Fee_00090] 📄 PDF

MemIf_StatusType Fee_GetStatus (void);

Service to return the status. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_FlashEEPROMEmulation

function Fee_GetJobResult [SWS_Fee_00091] 📄 PDF

MemIf_JobResultType Fee_GetJobResult (void);

Service to query the result of the last accepted job issued by the upper layer software.

function Fee_InvalidateBlock [SWS_Fee_00092] 📄 PDF

Std_ReturnType Fee_InvalidateBlock (uint16 BlockNumber);

Service to invalidate a logical block.

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

The function Fee_InvalidateBlock serves as a service to invalidate a logical block in flash memory [SWS_Fee_00092]. It is available via header Fee.h and has Service ID 0x07 [SWS_Fee_00092].

Usage and Parameters

The call is asynchronous; the actual invalidation is thus initiated as a background job [SWS_Fee_00092]:

  • Block Number (uint16, in): Designates the logical block number, which simultaneously determines the start address of the block in flash memory [SWS_Fee_00092].
  • Return value (Std_ReturnType): Returns E_OK if the invalidation job was successfully accepted by the module [SWS_Fee_00092].

Error handling

If the module was unable to accept the request, E_NOT_OK is returned – according to the specification, however, this error return is explicitly restricted to configurations with DET enabled (only if DET is enabled) [SWS_Fee_00092]. Interpretation: If DET is disabled, a job rejection is likely not signaled to the caller via E_NOT_OK, since the specification ties the return of this error value to DET activation. Question Q-2e54187ddb69e481 (open)

Concurrency and Constraints

The interface is declared as non-reentrant (Non Reentrant) [SWS_Fee_00092]. Callers must therefore ensure that no parallel or interrupting calls to Fee_InvalidateBlock take place as long as a previous function call is active [SWS_Fee_00092].

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

function Fee_EraseImmediateBlock [SWS_Fee_00094] 📄 PDF

Std_ReturnType Fee_EraseImmediateBlock (uint16 BlockNumber);

Service to erase a logical block.

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

Usage and Parameters

The function Fee_EraseImmediateBlock provides an asynchronous service for erasing a logical block and is declared via header file Fee.h [SWS_Fee_00094]. The function has the hexadecimal Service ID 0x09 [SWS_Fee_00094]. The sole input parameter is Block Number of type uint16; this specifies the number of the logical block and simultaneously designates its start address in the EEPROM [SWS_Fee_00094].

Return Values and Error Handling

As return value, the interface returns status Std_ReturnType [SWS_Fee_00094]. The value E_OK confirms that the module has successfully accepted the requested erase job [SWS_Fee_00094]. If the job was not accepted by the module, the function returns E_NOT_OK; according to the specification, however, this return value occurs only with DET error monitoring enabled [SWS_Fee_00094].

Concurrency and Limitations

Regarding concurrency and call conditions, Fee_EraseImmediateBlock is classified as non-reentrant (Non Reentrant) and operates asynchronously [SWS_Fee_00094]. Calling modules must therefore ensure that no further call to the same interface occurs as long as the module is still busy processing.

Contextual explanation based on the AUTOSAR specification.

function Fee_JobEndNotification [SWS_Fee_00095] 📄 PDF

void Fee_JobEndNotification (void);

Service to report to this module the successful end of an asynchronous operation. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_FlashEEPROMEmulation

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

The function Fee_JobEndNotification serves to inform the Fee module of the successful completion of an asynchronous operation ([SWS_Fee_00095]).

With regard to usage and signature, the following specifications apply:

  • Signature and parameters: The function has the signature void Fee_JobEndNotification (void);. It expects neither input, input/output, nor output parameters and provides no return value ([SWS_Fee_00095]).
  • Header: The declaration is provided via Fee.h ([SWS_Fee_00095]).
  • Service ID: The function is defined via the service ID 0x10 ([SWS_Fee_00095]).
  • Synchronism: The call itself is specified as synchronous ([SWS_Fee_00095]).
  • Concurrency: The routine is classified as non-reentrant (Non Reentrant) ([SWS_Fee_00095]).

Interaction and call context: Typically, this callback is expected to be called by an underlying module (such as a flash driver) to signal the end of an asynchronous write or erase job. Question Q-8a3ccdba2024001f (open) Due to the Non Reentrant property, the caller must ensure that no concurrent calls occur ([SWS_Fee_00095]).

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

function Fee_JobErrorNotification [SWS_Fee_00096] 📄 PDF

void Fee_JobErrorNotification (void);

Service to report to this module the failure of an asynchronous operation.

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

The function Fee_JobErrorNotification serves as a notification service to inform the Fee module of the failure of an asynchronous operation [SWS_Fee_00096]. The interface has the signature void Fee_JobErrorNotification (void) and is available via header Fee.h [SWS_Fee_00096]. Neither input, input/output, nor output parameters are passed to the service with identifier 0x11 [SWS_Fee_00096]. Likewise, the call returns no return value to the caller [SWS_Fee_00096].

The execution semantics of the call is specified as synchronous (Synchronous) [SWS_Fee_00096]. For the runtime behavior, the central restriction applies that the function is non-reentrant (Non Reentrant) [SWS_Fee_00096]. Interpretation: The caller – which is presumably an underlying driver component – must ensure that the notification is never triggered concurrently or in parallel from interrupting contexts. Question Q-7d4c9618bf385721 (open)

Regarding error handling, no specific error codes are transmitted by the parameterless interface, and no module-specific DET or DEM notifications are documented for this call [SWS_Fee_00096]. The Fee module is likely to assign the reported error case internally to the active asynchronous job and adjust its status accordingly. Question Q-1fa43444195edb62 (open)

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

function Fee_MainFunction [SWS_Fee_00097] 📄 PDF

void Fee_MainFunction (void);

Service to handle the requested read / write / erase jobs and the internal management operations.

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

According to [SWS_Fee_00097], the function Fee_MainFunction serves for the central processing of requested read, write, and erase jobs as well as the execution of internal management operations of the module. It is specified with the signature void Fee_MainFunction (void); and Service ID 0x12 [SWS_Fee_00097].

Regarding interface and usage, the function processes no input parameters and has no return value [SWS_Fee_00097]. From its availability via header SchM_Fee.h, it can presumably be deduced that its invocation is performed cyclically by the schedule management of the basic software. Question Q-5ef9bcc5f438cb89 (open) The description suggests that jobs previously passed asynchronously are likely to be processed successively within these periodic cycles.

The specification contains no separate identifiers or error codes regarding error scenarios, reentrancy, and specific call conditions [SWS_Fee_00097]. Interpretation: As the central cyclic control function for the module state, Fee_MainFunction is likely to be non-reentrant, which is why concurrent invocation from multiple tasks must be avoided. Question (open)

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

function NvM_JobEndNotification [SWS_Fee_00098] 📄 PDF

void NvM_JobEndNotification (void);

-

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

Usage and signature

The function NvM_JobEndNotification is defined as a service in the specification of the Flash EEPROM Emulation (Fee) and is available via header file Nvm.h ([SWS_Fee_00098]). According to its syntax void NvM_JobEndNotification (void);, the function requires neither input nor output parameters and returns no return value ([SWS_Fee_00098]). A synchronous semantics is specified for the execution behavior (Sync/Async: true) ([SWS_Fee_00098]).

Concurrency and Limitations

Regarding reentrancy, the function is classified with Don't care ([SWS_Fee_00098]). Specific restrictions regarding the call context are not defined in the specification. Separate error handling via DET or DEM notifications is not specified for this element ([SWS_Fee_00098]).

Interaction and Functional Classification

Although the function is part of the Flash EEPROM Emulation specification, the description field contains no further details ([SWS_Fee_00098]). Interpretation: Due to the naming and declaration in Nvm.h, the function is presumably likely to serve as a callback interface via which module Fee signals the regular completion of an asynchronously processed job to module NvM. Question Q-ee00bece2e28a0e4 (open)

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

function NvM_JobErrorNotification [SWS_Fee_00099] 📄 PDF

void NvM_JobErrorNotification (void);

-

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

Usage and Call Context

According to [SWS_Fee_00099], the function NvM_JobErrorNotification is defined as a synchronous interface (Sync/ Async true). Its declaration is provided via header file Nvm.h ([SWS_Fee_00099]). The signature is void NvM_JobErrorNotification (void), meaning it accepts neither input, in-out, nor output parameters and returns no return value ([SWS_Fee_00099]). According to the identifier and the assignment to module Fee, this callback function is likely intended to notify NVRAM management in the event of an error during asynchronous job processing in the flash EEPROM emulation driver. Question Q-4d70f8d384e04832 (open)

Error Handling and Concurrency

In [SWS_Fee_00099], no specific error codes, DET notifications, or DEM events are listed. Since no status or error parameters are passed, a detailed error analysis is presumably likely based on internal module states or subsequent queries to the driver. Question Q-c45e72b67236c432 (open) Regarding concurrency, [SWS_Fee_00099] specifies the criterion Don't care for reentrancy, meaning that no restricting requirements regarding reentrancy are formulated by the requirement.

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

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

Record
AUTOSAR/AP/record/CP_MOD_Fee
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Fee@rel:R20-11#5b9f63f8
Content hash
5b9f63f8
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_FlashEEPROMEmulation.pdf#nameddest=SWS_Fee_00085

Initialization and status

Fee_GetStatus function

Service to return the status. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_FlashEEPROMEmulation

MemIf_StatusType Fee_GetStatus (void);

Service to return the version information of the FEE module.

void Fee_GetVersionInfo (Std_VersionInfoType* VersionInfoPtr);
Fee_Init function

Service to initialize the FEE module.

void Fee_Init (const Fee_ConfigType* ConfigPtr);

Services

Fee_Cancel function

Service to call the cancel function of the underlying flash driver.

void Fee_Cancel (void);

Service to erase a logical block.

Std_ReturnType Fee_EraseImmediateBlock (uint16 BlockNumber);

Service to query the result of the last accepted job issued by the upper layer software.

MemIf_JobResultType Fee_GetJobResult (void);

Service to invalidate a logical block.

Std_ReturnType Fee_InvalidateBlock (uint16 BlockNumber);

Service to report to this module the successful end of an asynchronous operation. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_FlashEEPROMEmulation

void Fee_JobEndNotification (void);

Service to report to this module the failure of an asynchronous operation.

void Fee_JobErrorNotification (void);
Fee_Read function

Service to initiate a read job.

Std_ReturnType Fee_Read (uint16 BlockNumber, uint16 BlockOffset, uint8* DataBufferPtr, uint16 Length);
Fee_SetMode function

Function to switch the mode of the underlying Flash Driver

void Fee_SetMode (MemIf_ModeType Mode);
Fee_Write function

Service to initiate a write job.

Std_ReturnType Fee_Write (uint16 BlockNumber, const uint8* DataBufferPtr);

-

void NvM_JobEndNotification (void);

-

void NvM_JobErrorNotification (void);

Cyclic

Service to handle the requested read / write / erase jobs and the internal management operations.

void Fee_MainFunction (void);

Types

Configuration data structure of the Fee module.