DEENESPTFRRUARHIKOZHNL

Flash Driver (Fls)

ModulFls (Flash Driver)
BSW-Modul-ID92
Standard-Header#include "Fls.h"
SWS-SpezifikationAUTOSAR_CP_SWS_FlashDriver.pdf, AUTOSAR_SWS_FlashDriver.pdf
Umfang178 Records · 10 Snippets
ClusterSpeicher-Stack (Memory)

Flash Driver (Fls)

AUTOSAR Classic Memory Drivers-Modul Flash Driver (Fls, Spezifikation: AUTOSAR_CP_SWS_FlashDriver.pdf, AUTOSAR_SWS_FlashDriver.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

function Fls_Init [SWS_Fls_00249] 📄 PDF

void Fls_Init(const Fls_ConfigType* ConfigPtr);

Initializes the Flash Driver.

function Fls_Compare [SWS_Fls_00257] 📄 PDF

Std_ReturnType Fls_Compare(Fls_AddressType SourceAddress, const uint8* TargetAddressPtr, Fls_LengthType Length);

Compares the contents of an area of flash memory with that of an application data buffer.

function Fls_SetMode [SWS_Fls_00258] 📄 PDF

void Fls_SetMode(MemIf_ModeType Mode);

Sets the flash driver's operation mode.

function Fee_JobEndNotification [SWS_Fls_00262] 📄 PDF

void Fee_JobEndNotification(void);

This callback function is called when a job has been completed with a positive result.

function Fee_JobErrorNotification [SWS_Fls_00263] 📄 PDF

void Fee_JobErrorNotification(void);

This callback function is called when a job has been canceled or finished with negative result.

function Fls_BlankCheck [SWS_Fls_00371] 📄 PDF

Std_ReturnType Fls_BlankCheck(Fls_AddressType TargetAddress, Fls_LengthType Length);

The function Fls_BlankCheck shall verify, whether a given memory area has been erased but not (yet) programmed. The function shall limit the maximum number of checked flash cells per main function cycle to the configured value FlsMaxReadNormalMode or FlsMaxReadFastMode respectively.

type Fls_ConfigType [SWS_Fls_00368] 📄 PDF

A pointer to such a structure is provided to the flash driver initialization routine for configuration of the driver and flash memory hardware.

type Fls_AddressType [SWS_Fls_00369] 📄 PDF

Used as address offset from the configured flash base address to access a certain flash memory area.

requirement SWS_Fls_00001 [SWS_Fls_00001] 📄 PDF

The FLS module shall offer asynchronous services for operations on flash memory (read/erase/write).

requirement SWS_Fls_00002 [SWS_Fls_00002] 📄 PDF

The FLS module shall not buffer data. The FLS module shall use application data buffers that are referenced by a pointer passed via the API.

requirement SWS_Fls_00003 [SWS_Fls_00003] 📄 PDF

The FLS module shall not ensure data consistency of the given application buffer.

requirement SWS_Fls_00004 [SWS_Fls_00004] 📄 PDF

Type of error Related error code Error value API service called with wrong parameter FLS_E_PARAM_CONFIG 0x01 API service called with wrong parameter FLS_E_PARAM_ADDRESS 0x02 API service called with wrong parameter FLS_E_PARAM_LENGTH 0x03 API service called with wrong parameter FLS_E_PARAM_DATA 0x04 API service called without module initialization FLS_E_UNINIT 0x05 API service called with NULL pointer FLS_E_PARAM_POINTER 0x0a – FLS_E_ALREADY_INITIALIZED 0x0b

requirement SWS_Fls_00014 [SWS_Fls_00014] 📄 PDF

The function Fls_Init shall initialize the FLS module (software) and all flash memory relevant registers (hardware) with parameters provided in the given configuration set.

requirement SWS_Fls_00015 [SWS_Fls_00015] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Init shall check the (hardware specific) contents of the given configu- ration set for being within the allowed range. If this is not the case, it shall raise the development error FLS_E_PARAM_CONFIG .

requirement SWS_Fls_00020 [SWS_Fls_00020] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Erase shall check that the erase start address (flash memory base ad- dress + TargetAddress ) is aligned to a flash sector boundary and that it lies within the specified lower and upper flash address boundaries. If this check fails, the func- tion Fls_Erase shall reject the erase request, raise the development error FLS_E_- PARAM_ADDRESS and return with E_NOT_OK.

requirement SWS_Fls_00021 [SWS_Fls_00021] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Erase shall check that the erase length is greater than 0 and that the erase end address (erase start address + length) is aligned to a flash sector boundary and that it lies within the specified upper flash address boundary. If this check fails, the function Fls_Erase shall reject the erase request, raise the development error FLS_E_PARAM_LENGTH and return with E_NOT_OK.

requirement SWS_Fls_00022 [SWS_Fls_00022] 📄 PDF

If erase verification is enabled (compile switch FlsEraseVer- ificationEnabled set to TRUE): After a flash block has been erased, the func- tion Fls_MainFunction shall compare the contents of the addressed memory area against the value of an erased flash cell to check that the block has been completely erased. If this check fails, the function Fls_MainFunction shall set the FLS mod- ule's job result to MEMIF_JOB_FAILED and raise the runtime error FLS_E_VERIFY_- ERASE_FAILED .

requirement SWS_Fls_00023 [SWS_Fls_00023] 📄 PDF

If runtime error detection for the module Fls is enabled: the func- tion Fls_Erase shall check that the FLS module is currently not busy. If this check fails, the function Fls_Erase shall reject the erase request, raise the development error FLS_E_BUSY and return with E_NOT_OK.

requirement SWS_Fls_00026 [SWS_Fls_00026] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Write shall check that the write start address (flash memory base ad- dress + TargetAddress ) is aligned to a flash page boundary and that it lies within the specified lower and upper flash address boundaries. If this check fails, the func- tion Fls_Write shall reject the write request, raise the development error FLS_E_- PARAM_ADDRESS and return with E_NOT_OK.

requirement SWS_Fls_00027 [SWS_Fls_00027] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Write shall check that the write length is greater than 0, that the write end address (write start address + length) is aligned to a flash page boundary and that it lies within the specified upper flash address boundary. If this check fails, the func- tion Fls_Write shall reject the write request, raise the development error FLS_E_- PARAM_LENGTH and return with E_NOT_OK.

requirement SWS_Fls_00030 [SWS_Fls_00030] 📄 PDF

If runtime error detection for the module Fls is enabled: the func- tion Fls_Write shall check that the FLS module is currently not busy. If this check fails, the function Fls_Write shall reject the write request, raise the development error FLS_E_BUSY and return with E_NOT_OK.

requirement SWS_Fls_00033 [SWS_Fls_00033] 📄 PDF

The function Fls_Cancel shall set the job result to MEMIF_JOB_ CANCELED if the job result currently has the value MEMIF_JOB_PENDING. Other- wise the function Fls_Cancel shall leave the job result unchanged.

requirement SWS_Fls_00034 [SWS_Fls_00034] 📄 PDF

The function Fls_GetStatus shall return the FLS module state synchronously.

requirement SWS_Fls_00035 [SWS_Fls_00035] 📄 PDF

The function Fls_GetJobResult shall return the result of the last job synchronously

requirement SWS_Fls_00036 [SWS_Fls_00036] 📄 PDF

The erase, write, read and compare functions shall share the same job result, i.e. only the result of the last job can be queried. The FLS module shall overwrite the job result with MEMIF_JOB_PENDING if the FLS module has accepted a new job.

requirement SWS_Fls_00037 [SWS_Fls_00037] 📄 PDF

The function Fls_MainFunction shall perform the processing of the flash read, write, erase and compare jobs.

requirement SWS_Fls_00038 [SWS_Fls_00038] 📄 PDF

When a job has been initiated, the FLS module's environment shall call the function Fls_MainFunction cyclically until the job is finished.

requirement SWS_Fls_00039 [SWS_Fls_00039] 📄 PDF

The function Fls_MainFunction shall return without any action if no job is pending.

requirement SWS_Fls_00040 [SWS_Fls_00040] 📄 PDF

The function Fls_MainFunction shall only process as much data in one call cycle as statically configured for the current job type (read, write or compare) and the current FLS module's operating mode (normal, fast).

requirement SWS_Fls_00048 [SWS_Fls_00048] 📄 PDF

If supported by hardware, the function Fls_Init shall set the flash memory erase/write protection as provided in the configuration set.

requirement SWS_Fls_00055 [SWS_Fls_00055] 📄 PDF

If erase verification is enabled (compile switch FlsEraseVer- ificationEnabled set to TRUE): Before writing a flash block, the function Fls_- MainFunction shall compare the contents of the addressed memory area against the value of an erased flash cell to check that the block has been completely erased. If this check fails, the function Fls_MainFunction shall set the FLS module's job result to MEMIF_JOB_FAILED and raise the runtime error FLS_E_VERIFY_ERASE_FAILED .

requirement SWS_Fls_00056 [SWS_Fls_00056] 📄 PDF

If write verification is enabled (compile switch FlsWriteVerifi- cationEnabled set to TRUE): After writing a flash block, the function Fls_Main- Function shall compare the contents of the reprogrammed memory area against the contents of the provided application buffer to check that the block has been completely reprogrammed. If this check fails, the function Fls_MainFunction shall set the FLS module's job result to MEMIF_JOB_FAILED and raise the runtime error FLS_E_VER- IFY_WRITE_FAILED .

requirement SWS_Fls_00065 [SWS_Fls_00065] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Erase shall check that the FLS module has been initialized. If this check fails, the function Fls_Erase shall reject the erase request, raise the development error FLS_E_UNINIT and return with E_NOT_OK.

requirement SWS_Fls_00066 [SWS_Fls_00066] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Write shall check that the FLS module has been initialized. If this check fails, the function Fls_Write shall reject the write request, raise the development error FLS_E_UNINIT and return with E_NOT_OK.

requirement SWS_Fls_00086 [SWS_Fls_00086] 📄 PDF

The function Fls_Init shall initialize all FLS module global vari- ables and those controller registers that are needed for controlling the flash device and that do not influence or depend on other (hardware) modules. Registers that can in- fluence or depend on other modules shall be initialized by a common system module.

requirement SWS_Fls_00088 [SWS_Fls_00088] 📄 PDF

The functional requirements [2] and the functional scope are the same for both internal and external drivers. Hence the API is semantically identical.

requirement SWS_Fls_00097 [SWS_Fls_00097] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Read shall check that the read start address (flash memory base address + SourceAddress ) lies within the specified lower and upper flash address bound- aries. If this check fails, the function Fls_Read shall reject the read job, raise de- velopment error FLS_E_PARAM_ADDRESS and return with E_NOT_OK.

requirement SWS_Fls_00098 [SWS_Fls_00098] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Read shall check that the read length is greater than 0 and that the read end address (read start address + length) lies within the specified upper flash address boundary. If this check fails, the function Fls_Read shall reject the read job, raise the development error FLS_E_PARAM_LENGTH and return with E_NOT_OK.

requirement SWS_Fls_00099 [SWS_Fls_00099] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Read shall check that the driver has been initialized. If this check fails, the function Fls_Read shall reject the read request, raise the development error FLS_- E_UNINIT and return with E_NOT_OK.

requirement SWS_Fls_00100 [SWS_Fls_00100] 📄 PDF

If runtime error detection for the module Fls is enabled: the func- tion Fls_Read shall check that the driver is currently not busy. If this check fails, the function Fls_Read shall reject the read request, raise the development error FLS_- E_BUSY and return with E_NOT_OK.

requirement SWS_Fls_00104 [SWS_Fls_00104] 📄 PDF

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_ERASE_FAILED to the DET if a flash erase job fails due to a hardware error.

requirement SWS_Fls_00105 [SWS_Fls_00105] 📄 PDF

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_WRITE_FAILED to the DET if a flash write job fails due to a hardware error.

requirement SWS_Fls_00106 [SWS_Fls_00106] 📄 PDF

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_READ_FAILED to the DET if a flash read job fails due to a hardware error.

requirement SWS_Fls_00110 [SWS_Fls_00110] 📄 PDF

The callback notifications shall have no parameters and no return value.

requirement SWS_Fls_00137 [SWS_Fls_00137] 📄 PDF

The FLS module's implementer shall place the code of the flash access routines into a separate C-module Fls_ac.c.

requirement SWS_Fls_00140 [SWS_Fls_00140] 📄 PDF

The FLS module's erase routine shall load the flash access code for erasing the flash memory to the location in RAM pointed to by the erase function pointer contained in the flash drivers configuration set if the FLS module is configured to load the flash access code to RAM on job start.

requirement SWS_Fls_00141 [SWS_Fls_00141] 📄 PDF

The FLS module's write routine shall load the flash access code for writing the flash memory to the location in RAM pointed to by the write function pointer contained in the flash drivers configuration set if the FLS module is configured to load the flash access code to RAM on job start.

requirement SWS_Fls_00143 [SWS_Fls_00143] 📄 PDF

After an erase or write job has been finished or canceled, the FLS module's main processing routine shall unload (i.e. overwrite) the flash access code (internal erase / write routines) from RAM if they have been loaded to RAM by the flash driver.

requirement SWS_Fls_00144 [SWS_Fls_00144] 📄 PDF

During the initialization of the external flash driver, the FLS module shall check the hardware ID of the external flash device against the corresponding published parameter. If a hardware ID mismatch occurs, the FLS module shall report the error code FLS_E_UNEXPECTED_FLASH_ID to the Default Error Tracer (DET), set the FLS module status to FLS_E_UNINIT and shall not initialize itself.

requirement SWS_Fls_00145 [SWS_Fls_00145] 📄 PDF

If possible, e.g. with interrupt controlled implementations, the FLS module shall start the first round of the erase job directly within the function Fls_- Erase to reduce overall runtime.

requirement SWS_Fls_00146 [SWS_Fls_00146] 📄 PDF

If possible, e.g. with interrupt controlled implementations, the FLS module shall start the first round of the write job directly within the function Fls_Write to reduce overall runtime.

requirement SWS_Fls_00147 [SWS_Fls_00147] 📄 PDF

If configured, the function Fls_Cancel shall call the error notifi- cation function to inform the caller about the cancellation of a job.

requirement SWS_Fls_00150 [SWS_Fls_00150] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Compare shall check that the compare start address (flash memory base address + SourceAddress ) lies within the specified lower and upper flash address boundaries. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_PARAM_ADDRESS and return with E_NOT_OK.

requirement SWS_Fls_00151 [SWS_Fls_00151] 📄 PDF

If If development error detection for the module Fls is enabled: the function Fls_Compare shall check that the given length is greater than 0 and that the compare end address (compare start address + length) lies within the specified upper flash address boundary. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_PARAM_LENGTH and return with E_ NOT_OK.

requirement SWS_Fls_00152 [SWS_Fls_00152] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Compare shall check that the driver has been initialized. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_UNINIT and return with E_NOT_OK.

requirement SWS_Fls_00153 [SWS_Fls_00153] 📄 PDF

If runtime error detection for the module Fls is enabled: the func- tion Fls_Compare shall check that the driver is currently not busy. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_BUSY and return with E_NOT_OK.

requirement SWS_Fls_00154 [SWS_Fls_00154] 📄 PDF

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_COMPARE_FAILED to the DET if a flash compare job fails due to a hardware error.

requirement SWS_Fls_00155 [SWS_Fls_00155] 📄 PDF

The function Fls_SetMode shall set the FLS module's operation mode to the given "Mode" parameter.

requirement SWS_Fls_00156 [SWS_Fls_00156] 📄 PDF

If runtime error detection for the module Fls is enabled: the func- tion Fls_SetMode shall check that the FLS module is currently not busy. If this check fails, the function Fls_SetMode shall reject the set mode request and raise the devel- opment error code FLS_E_BUSY .

requirement SWS_Fls_00157 [SWS_Fls_00157] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Write shall check the given data buffer pointer for not being a null pointer. If the data buffer pointer is a null pointer, the function Fls_Write shall re- ject the write request, raise the development error FLS_E_PARAM_DATA and return with E_NOT_OK.

requirement SWS_Fls_00158 [SWS_Fls_00158] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Read shall check the given data buffer pointer for not being a null pointer. If the data buffer pointer is a null pointer, the function Fls_Read shall reject the read request, raise the development error FLS_E_PARAM_DATA and return with E_NOT_ OK.

requirement SWS_Fls_00167 [SWS_Fls_00167] 📄 PDF

The FLS module shall call the callback function Fee_JobEndNo- tification when the module has completed a job with a positive result: • Read job finished & OK • Write job finished & OK • Erase job finished & OK • Compare job finished & memory blocks are the same

requirement SWS_Fls_00183 [SWS_Fls_00183] 📄 PDF

The function Fls_Cancel shall be pre-compile time configurable On/Off by the configuration parameter FlsCancelApi .

requirement SWS_Fls_00184 [SWS_Fls_00184] 📄 PDF

The function Fls_GetStatus shall be pre-compile time config- urable On/Off by the configuration parameter FlsGetStatusApi .

requirement SWS_Fls_00185 [SWS_Fls_00185] 📄 PDF

The function Fls_GetJobResult shall be pre-compile time configurable On/Off by the configuration parameter FlsGetJobResultApi .

requirement SWS_Fls_00186 [SWS_Fls_00186] 📄 PDF

The function Fls_Compare shall be pre-compile time config- urable On/Off by the configuration parameter FlsCompareApi .

requirement SWS_Fls_00187 [SWS_Fls_00187] 📄 PDF

The function Fls_SetMode shall be pre-compile time config- urable On/Off by the configuration parameter FlsSetModeApi .

requirement SWS_Fls_00191 [SWS_Fls_00191] 📄 PDF

The function Fls_Init shall store the pointer to the given config- uration set in a variable in order to allow the FLS module access to the configuration set contents during runtime.

requirement SWS_Fls_00193 [SWS_Fls_00193] 📄 PDF

Depending on implementation, callback routines provided and/or invoked by the FLS module may be called on interrupt level. The module providing those routines has therefore to make sure that their runtime is reasonably short, i.e. since callbacks may be propagated upward through several software layers.

requirement SWS_Fls_00196 [SWS_Fls_00196] 📄 PDF

The function Fls_MainFunction shall at the most issue one sector erase command (to the hardware) in each cycle.

requirement SWS_Fls_00200 [SWS_Fls_00200] 📄 PDF

The function Fls_MainFunction shall set the job result to MEMIF_BLOCK_INCONSISTENT if the compared data from a flash compare job are not equal.

requirement SWS_Fls_00205 [SWS_Fls_00205] 📄 PDF

The FLS module shall check static configuration parameters stat- ically (at the latest during compile time) for correctness.

requirement SWS_Fls_00206 [SWS_Fls_00206] 📄 PDF

The FLS module shall validate the version information in the FLS module header and source files for consistency (e.g. by comparing the version infor- mation in the module header and source files with a pre-processor macro).

requirement SWS_Fls_00208 [SWS_Fls_00208] 📄 PDF

The FLS module shall combine all available flash memory areas into one linear address space (denoted by the parameters FlsBaseAddress and FlsTotalSize ).

requirement SWS_Fls_00209 [SWS_Fls_00209] 📄 PDF

The FLS module shall map the address and length parameters for the read, write, erase and compare functions as "virtual" addresses to the physical addresses according to the physical structure of the flash memory areas.

requirement SWS_Fls_00211 [SWS_Fls_00211] 📄 PDF

The FLS module's implementer shall keep the execution time for the flash access code as short as possible.

requirement SWS_Fls_00212 [SWS_Fls_00212] 📄 PDF

The FLS module's main processing routine shall execute the flash access code routines.

requirement SWS_Fls_00213 [SWS_Fls_00213] 📄 PDF

The FLS module's main processing routine shall access the flash access code routines by means of the respective function pointer contained in the FLS module's configuration set (post-compile parameters) regardless whether the flash access code routines have been loaded to RAM or whether they can be executed directly from (flash) ROM.

requirement SWS_Fls_00214 [SWS_Fls_00214] 📄 PDF

The FLS module shall only load the access code to the RAM if the access code cannot be executed out of flash ROM.

requirement SWS_Fls_00215 [SWS_Fls_00215] 📄 PDF

The FLS module's flash access routines shall only disable inter- rupts and wait for the completion of the erase / write command if necessary (that is if it has to be ensured that no other code is executed in the meantime).

requirement SWS_Fls_00216 [SWS_Fls_00216] 📄 PDF

The type Fls_AddressType shall have 0 as lower limit for each flash device.

requirement SWS_Fls_00217 [SWS_Fls_00217] 📄 PDF

The FLS module shall add a device specific base address to the address type Fls_AddressType if necessary.

requirement SWS_Fls_00218 [SWS_Fls_00218] 📄 PDF

The job of the function Fls_Erase shall erase one or more com- plete flash sectors.

requirement SWS_Fls_00220 [SWS_Fls_00220] 📄 PDF

The FLS module shall execute the job of the function Fls_Erase asynchronously within the FLS module's main function.

requirement SWS_Fls_00221 [SWS_Fls_00221] 📄 PDF

The job of the function Fls_Erase shall erase a flash memory block starting from the flash memory base address + TargetAddress of size Length. Note: Length will be rounded up to the next full sector boundary since only complete flash sectors can be erased.

requirement SWS_Fls_00223 [SWS_Fls_00223] 📄 PDF

The job of the function Fls_Write shall write one or more com- plete flash pages to the flash device.

requirement SWS_Fls_00225 [SWS_Fls_00225] 📄 PDF

The FLS module shall execute the write job of the function Fls_- Write asynchronously within the FLS module's main function.

requirement SWS_Fls_00226 [SWS_Fls_00226] 📄 PDF

The job of the function Fls_Write shall program a flash memory block with data provided via SourceAddressPtr starting from the flash memory base address + TargetAddress of size Length.

requirement SWS_Fls_00229 [SWS_Fls_00229] 📄 PDF

The function Fls_Cancel shall cancel an ongoing flash read, write, erase or compare job.

requirement SWS_Fls_00230 [SWS_Fls_00230] 📄 PDF

The function Fls_Cancel shall abort a running job synchronously so that directly after returning from this function a new job can be started.

requirement SWS_Fls_00232 [SWS_Fls_00232] 📄 PDF

The configuration parameter FlsUseInterrupts shall switch between interrupt and polling controlled job processing if this is supported by the flash memory hardware.

requirement SWS_Fls_00233 [SWS_Fls_00233] 📄 PDF

The FLS module's implementer shall locate the interrupt service routine in Fls_Irq.c.

requirement SWS_Fls_00234 [SWS_Fls_00234] 📄 PDF

If interrupt controlled job processing is supported and enabled with the configuration parameter FlsUseInterrupts, the interrupt service routine shall reset the interrupt flag, check for errors reported by the underlying hardware, reload the hard- ware finite state machine for the next round of the pending job or call the appropriate notification routine if the job is finished or aborted.

requirement SWS_Fls_00235 [SWS_Fls_00235] 📄 PDF

The function Fls_MainFunction shall process jobs without hardware interrupt support (e.g. read jobs).

requirement SWS_Fls_00238 [SWS_Fls_00238] 📄 PDF

The FLS module shall execute the read job of the function Fls_Read asynchronously within the FLS module's main function.

requirement SWS_Fls_00239 [SWS_Fls_00239] 📄 PDF

The read job of the function Fls_Read shall copy a continuous flash memory block starting from the flash memory base address + SourceAddress of size Length to the buffer pointed to by TargetAddressPtr .

requirement SWS_Fls_00240 [SWS_Fls_00240] 📄 PDF

The FLS module's environment shall only call the function Fls_- Read after the FLS module has been initialized.

requirement SWS_Fls_00241 [SWS_Fls_00241] 📄 PDF

The function Fls_Compare shall compare the contents of an area of flash memory with that of an application data buffer.

requirement SWS_Fls_00243 [SWS_Fls_00243] 📄 PDF

The FLS module shall execute the job of the function Fls_- Compare asynchronously within the FLS module's main function.

requirement SWS_Fls_00244 [SWS_Fls_00244] 📄 PDF

The job of the function Fls_Compare shall compare a continuous flash memory block starting from the flash memory base address + SourceAddress of size Length with the buffer pointed to by TargetAddressPtr .

requirement SWS_Fls_00248 [SWS_Fls_00248] 📄 PDF

Module Header File Imported Type MemIf.h MemIf_JobResultType (obsolete) MemIf.h MemIf_ModeType (obsolete) MemIf MemIf.h MemIf_StatusType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

requirement SWS_Fls_00260 [SWS_Fls_00260] 📄 PDF

Det_ReportRuntimeError Det.h Service to report runtime errors. If a callout has been configured then this callout shall be called.

requirement SWS_Fls_00268 [SWS_Fls_00268] 📄 PDF

If runtime error detection for the module Fls is enabled: the func- tion Fls_Init shall check module initialization status. If the module has already been initialized, the function Fls_Init shall raise the development error FLS_E_- ALREADY_INITIALIZED .

requirement SWS_Fls_00269 [SWS_Fls_00269] 📄 PDF

The Fls module shall provide only one scheduled function. Read- ing from / writing to flash memory cannot usually be done simultaneously and the over- head for synchronizing two scheduled functions would outweigh the benefits.

requirement SWS_Fls_00272 [SWS_Fls_00272] 📄 PDF

If timeout supervision is enabled (compile switch FlsTimeoutSu- pervisionEnabled set to TRUE): the function Fls_MainFunction shall provide a timeout monitoring for the currently running job, that is it shall supervise the deadline of the read / compare / erase or write job.

requirement SWS_Fls_00273 [SWS_Fls_00273] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Compare shall check the given data buffer pointer for not being a null pointer. If the data buffer pointer is a null pointer, the function Fls_Compare shall reject the request, raise the development error FLS_E_PARAM_DATA and return with E_NOT_OK.

requirement SWS_Fls_00310 [SWS_Fls_00310] 📄 PDF

The following development error codes shall be reported when an API service is called with a wrong parameter: FLS_E_PARAM_CONFIG , FLS_- E_PARAM_ADDRESS , FLS_E_PARAM_LENGTH , FLS_E_PARAM_DATA .

requirement SWS_Fls_00312 [SWS_Fls_00312] 📄 PDF

The runtime error code FLS_E_BUSY shall be reported when an API service is called while the module is still busy.

requirement SWS_Fls_00313 [SWS_Fls_00313] 📄 PDF

The runtime error code FLS_E_VERIFY_ERASE_FAILED shall be reported when the erase verification function is enabled (by the com- pile switch FlsEraseVerificationEnabled ) and the erase verification func- tion (blankcheck) failed.

requirement SWS_Fls_00314 [SWS_Fls_00314] 📄 PDF

The runtime error code FLS_E_VERIFY_WRITE_FAILED shall be reported when the write verification function is enabled (by the compile switch FlsWriteVerificationEnabled ) and the write verification function (com- pare) failed.

requirement SWS_Fls_00315 [SWS_Fls_00315] 📄 PDF

The transient fault code FLS_E_ERASE_FAILED shall be reported when the flash erase function failed (in hardware).

requirement SWS_Fls_00316 [SWS_Fls_00316] 📄 PDF

The transient fault code FLS_E_WRITE_FAILED shall be reported when the flash write function failed (in hardware).

requirement SWS_Fls_00317 [SWS_Fls_00317] 📄 PDF

The transient fault code FLS_E_READ_FAILED shall be reported when the flash read function failed (in hardware).

requirement SWS_Fls_00318 [SWS_Fls_00318] 📄 PDF

The transient fault code FLS_E_COMPARE_FAILED shall be re- ported when the flash compare function failed (in hardware).

requirement SWS_Fls_00319 [SWS_Fls_00319] 📄 PDF

The transient fault code FLS_E_UNEXPECTED_FLASH_ID shall be reported when the expected flash ID is not matched (see [SWS_Fls_00144]).

requirement SWS_Fls_00323 [SWS_Fls_00323] 📄 PDF

The function Fls_Init shall set the FLS module state to MEMIF_ IDLE after having finished the FLS module initialization.

requirement SWS_Fls_00324 [SWS_Fls_00324] 📄 PDF

The function Fls_Init shall set the flash job result to MEMIF_ JOB_OK after having finished the FLS module initialization.

requirement SWS_Fls_00327 [SWS_Fls_00327] 📄 PDF

The function Fls_Erase shall copy the given parameters to FLS module internal variables and initiate an erase job.

requirement SWS_Fls_00328 [SWS_Fls_00328] 📄 PDF

After initiating the erase job, the function Fls_Erase shall set the FLS module status to MEMIF_BUSY.

requirement SWS_Fls_00329 [SWS_Fls_00329] 📄 PDF

After initiating the erase job, the function Fls_Erase shall set the job result to MEMIF_JOB_PENDING.

requirement SWS_Fls_00330 [SWS_Fls_00330] 📄 PDF

After initiating the erase job, the function Fls_Erase shall return with E_OK.

requirement SWS_Fls_00331 [SWS_Fls_00331] 📄 PDF

The function Fls_Write shall copy the given parameters to Fls module internal variables and initiate a write job.

requirement SWS_Fls_00332 [SWS_Fls_00332] 📄 PDF

After initiating the write job, the function Fls_Write shall set the FLS module status to MEMIF_BUSY.

requirement SWS_Fls_00333 [SWS_Fls_00333] 📄 PDF

After initiating the write job, the function Fls_Write shall set the job result to MEMIF_JOB_PENDING.

requirement SWS_Fls_00334 [SWS_Fls_00334] 📄 PDF

After initiating the write job, the function Fls_Write shall return with E_OK.

requirement SWS_Fls_00335 [SWS_Fls_00335] 📄 PDF

The function Fls_Cancel shall reset the FLS module's internal job processing variables (like address, length and data pointer).

requirement SWS_Fls_00336 [SWS_Fls_00336] 📄 PDF

The function Fls_Cancel shall set the FLS module state to MEMIF_IDLE.

requirement SWS_Fls_00337 [SWS_Fls_00337] 📄 PDF

The function Fls_Read shall copy the given parameters to FLS module internal variables and initiate a read job.

requirement SWS_Fls_00338 [SWS_Fls_00338] 📄 PDF

After initiating a read job, the function Fls_Read shall set the FLS module status to MEMIF_BUSY.

requirement SWS_Fls_00339 [SWS_Fls_00339] 📄 PDF

After initiating a read job, the function Fls_Read shall set the FLS module job result to MEMIF_JOB_PENDING.

requirement SWS_Fls_00340 [SWS_Fls_00340] 📄 PDF

After initiating a read job, the function Fls_Read shall return with E_OK.

requirement SWS_Fls_00341 [SWS_Fls_00341] 📄 PDF

The function Fls_Compare shall copy the given parameters to Fls module internal variables and initiate a compare job.

requirement SWS_Fls_00342 [SWS_Fls_00342] 📄 PDF

After initiating the compare job, the function Fls_Compare shall set the status to MEMIF_BUSY.

requirement SWS_Fls_00343 [SWS_Fls_00343] 📄 PDF

After initiating the compare job, the function Fls_Compare shall set the job result to MEMIF_JOB_PENDING.

requirement SWS_Fls_00344 [SWS_Fls_00344] 📄 PDF

After initiating the compare job, the function Fls_Compare shall return with E_OK.

requirement SWS_Fls_00345 [SWS_Fls_00345] 📄 PDF

After a read, erase, write or compare job has been finished, the function Fls_MainFunction shall set the FLS module's job result to MEMIF_JOB_ OK if it is currently in state MEMIF_JOB_PENDING. Otherwise, it shall leave the result unchanged.

requirement SWS_Fls_00346 [SWS_Fls_00346] 📄 PDF

After a read, erase, write or compare job has been finished, the function Fls_MainFunction shall set the FLS module's state to MEMIF_IDLE and call the job end notification function if configured (see [ECUC_Fls_00307]).

requirement SWS_Fls_00347 [SWS_Fls_00347] 📄 PDF

The FLS module shall call the callback function Fee_JobEr- rorNotification when the module has finished a job with a negative result: • Read job failed • Write job failed • Erase job failed • Compare job failed

requirement SWS_Fls_00348 [SWS_Fls_00348] 📄 PDF

The FLS module shall call the callback function Fee_JobEr- rorNotification when the module has canceled an ongoing job: • Read job aborted • Write job aborted • Erase job aborted • Compare job aborted

requirement SWS_Fls_00349 [SWS_Fls_00349] 📄 PDF

The FLS module shall call the callback function Fee_JobEr- rorNotification when the module has finished a compare job and the memory blocks differ: • Compare job finished and memory blocks differ

requirement SWS_Fls_00352 [SWS_Fls_00352] 📄 PDF

The table above specifies the parameters that shall be located in an external data structure of type Fls_ConfigType .

requirement SWS_Fls_00353 [SWS_Fls_00353] 📄 PDF

The organization and location of the data structure Fls_Config- Type shall be up to the implementer.

requirement SWS_Fls_00355 [SWS_Fls_00355] 📄 PDF

Hardware or implementation specific parameters can be added to Fls_ConfigType if necessary.

requirement SWS_Fls_00356 [SWS_Fls_00356] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_Cancel shall check that the FLS module has been initialized. If this check fails, the function Fls_Cancel shall raise the development error FLS_E_- UNINIT and return.

requirement SWS_Fls_00358 [SWS_Fls_00358] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_GetJobResult shall check that the FLS module has been initialized. If this check fails, the function Fls_GetJobResult shall raise the development error FLS_E_UNINIT and return with MEMIF_JOB_FAILED.

requirement SWS_Fls_00359 [SWS_Fls_00359] 📄 PDF

If timeout supervision is enabled (compile switch FlsTimeout- SupervisionEnabled set to TRUE): the function Fls_MainFunction shall check, whether the configured maximum erase time (see [ECUC_Fls_00298] FlsErase- Time ) has been exceeded. If this is the case, the function Fls_MainFunction shall raise the runtime error FLS_E_TIMEOUT .

requirement SWS_Fls_00360 [SWS_Fls_00360] 📄 PDF

If timeout supervision is enabled (compile switch FlsTimeout- SupervisionEnabled set to TRUE): the function Fls_MainFunction shall check, whether the expected maximum write time (see note below) has been exceeded. If this is the case, the function Fls_MainFunction shall raise the runtime error FLS_E_- TIMEOUT .

requirement SWS_Fls_00361 [SWS_Fls_00361] 📄 PDF

The runtime error code FLS_E_TIMEOUT shall be reported when the timeout supervision function is enabled (by the compile switch FlsTimeoutSu- pervisionEnabled ) and the timeout supervision of a read, write, erase or compare job (in hardware) failed.

requirement SWS_Fls_00362 [SWS_Fls_00362] 📄 PDF

If timeout supervision is enabled (compile switch FlsTimeout- SupervisionEnabled set to TRUE): the function Fls_MainFunction shall check, whether the expected maximum read / compare time (see note below) has been ex- ceeded. If this is the case, the function Fls_MainFunction shall raise the runtime error FLS_E_TIMEOUT .

requirement SWS_Fls_00363 [SWS_Fls_00363] 📄 PDF

If development error detection for the module Fls is enabled: the function Fls_GetVersionInfo shall raise the development error FLS_E_PARAM_- POINTER if the argument is a NULL pointer and return without any action.

requirement SWS_Fls_00373 [SWS_Fls_00373] 📄 PDF

The function Fls_BlankCheck shall verify, whether a given mem- ory area has been erased but not (yet) re-programmed.

requirement SWS_Fls_00374 [SWS_Fls_00374] 📄 PDF

The function Fls_BlankCheck shall copy the given parameters to FLS module internal variables and initiate the verification job.

requirement SWS_Fls_00375 [SWS_Fls_00375] 📄 PDF

After initiating the verification job, the function Fls_BlankCheck shall set the FLS module status to MEMIF_BUSY.

requirement SWS_Fls_00376 [SWS_Fls_00376] 📄 PDF

After initiating the verification job, the function Fls_BlankCheck shall set the FLS module job result to MEMIF_JOB_PENDING.

requirement SWS_Fls_00377 [SWS_Fls_00377] 📄 PDF

After initiating the verification job, the function Fls_BlankCheck shall return with E_OK.

requirement SWS_Fls_00378 [SWS_Fls_00378] 📄 PDF

The FLS module shall execute the verification job of the function Fls_BlankCheck asynchronously within the FLS module's main function.

requirement SWS_Fls_00379 [SWS_Fls_00379] 📄 PDF

The verification job of the function Fls_BlankCheck shall check, that the continuous flash memory area starting from the flash memory base address + TargetAddress of size Length is erased.

requirement SWS_Fls_00380 [SWS_Fls_00380] 📄 PDF

If development error detection for the module FLS is enabled; the function Fls_BlankCheck shall check that the verification start address (flash mem- ory base address + TargetAddress ) lies within the specified lower and upper flash address boundaries. If this check fails, the function Fls_BlankCheck shall reject the verification job, raise the development error FLS_E_PARAM_ADDRESS and return with E_NOT_OK.

requirement SWS_Fls_00381 [SWS_Fls_00381] 📄 PDF

If development error detection for the module FLS is enabled: the function Fls_BlankCheck shall check that the given length is greater than 0 and that the verification end address (verification start address + length) lies within the specified upper flash address boundary. If this check fails, the function Fls_BlankCheck shall reject the verification job, raise the development error FLS_E_PARAM_LENGTH and return with E_NOT_OK.

requirement SWS_Fls_00382 [SWS_Fls_00382] 📄 PDF

If development error detection for the module FLS is enabled: the function Fls_BlankCheck shall check that the driver has been initialized. If this check fails, the function Fls_BlankCheck shall reject the verification request, raise the de- velopment error FLS_E_UNINIT and return with E_NOT_OK.

requirement SWS_Fls_00383 [SWS_Fls_00383] 📄 PDF

If runtime error detection for the module FLS is enabled: the func- tion Fls_BlankCheck shall check that the driver is currently not busy. If this check fails, the function Fls_BlankCheck shall reject the verification request, raise the de- velopment error FLS_E_BUSY and return with E_NOT_OK.

requirement SWS_Fls_00385 [SWS_Fls_00385] 📄 PDF

If the underlying flash technology requires a certain alignment of the read address or length information and if the address and/or length parameter for a read or compare Job are not correctly aligned, the function Fls_MainFunction shall internally compensate for this missing alignment, that is the function Fls_Main- Function shall provide byte-wise read access to the flash memory, regardless of any alignment restrictions imposed by the Hardware.

requirement SWS_Fls_00389 [SWS_Fls_00389] 📄 PDF

The FLS module shall handle data buffer alignment internally. In- stead of imposing any requirements on RAM buffers' alignments (as they are uint8*), it shall handle passed pointers as being just byte-aligned.

requirement SWS_Fls_00390 [SWS_Fls_00390] 📄 PDF

If more than one instance of the flash driver is used in an ECU, the individual instances have to be given a unique instance ID. This instance ID shall be configured as the parameter FlsDriverIndex . If only one instance of the flash driver is used in an ECU, this instance shall have the parameter FlsDriverIndex configured as 0.

requirement SWS_Fls_91001 [SWS_Fls_91001] 📄 PDF

Type of error Related error code Error value API service called while driver still busy FLS_E_BUSY 0x06 Erase verification (blank check) failed FLS_E_VERIFY_ERASE_FAILED 0x07 Write verification (compare) failed FLS_E_VERIFY_WRITE_FAILED 0x08 Timeout exceeded FLS_E_TIMEOUT 0x09

requirement SWS_Fls_91002 [SWS_Fls_91002] 📄 PDF

Type of error Related error code Error value Flash erase failed (HW) FLS_E_ERASE_FAILED 0x01 Flash write failed (HW) FLS_E_WRITE_FAILED 0x02 Flash read failed (HW) FLS_E_READ_FAILED 0x03 Flash compare failed (HW) FLS_E_COMPARE_FAILED 0x04 Expected hardware ID not matched (see SWS_ Fls_00144) FLS_E_UNEXPECTED_FLASH_ID 0x05

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

Record
AUTOSAR/AP/record/CP_MOD_Fls
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Fls@rel:R20-11#776ae103
Content hash
776ae103
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_FlashDriver.pdf#nameddest=SWS_Fls_00249

Themenkarte

Initialisierung und Status

3

Anforderungen

161
SWS_Fls_00001SWS_Fls_00002SWS_Fls_00003SWS_Fls_00004SWS_Fls_00014SWS_Fls_00015SWS_Fls_00020SWS_Fls_00021SWS_Fls_00022SWS_Fls_00023SWS_Fls_00026SWS_Fls_00027SWS_Fls_00030SWS_Fls_00033SWS_Fls_00034SWS_Fls_00035SWS_Fls_00036SWS_Fls_00037SWS_Fls_00038SWS_Fls_00039SWS_Fls_00040SWS_Fls_00048SWS_Fls_00055SWS_Fls_00056SWS_Fls_00065SWS_Fls_00066SWS_Fls_00086SWS_Fls_00088SWS_Fls_00097SWS_Fls_00098SWS_Fls_00099SWS_Fls_00100SWS_Fls_00104SWS_Fls_00105SWS_Fls_00106SWS_Fls_00110SWS_Fls_00137SWS_Fls_00140SWS_Fls_00141SWS_Fls_00143SWS_Fls_00144SWS_Fls_00145SWS_Fls_00146SWS_Fls_00147SWS_Fls_00150SWS_Fls_00151SWS_Fls_00152SWS_Fls_00153SWS_Fls_00154SWS_Fls_00155SWS_Fls_00156SWS_Fls_00157SWS_Fls_00158SWS_Fls_00167SWS_Fls_00183SWS_Fls_00184SWS_Fls_00185SWS_Fls_00186SWS_Fls_00187SWS_Fls_00191SWS_Fls_00193SWS_Fls_00196SWS_Fls_00200SWS_Fls_00205SWS_Fls_00206SWS_Fls_00208SWS_Fls_00209SWS_Fls_00211SWS_Fls_00212SWS_Fls_00213SWS_Fls_00214SWS_Fls_00215SWS_Fls_00216SWS_Fls_00217SWS_Fls_00218SWS_Fls_00220SWS_Fls_00221SWS_Fls_00223SWS_Fls_00225SWS_Fls_00226SWS_Fls_00229SWS_Fls_00230SWS_Fls_00232SWS_Fls_00233SWS_Fls_00234SWS_Fls_00235SWS_Fls_00236SWS_Fls_00238SWS_Fls_00239SWS_Fls_00240SWS_Fls_00241SWS_Fls_00243SWS_Fls_00244SWS_Fls_00248SWS_Fls_00260SWS_Fls_00261SWS_Fls_00268SWS_Fls_00269SWS_Fls_00272SWS_Fls_00273SWS_Fls_00310SWS_Fls_00312SWS_Fls_00313SWS_Fls_00314SWS_Fls_00315SWS_Fls_00316SWS_Fls_00317SWS_Fls_00318SWS_Fls_00319SWS_Fls_00323SWS_Fls_00324SWS_Fls_00327SWS_Fls_00328SWS_Fls_00329SWS_Fls_00330SWS_Fls_00331SWS_Fls_00332SWS_Fls_00333SWS_Fls_00334SWS_Fls_00335SWS_Fls_00336SWS_Fls_00337SWS_Fls_00338SWS_Fls_00339SWS_Fls_00340SWS_Fls_00341SWS_Fls_00342SWS_Fls_00343SWS_Fls_00344SWS_Fls_00345SWS_Fls_00346SWS_Fls_00347SWS_Fls_00348SWS_Fls_00349SWS_Fls_00352SWS_Fls_00353SWS_Fls_00355SWS_Fls_00356SWS_Fls_00358SWS_Fls_00359SWS_Fls_00360SWS_Fls_00361SWS_Fls_00362SWS_Fls_00363SWS_Fls_00373SWS_Fls_00374SWS_Fls_00375SWS_Fls_00376SWS_Fls_00377SWS_Fls_00378SWS_Fls_00379SWS_Fls_00380SWS_Fls_00381SWS_Fls_00382SWS_Fls_00383SWS_Fls_00385SWS_Fls_00389SWS_Fls_00390SWS_Fls_91001SWS_Fls_91002SWS_Fls_NA_00366

Detailansicht

Wähle in der Gliederung einen Eintrag aus.

Initialisierung und Status

Fls_GetStatus function

Returns the driver state.

MemIf_StatusType Fls_GetStatus(void);

Returns the version information of this module.

void Fls_GetVersionInfo(Std_VersionInfoType* VersioninfoPtr);
Fls_Init function

Initializes the Flash Driver.

void Fls_Init(const Fls_ConfigType* ConfigPtr);

Dienste

This callback function is called when a job has been completed with a positive result.

void Fee_JobEndNotification(void);

This callback function is called when a job has been canceled or finished with negative result.

void Fee_JobErrorNotification(void);

The function Fls_BlankCheck shall verify, whether a given memory area has been erased but not (yet) programmed. The function shall limit the maximum number of checked flash cells per main function cycle to the configured value FlsMaxReadNormalMode or FlsMaxReadFastMode respectively.

Std_ReturnType Fls_BlankCheck(Fls_AddressType TargetAddress, Fls_LengthType Length);
Fls_Cancel function

Cancels an ongoing job.

void Fls_Cancel(void);
Fls_Compare function

Compares the contents of an area of flash memory with that of an application data buffer.

Std_ReturnType Fls_Compare(Fls_AddressType SourceAddress, const uint8* TargetAddressPtr, Fls_LengthType Length);
Fls_Erase function

Erases flash sector(s).

Std_ReturnType Fls_Erase(Fls_AddressType TargetAddress, Fls_LengthType Length);

Returns the result of the last job.

MemIf_JobResultType Fls_GetJobResult(void);
Fls_Read function

Reads from flash memory.

Std_ReturnType Fls_Read(Fls_AddressType SourceAddress, uint8* TargetAddressPtr, Fls_LengthType Length);
Fls_SetMode function

Sets the flash driver's operation mode.

void Fls_SetMode(MemIf_ModeType Mode);
Fls_Write function

Writes one or more complete flash pages.

Std_ReturnType Fls_Write(Fls_AddressType TargetAddress, const uint8* SourceAddressPtr, Fls_LengthType Length);

Zyklisch

Performs the processing of jobs.

void Fls_MainFunction(void);

Typen

Used as address offset from the configured flash base address to access a certain flash memory area.

A pointer to such a structure is provided to the flash driver initialization routine for configuration of the driver and flash memory hardware.

Specifies the number of bytes to read/write/erase/compare.

Anforderungen

SWS_Fls_00001 requirement

The FLS module shall offer asynchronous services for operations on flash memory (read/erase/write).

SWS_Fls_00002 requirement

The FLS module shall not buffer data. The FLS module shall use application data buffers that are referenced by a pointer passed via the API.

SWS_Fls_00003 requirement

The FLS module shall not ensure data consistency of the given application buffer.

SWS_Fls_00004 requirement

Type of error Related error code Error value API service called with wrong parameter FLS_E_PARAM_CONFIG 0x01 API service called with wrong parameter FLS_E_PARAM_ADDRESS 0x02 API service called with wrong parameter FLS_E_PARAM_LENGTH 0x03 API service called with wrong parameter FLS_E_PARAM_DATA 0x04 API service called without module initialization FLS_E_UNINIT 0x05 API service called with NULL pointer FLS_E_PARAM_POINTER 0x0a – FLS_E_ALREADY_INITIALIZED 0x0b

SWS_Fls_00014 requirement

The function Fls_Init shall initialize the FLS module (software) and all flash memory relevant registers (hardware) with parameters provided in the given configuration set.

SWS_Fls_00015 requirement

If development error detection for the module Fls is enabled: the function Fls_Init shall check the (hardware specific) contents of the given configu- ration set for being within the allowed range. If this is not the case, it shall raise the development error FLS_E_PARAM_CONFIG .

SWS_Fls_00020 requirement

If development error detection for the module Fls is enabled: the function Fls_Erase shall check that the erase start address (flash memory base ad- dress + TargetAddress ) is aligned to a flash sector boundary and that it lies within the specified lower and upper flash address boundaries. If this check fails, the func- tion Fls_Erase shall reject the erase request, raise the development error FLS_E_- PARAM_ADDRESS and return with E_NOT_OK.

SWS_Fls_00021 requirement

If development error detection for the module Fls is enabled: the function Fls_Erase shall check that the erase length is greater than 0 and that the erase end address (erase start address + length) is aligned to a flash sector boundary and that it lies within the specified upper flash address boundary. If this check fails, the function Fls_Erase shall reject the erase request, raise the development error FLS_E_PARAM_LENGTH and return with E_NOT_OK.

SWS_Fls_00022 requirement

If erase verification is enabled (compile switch FlsEraseVer- ificationEnabled set to TRUE): After a flash block has been erased, the func- tion Fls_MainFunction shall compare the contents of the addressed memory area against the value of an erased flash cell to check that the block has been completely erased. If this check fails, the function Fls_MainFunction shall set the FLS mod- ule's job result to MEMIF_JOB_FAILED and raise the runtime error FLS_E_VERIFY_- ERASE_FAILED .

SWS_Fls_00023 requirement

If runtime error detection for the module Fls is enabled: the func- tion Fls_Erase shall check that the FLS module is currently not busy. If this check fails, the function Fls_Erase shall reject the erase request, raise the development error FLS_E_BUSY and return with E_NOT_OK.

SWS_Fls_00026 requirement

If development error detection for the module Fls is enabled: the function Fls_Write shall check that the write start address (flash memory base ad- dress + TargetAddress ) is aligned to a flash page boundary and that it lies within the specified lower and upper flash address boundaries. If this check fails, the func- tion Fls_Write shall reject the write request, raise the development error FLS_E_- PARAM_ADDRESS and return with E_NOT_OK.

SWS_Fls_00027 requirement

If development error detection for the module Fls is enabled: the function Fls_Write shall check that the write length is greater than 0, that the write end address (write start address + length) is aligned to a flash page boundary and that it lies within the specified upper flash address boundary. If this check fails, the func- tion Fls_Write shall reject the write request, raise the development error FLS_E_- PARAM_LENGTH and return with E_NOT_OK.

SWS_Fls_00030 requirement

If runtime error detection for the module Fls is enabled: the func- tion Fls_Write shall check that the FLS module is currently not busy. If this check fails, the function Fls_Write shall reject the write request, raise the development error FLS_E_BUSY and return with E_NOT_OK.

SWS_Fls_00033 requirement

The function Fls_Cancel shall set the job result to MEMIF_JOB_ CANCELED if the job result currently has the value MEMIF_JOB_PENDING. Other- wise the function Fls_Cancel shall leave the job result unchanged.

SWS_Fls_00034 requirement

The function Fls_GetStatus shall return the FLS module state synchronously.

SWS_Fls_00035 requirement

The function Fls_GetJobResult shall return the result of the last job synchronously

SWS_Fls_00036 requirement

The erase, write, read and compare functions shall share the same job result, i.e. only the result of the last job can be queried. The FLS module shall overwrite the job result with MEMIF_JOB_PENDING if the FLS module has accepted a new job.

SWS_Fls_00037 requirement

The function Fls_MainFunction shall perform the processing of the flash read, write, erase and compare jobs.

SWS_Fls_00038 requirement

When a job has been initiated, the FLS module's environment shall call the function Fls_MainFunction cyclically until the job is finished.

SWS_Fls_00039 requirement

The function Fls_MainFunction shall return without any action if no job is pending.

SWS_Fls_00040 requirement

The function Fls_MainFunction shall only process as much data in one call cycle as statically configured for the current job type (read, write or compare) and the current FLS module's operating mode (normal, fast).

SWS_Fls_00048 requirement

If supported by hardware, the function Fls_Init shall set the flash memory erase/write protection as provided in the configuration set.

SWS_Fls_00055 requirement

If erase verification is enabled (compile switch FlsEraseVer- ificationEnabled set to TRUE): Before writing a flash block, the function Fls_- MainFunction shall compare the contents of the addressed memory area against the value of an erased flash cell to check that the block has been completely erased. If this check fails, the function Fls_MainFunction shall set the FLS module's job result to MEMIF_JOB_FAILED and raise the runtime error FLS_E_VERIFY_ERASE_FAILED .

SWS_Fls_00056 requirement

If write verification is enabled (compile switch FlsWriteVerifi- cationEnabled set to TRUE): After writing a flash block, the function Fls_Main- Function shall compare the contents of the reprogrammed memory area against the contents of the provided application buffer to check that the block has been completely reprogrammed. If this check fails, the function Fls_MainFunction shall set the FLS module's job result to MEMIF_JOB_FAILED and raise the runtime error FLS_E_VER- IFY_WRITE_FAILED .

SWS_Fls_00065 requirement

If development error detection for the module Fls is enabled: the function Fls_Erase shall check that the FLS module has been initialized. If this check fails, the function Fls_Erase shall reject the erase request, raise the development error FLS_E_UNINIT and return with E_NOT_OK.

SWS_Fls_00066 requirement

If development error detection for the module Fls is enabled: the function Fls_Write shall check that the FLS module has been initialized. If this check fails, the function Fls_Write shall reject the write request, raise the development error FLS_E_UNINIT and return with E_NOT_OK.

SWS_Fls_00086 requirement

The function Fls_Init shall initialize all FLS module global vari- ables and those controller registers that are needed for controlling the flash device and that do not influence or depend on other (hardware) modules. Registers that can in- fluence or depend on other modules shall be initialized by a common system module.

SWS_Fls_00088 requirement

The functional requirements [2] and the functional scope are the same for both internal and external drivers. Hence the API is semantically identical.

SWS_Fls_00097 requirement

If development error detection for the module Fls is enabled: the function Fls_Read shall check that the read start address (flash memory base address + SourceAddress ) lies within the specified lower and upper flash address bound- aries. If this check fails, the function Fls_Read shall reject the read job, raise de- velopment error FLS_E_PARAM_ADDRESS and return with E_NOT_OK.

SWS_Fls_00098 requirement

If development error detection for the module Fls is enabled: the function Fls_Read shall check that the read length is greater than 0 and that the read end address (read start address + length) lies within the specified upper flash address boundary. If this check fails, the function Fls_Read shall reject the read job, raise the development error FLS_E_PARAM_LENGTH and return with E_NOT_OK.

SWS_Fls_00099 requirement

If development error detection for the module Fls is enabled: the function Fls_Read shall check that the driver has been initialized. If this check fails, the function Fls_Read shall reject the read request, raise the development error FLS_- E_UNINIT and return with E_NOT_OK.

SWS_Fls_00100 requirement

If runtime error detection for the module Fls is enabled: the func- tion Fls_Read shall check that the driver is currently not busy. If this check fails, the function Fls_Read shall reject the read request, raise the development error FLS_- E_BUSY and return with E_NOT_OK.

SWS_Fls_00104 requirement

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_ERASE_FAILED to the DET if a flash erase job fails due to a hardware error.

SWS_Fls_00105 requirement

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_WRITE_FAILED to the DET if a flash write job fails due to a hardware error.

SWS_Fls_00106 requirement

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_READ_FAILED to the DET if a flash read job fails due to a hardware error.

SWS_Fls_00110 requirement

The callback notifications shall have no parameters and no return value.

SWS_Fls_00137 requirement

The FLS module's implementer shall place the code of the flash access routines into a separate C-module Fls_ac.c.

SWS_Fls_00140 requirement

The FLS module's erase routine shall load the flash access code for erasing the flash memory to the location in RAM pointed to by the erase function pointer contained in the flash drivers configuration set if the FLS module is configured to load the flash access code to RAM on job start.

SWS_Fls_00141 requirement

The FLS module's write routine shall load the flash access code for writing the flash memory to the location in RAM pointed to by the write function pointer contained in the flash drivers configuration set if the FLS module is configured to load the flash access code to RAM on job start.

SWS_Fls_00143 requirement

After an erase or write job has been finished or canceled, the FLS module's main processing routine shall unload (i.e. overwrite) the flash access code (internal erase / write routines) from RAM if they have been loaded to RAM by the flash driver.

SWS_Fls_00144 requirement

During the initialization of the external flash driver, the FLS module shall check the hardware ID of the external flash device against the corresponding published parameter. If a hardware ID mismatch occurs, the FLS module shall report the error code FLS_E_UNEXPECTED_FLASH_ID to the Default Error Tracer (DET), set the FLS module status to FLS_E_UNINIT and shall not initialize itself.

SWS_Fls_00145 requirement

If possible, e.g. with interrupt controlled implementations, the FLS module shall start the first round of the erase job directly within the function Fls_- Erase to reduce overall runtime.

SWS_Fls_00146 requirement

If possible, e.g. with interrupt controlled implementations, the FLS module shall start the first round of the write job directly within the function Fls_Write to reduce overall runtime.

SWS_Fls_00147 requirement

If configured, the function Fls_Cancel shall call the error notifi- cation function to inform the caller about the cancellation of a job.

SWS_Fls_00150 requirement

If development error detection for the module Fls is enabled: the function Fls_Compare shall check that the compare start address (flash memory base address + SourceAddress ) lies within the specified lower and upper flash address boundaries. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_PARAM_ADDRESS and return with E_NOT_OK.

SWS_Fls_00151 requirement

If If development error detection for the module Fls is enabled: the function Fls_Compare shall check that the given length is greater than 0 and that the compare end address (compare start address + length) lies within the specified upper flash address boundary. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_PARAM_LENGTH and return with E_ NOT_OK.

SWS_Fls_00152 requirement

If development error detection for the module Fls is enabled: the function Fls_Compare shall check that the driver has been initialized. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_UNINIT and return with E_NOT_OK.

SWS_Fls_00153 requirement

If runtime error detection for the module Fls is enabled: the func- tion Fls_Compare shall check that the driver is currently not busy. If this check fails, the function Fls_Compare shall reject the compare job, raise the development error FLS_E_BUSY and return with E_NOT_OK.

SWS_Fls_00154 requirement

The function Fls_MainFunction shall set the job result to MEMIF_JOB_FAILED and report the error code FLS_E_COMPARE_FAILED to the DET if a flash compare job fails due to a hardware error.

SWS_Fls_00155 requirement

The function Fls_SetMode shall set the FLS module's operation mode to the given "Mode" parameter.

SWS_Fls_00156 requirement

If runtime error detection for the module Fls is enabled: the func- tion Fls_SetMode shall check that the FLS module is currently not busy. If this check fails, the function Fls_SetMode shall reject the set mode request and raise the devel- opment error code FLS_E_BUSY .

SWS_Fls_00157 requirement

If development error detection for the module Fls is enabled: the function Fls_Write shall check the given data buffer pointer for not being a null pointer. If the data buffer pointer is a null pointer, the function Fls_Write shall re- ject the write request, raise the development error FLS_E_PARAM_DATA and return with E_NOT_OK.

SWS_Fls_00158 requirement

If development error detection for the module Fls is enabled: the function Fls_Read shall check the given data buffer pointer for not being a null pointer. If the data buffer pointer is a null pointer, the function Fls_Read shall reject the read request, raise the development error FLS_E_PARAM_DATA and return with E_NOT_ OK.

SWS_Fls_00167 requirement

The FLS module shall call the callback function Fee_JobEndNo- tification when the module has completed a job with a positive result: • Read job finished & OK • Write job finished & OK • Erase job finished & OK • Compare job finished & memory blocks are the same

SWS_Fls_00183 requirement

The function Fls_Cancel shall be pre-compile time configurable On/Off by the configuration parameter FlsCancelApi .

SWS_Fls_00184 requirement

The function Fls_GetStatus shall be pre-compile time config- urable On/Off by the configuration parameter FlsGetStatusApi .

SWS_Fls_00185 requirement

The function Fls_GetJobResult shall be pre-compile time configurable On/Off by the configuration parameter FlsGetJobResultApi .

SWS_Fls_00186 requirement

The function Fls_Compare shall be pre-compile time config- urable On/Off by the configuration parameter FlsCompareApi .

SWS_Fls_00187 requirement

The function Fls_SetMode shall be pre-compile time config- urable On/Off by the configuration parameter FlsSetModeApi .

SWS_Fls_00191 requirement

The function Fls_Init shall store the pointer to the given config- uration set in a variable in order to allow the FLS module access to the configuration set contents during runtime.

SWS_Fls_00193 requirement

Depending on implementation, callback routines provided and/or invoked by the FLS module may be called on interrupt level. The module providing those routines has therefore to make sure that their runtime is reasonably short, i.e. since callbacks may be propagated upward through several software layers.

SWS_Fls_00196 requirement

The function Fls_MainFunction shall at the most issue one sector erase command (to the hardware) in each cycle.

SWS_Fls_00200 requirement

The function Fls_MainFunction shall set the job result to MEMIF_BLOCK_INCONSISTENT if the compared data from a flash compare job are not equal.

SWS_Fls_00205 requirement

The FLS module shall check static configuration parameters stat- ically (at the latest during compile time) for correctness.

SWS_Fls_00206 requirement

The FLS module shall validate the version information in the FLS module header and source files for consistency (e.g. by comparing the version infor- mation in the module header and source files with a pre-processor macro).

SWS_Fls_00208 requirement

The FLS module shall combine all available flash memory areas into one linear address space (denoted by the parameters FlsBaseAddress and FlsTotalSize ).

SWS_Fls_00209 requirement

The FLS module shall map the address and length parameters for the read, write, erase and compare functions as "virtual" addresses to the physical addresses according to the physical structure of the flash memory areas.

SWS_Fls_00211 requirement

The FLS module's implementer shall keep the execution time for the flash access code as short as possible.

SWS_Fls_00212 requirement

The FLS module's main processing routine shall execute the flash access code routines.

SWS_Fls_00213 requirement

The FLS module's main processing routine shall access the flash access code routines by means of the respective function pointer contained in the FLS module's configuration set (post-compile parameters) regardless whether the flash access code routines have been loaded to RAM or whether they can be executed directly from (flash) ROM.

SWS_Fls_00214 requirement

The FLS module shall only load the access code to the RAM if the access code cannot be executed out of flash ROM.

SWS_Fls_00215 requirement

The FLS module's flash access routines shall only disable inter- rupts and wait for the completion of the erase / write command if necessary (that is if it has to be ensured that no other code is executed in the meantime).

SWS_Fls_00216 requirement

The type Fls_AddressType shall have 0 as lower limit for each flash device.

SWS_Fls_00217 requirement

The FLS module shall add a device specific base address to the address type Fls_AddressType if necessary.

SWS_Fls_00218 requirement

The job of the function Fls_Erase shall erase one or more com- plete flash sectors.

SWS_Fls_00220 requirement

The FLS module shall execute the job of the function Fls_Erase asynchronously within the FLS module's main function.

SWS_Fls_00221 requirement

The job of the function Fls_Erase shall erase a flash memory block starting from the flash memory base address + TargetAddress of size Length. Note: Length will be rounded up to the next full sector boundary since only complete flash sectors can be erased.

SWS_Fls_00223 requirement

The job of the function Fls_Write shall write one or more com- plete flash pages to the flash device.

SWS_Fls_00225 requirement

The FLS module shall execute the write job of the function Fls_- Write asynchronously within the FLS module's main function.

SWS_Fls_00226 requirement

The job of the function Fls_Write shall program a flash memory block with data provided via SourceAddressPtr starting from the flash memory base address + TargetAddress of size Length.

SWS_Fls_00229 requirement

The function Fls_Cancel shall cancel an ongoing flash read, write, erase or compare job.

SWS_Fls_00230 requirement

The function Fls_Cancel shall abort a running job synchronously so that directly after returning from this function a new job can be started.

SWS_Fls_00232 requirement

The configuration parameter FlsUseInterrupts shall switch between interrupt and polling controlled job processing if this is supported by the flash memory hardware.

SWS_Fls_00233 requirement

The FLS module's implementer shall locate the interrupt service routine in Fls_Irq.c.

SWS_Fls_00234 requirement

If interrupt controlled job processing is supported and enabled with the configuration parameter FlsUseInterrupts, the interrupt service routine shall reset the interrupt flag, check for errors reported by the underlying hardware, reload the hard- ware finite state machine for the next round of the pending job or call the appropriate notification routine if the job is finished or aborted.

SWS_Fls_00235 requirement

The function Fls_MainFunction shall process jobs without hardware interrupt support (e.g. read jobs).

SWS_Fls_00236 requirement

The function Fls_Read shall read from flash memory.

SWS_Fls_00238 requirement

The FLS module shall execute the read job of the function Fls_Read asynchronously within the FLS module's main function.

SWS_Fls_00239 requirement

The read job of the function Fls_Read shall copy a continuous flash memory block starting from the flash memory base address + SourceAddress of size Length to the buffer pointed to by TargetAddressPtr .

SWS_Fls_00240 requirement

The FLS module's environment shall only call the function Fls_- Read after the FLS module has been initialized.

SWS_Fls_00241 requirement

The function Fls_Compare shall compare the contents of an area of flash memory with that of an application data buffer.

SWS_Fls_00243 requirement

The FLS module shall execute the job of the function Fls_- Compare asynchronously within the FLS module's main function.

SWS_Fls_00244 requirement

The job of the function Fls_Compare shall compare a continuous flash memory block starting from the flash memory base address + SourceAddress of size Length with the buffer pointed to by TargetAddressPtr .

SWS_Fls_00248 requirement

Module Header File Imported Type MemIf.h MemIf_JobResultType (obsolete) MemIf.h MemIf_ModeType (obsolete) MemIf MemIf.h MemIf_StatusType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

SWS_Fls_00260 requirement

Det_ReportRuntimeError Det.h Service to report runtime errors. If a callout has been configured then this callout shall be called.

SWS_Fls_00261 requirement

Det_ReportError Det.h Service to report development errors.

SWS_Fls_00268 requirement

If runtime error detection for the module Fls is enabled: the func- tion Fls_Init shall check module initialization status. If the module has already been initialized, the function Fls_Init shall raise the development error FLS_E_- ALREADY_INITIALIZED .

SWS_Fls_00269 requirement

The Fls module shall provide only one scheduled function. Read- ing from / writing to flash memory cannot usually be done simultaneously and the over- head for synchronizing two scheduled functions would outweigh the benefits.

SWS_Fls_00272 requirement

If timeout supervision is enabled (compile switch FlsTimeoutSu- pervisionEnabled set to TRUE): the function Fls_MainFunction shall provide a timeout monitoring for the currently running job, that is it shall supervise the deadline of the read / compare / erase or write job.

SWS_Fls_00273 requirement

If development error detection for the module Fls is enabled: the function Fls_Compare shall check the given data buffer pointer for not being a null pointer. If the data buffer pointer is a null pointer, the function Fls_Compare shall reject the request, raise the development error FLS_E_PARAM_DATA and return with E_NOT_OK.

SWS_Fls_00310 requirement

The following development error codes shall be reported when an API service is called with a wrong parameter: FLS_E_PARAM_CONFIG , FLS_- E_PARAM_ADDRESS , FLS_E_PARAM_LENGTH , FLS_E_PARAM_DATA .

SWS_Fls_00312 requirement

The runtime error code FLS_E_BUSY shall be reported when an API service is called while the module is still busy.

SWS_Fls_00313 requirement

The runtime error code FLS_E_VERIFY_ERASE_FAILED shall be reported when the erase verification function is enabled (by the com- pile switch FlsEraseVerificationEnabled ) and the erase verification func- tion (blankcheck) failed.

SWS_Fls_00314 requirement

The runtime error code FLS_E_VERIFY_WRITE_FAILED shall be reported when the write verification function is enabled (by the compile switch FlsWriteVerificationEnabled ) and the write verification function (com- pare) failed.

SWS_Fls_00315 requirement

The transient fault code FLS_E_ERASE_FAILED shall be reported when the flash erase function failed (in hardware).

SWS_Fls_00316 requirement

The transient fault code FLS_E_WRITE_FAILED shall be reported when the flash write function failed (in hardware).

SWS_Fls_00317 requirement

The transient fault code FLS_E_READ_FAILED shall be reported when the flash read function failed (in hardware).

SWS_Fls_00318 requirement

The transient fault code FLS_E_COMPARE_FAILED shall be re- ported when the flash compare function failed (in hardware).

SWS_Fls_00319 requirement

The transient fault code FLS_E_UNEXPECTED_FLASH_ID shall be reported when the expected flash ID is not matched (see [SWS_Fls_00144]).

SWS_Fls_00323 requirement

The function Fls_Init shall set the FLS module state to MEMIF_ IDLE after having finished the FLS module initialization.

SWS_Fls_00324 requirement

The function Fls_Init shall set the flash job result to MEMIF_ JOB_OK after having finished the FLS module initialization.

SWS_Fls_00327 requirement

The function Fls_Erase shall copy the given parameters to FLS module internal variables and initiate an erase job.

SWS_Fls_00328 requirement

After initiating the erase job, the function Fls_Erase shall set the FLS module status to MEMIF_BUSY.

SWS_Fls_00329 requirement

After initiating the erase job, the function Fls_Erase shall set the job result to MEMIF_JOB_PENDING.

SWS_Fls_00330 requirement

After initiating the erase job, the function Fls_Erase shall return with E_OK.

SWS_Fls_00331 requirement

The function Fls_Write shall copy the given parameters to Fls module internal variables and initiate a write job.

SWS_Fls_00332 requirement

After initiating the write job, the function Fls_Write shall set the FLS module status to MEMIF_BUSY.

SWS_Fls_00333 requirement

After initiating the write job, the function Fls_Write shall set the job result to MEMIF_JOB_PENDING.

SWS_Fls_00334 requirement

After initiating the write job, the function Fls_Write shall return with E_OK.

SWS_Fls_00335 requirement

The function Fls_Cancel shall reset the FLS module's internal job processing variables (like address, length and data pointer).

SWS_Fls_00336 requirement

The function Fls_Cancel shall set the FLS module state to MEMIF_IDLE.

SWS_Fls_00337 requirement

The function Fls_Read shall copy the given parameters to FLS module internal variables and initiate a read job.

SWS_Fls_00338 requirement

After initiating a read job, the function Fls_Read shall set the FLS module status to MEMIF_BUSY.

SWS_Fls_00339 requirement

After initiating a read job, the function Fls_Read shall set the FLS module job result to MEMIF_JOB_PENDING.

SWS_Fls_00340 requirement

After initiating a read job, the function Fls_Read shall return with E_OK.

SWS_Fls_00341 requirement

The function Fls_Compare shall copy the given parameters to Fls module internal variables and initiate a compare job.

SWS_Fls_00342 requirement

After initiating the compare job, the function Fls_Compare shall set the status to MEMIF_BUSY.

SWS_Fls_00343 requirement

After initiating the compare job, the function Fls_Compare shall set the job result to MEMIF_JOB_PENDING.

SWS_Fls_00344 requirement

After initiating the compare job, the function Fls_Compare shall return with E_OK.

SWS_Fls_00345 requirement

After a read, erase, write or compare job has been finished, the function Fls_MainFunction shall set the FLS module's job result to MEMIF_JOB_ OK if it is currently in state MEMIF_JOB_PENDING. Otherwise, it shall leave the result unchanged.

SWS_Fls_00346 requirement

After a read, erase, write or compare job has been finished, the function Fls_MainFunction shall set the FLS module's state to MEMIF_IDLE and call the job end notification function if configured (see [ECUC_Fls_00307]).

SWS_Fls_00347 requirement

The FLS module shall call the callback function Fee_JobEr- rorNotification when the module has finished a job with a negative result: • Read job failed • Write job failed • Erase job failed • Compare job failed

SWS_Fls_00348 requirement

The FLS module shall call the callback function Fee_JobEr- rorNotification when the module has canceled an ongoing job: • Read job aborted • Write job aborted • Erase job aborted • Compare job aborted

SWS_Fls_00349 requirement

The FLS module shall call the callback function Fee_JobEr- rorNotification when the module has finished a compare job and the memory blocks differ: • Compare job finished and memory blocks differ

SWS_Fls_00352 requirement

The table above specifies the parameters that shall be located in an external data structure of type Fls_ConfigType .

SWS_Fls_00353 requirement

The organization and location of the data structure Fls_Config- Type shall be up to the implementer.

SWS_Fls_00355 requirement

Hardware or implementation specific parameters can be added to Fls_ConfigType if necessary.

SWS_Fls_00356 requirement

If development error detection for the module Fls is enabled: the function Fls_Cancel shall check that the FLS module has been initialized. If this check fails, the function Fls_Cancel shall raise the development error FLS_E_- UNINIT and return.

SWS_Fls_00358 requirement

If development error detection for the module Fls is enabled: the function Fls_GetJobResult shall check that the FLS module has been initialized. If this check fails, the function Fls_GetJobResult shall raise the development error FLS_E_UNINIT and return with MEMIF_JOB_FAILED.

SWS_Fls_00359 requirement

If timeout supervision is enabled (compile switch FlsTimeout- SupervisionEnabled set to TRUE): the function Fls_MainFunction shall check, whether the configured maximum erase time (see [ECUC_Fls_00298] FlsErase- Time ) has been exceeded. If this is the case, the function Fls_MainFunction shall raise the runtime error FLS_E_TIMEOUT .

SWS_Fls_00360 requirement

If timeout supervision is enabled (compile switch FlsTimeout- SupervisionEnabled set to TRUE): the function Fls_MainFunction shall check, whether the expected maximum write time (see note below) has been exceeded. If this is the case, the function Fls_MainFunction shall raise the runtime error FLS_E_- TIMEOUT .

SWS_Fls_00361 requirement

The runtime error code FLS_E_TIMEOUT shall be reported when the timeout supervision function is enabled (by the compile switch FlsTimeoutSu- pervisionEnabled ) and the timeout supervision of a read, write, erase or compare job (in hardware) failed.

SWS_Fls_00362 requirement

If timeout supervision is enabled (compile switch FlsTimeout- SupervisionEnabled set to TRUE): the function Fls_MainFunction shall check, whether the expected maximum read / compare time (see note below) has been ex- ceeded. If this is the case, the function Fls_MainFunction shall raise the runtime error FLS_E_TIMEOUT .

SWS_Fls_00363 requirement

If development error detection for the module Fls is enabled: the function Fls_GetVersionInfo shall raise the development error FLS_E_PARAM_- POINTER if the argument is a NULL pointer and return without any action.

SWS_Fls_00373 requirement

The function Fls_BlankCheck shall verify, whether a given mem- ory area has been erased but not (yet) re-programmed.

SWS_Fls_00374 requirement

The function Fls_BlankCheck shall copy the given parameters to FLS module internal variables and initiate the verification job.

SWS_Fls_00375 requirement

After initiating the verification job, the function Fls_BlankCheck shall set the FLS module status to MEMIF_BUSY.

SWS_Fls_00376 requirement

After initiating the verification job, the function Fls_BlankCheck shall set the FLS module job result to MEMIF_JOB_PENDING.

SWS_Fls_00377 requirement

After initiating the verification job, the function Fls_BlankCheck shall return with E_OK.

SWS_Fls_00378 requirement

The FLS module shall execute the verification job of the function Fls_BlankCheck asynchronously within the FLS module's main function.

SWS_Fls_00379 requirement

The verification job of the function Fls_BlankCheck shall check, that the continuous flash memory area starting from the flash memory base address + TargetAddress of size Length is erased.

SWS_Fls_00380 requirement

If development error detection for the module FLS is enabled; the function Fls_BlankCheck shall check that the verification start address (flash mem- ory base address + TargetAddress ) lies within the specified lower and upper flash address boundaries. If this check fails, the function Fls_BlankCheck shall reject the verification job, raise the development error FLS_E_PARAM_ADDRESS and return with E_NOT_OK.

SWS_Fls_00381 requirement

If development error detection for the module FLS is enabled: the function Fls_BlankCheck shall check that the given length is greater than 0 and that the verification end address (verification start address + length) lies within the specified upper flash address boundary. If this check fails, the function Fls_BlankCheck shall reject the verification job, raise the development error FLS_E_PARAM_LENGTH and return with E_NOT_OK.

SWS_Fls_00382 requirement

If development error detection for the module FLS is enabled: the function Fls_BlankCheck shall check that the driver has been initialized. If this check fails, the function Fls_BlankCheck shall reject the verification request, raise the de- velopment error FLS_E_UNINIT and return with E_NOT_OK.

SWS_Fls_00383 requirement

If runtime error detection for the module FLS is enabled: the func- tion Fls_BlankCheck shall check that the driver is currently not busy. If this check fails, the function Fls_BlankCheck shall reject the verification request, raise the de- velopment error FLS_E_BUSY and return with E_NOT_OK.

SWS_Fls_00385 requirement

If the underlying flash technology requires a certain alignment of the read address or length information and if the address and/or length parameter for a read or compare Job are not correctly aligned, the function Fls_MainFunction shall internally compensate for this missing alignment, that is the function Fls_Main- Function shall provide byte-wise read access to the flash memory, regardless of any alignment restrictions imposed by the Hardware.

SWS_Fls_00389 requirement

The FLS module shall handle data buffer alignment internally. In- stead of imposing any requirements on RAM buffers' alignments (as they are uint8*), it shall handle passed pointers as being just byte-aligned.

SWS_Fls_00390 requirement

If more than one instance of the flash driver is used in an ECU, the individual instances have to be given a unique instance ID. This instance ID shall be configured as the parameter FlsDriverIndex . If only one instance of the flash driver is used in an ECU, this instance shall have the parameter FlsDriverIndex configured as 0.

SWS_Fls_91001 requirement

Type of error Related error code Error value API service called while driver still busy FLS_E_BUSY 0x06 Erase verification (blank check) failed FLS_E_VERIFY_ERASE_FAILED 0x07 Write verification (compare) failed FLS_E_VERIFY_WRITE_FAILED 0x08 Timeout exceeded FLS_E_TIMEOUT 0x09

SWS_Fls_91002 requirement

Type of error Related error code Error value Flash erase failed (HW) FLS_E_ERASE_FAILED 0x01 Flash write failed (HW) FLS_E_WRITE_FAILED 0x02 Flash read failed (HW) FLS_E_READ_FAILED 0x03 Flash compare failed (HW) FLS_E_COMPARE_FAILED 0x04 Expected hardware ID not matched (see SWS_ Fls_00144) FLS_E_UNEXPECTED_FLASH_ID 0x05

SWS_Fls_NA_00366 requirement

These requirements are not applicable to this specifica- tion.