5.3. FLS

More…

5.3.1. Types

Base type

Type Name

Brief

enum

Fls_EraseType

ENUM for erase type names.

typedef uint32

Fls_AddressType

Type of address type.

typedef uint32

Fls_LengthType

Type of length type.

5.3.1.1. enum Fls_EraseType

Enumerator

Value

Description

FLS_SECTOR_ERASE

0U

Erase sector.

FLS_BANK_ERASE

1U

Erase bank.

Brief: ENUM for erase type names.

5.3.1.2. typedef Fls_AddressType

typedef uint32 Fls_AddressType;

Brief: Type of address type.

5.3.1.3. typedef Fls_LengthType

typedef uint32 Fls_LengthType;

Brief: Type of length type.

5.3.2. Structures

Name

Brief

Fls_SectorType

FLS Module Flashable Sectors and pages.

Fls_ConfigType

5.3.3. Defines

Name

Brief

FLS_SW_MAJOR_VERSION

Defines for FLS Driver version used for compatibility checks.

FLS_SW_MINOR_VERSION

Driver Implementation Minor Version.

FLS_SW_PATCH_VERSION

Driver Implementation Patch Version.

FLS_AR_RELEASE_MAJOR_VERSION

Defines for FLS Driver AUTOSAR version used for compatibility checks.

FLS_AR_RELEASE_MINOR_VERSION

AUTOSAR Minor version specification implemented by FLS Driver.

FLS_AR_RELEASE_REVISION_VERSION

AUTOSAR Patch version specification implemented by FLS Driver.

FLS_VENDOR_ID

FLS Driver ID Info.

FLS_MODULE_ID

FLS Driver Module ID.

FLS_INSTANCE_ID

FLS Driver Instance ID.

FLS_BASE_ADDRESS_REQ

FLS_WRITE_ADDRESS_ALIGNMENT

Flash base address requirement.

FLS_E_PARAM_CONFIG

Flash write address alignment.

FLS_E_PARAM_ADDRESS

API service called with wrong parameter.

FLS_E_PARAM_LENGTH

API service called with wrong parameter.

FLS_E_PARAM_DATA

API service called with wrong parameter.

FLS_E_UNINIT

API service used without module initialization.

FLS_E_BUSY

APIs called when module is busy.

FLS_E_PARAM_POINTER

APIs called with a Null Pointer.

FLS_E_PARAM_ALIGNMENT

API service called with wrong parameter.

FLS_E_VERIFY_ERASE_FAILED

Runtime Errors WITH HW.

FLS_E_VERIFY_WRITE_FAILED

APIs serice Write Verification (Compare) failed.

FLS_E_TIMEOUT

APIs Timeout Exceeded.

FLS_E_ERASE_FAILED

TRANSIENT FAULTS WITH HW.

FLS_E_WRITE_FAILED

Flash Write Failed in HW.

FLS_E_READ_FAILED

Flash Read Failed in HW.

FLS_E_COMPARE_FAILED

Flash Compare Failediin HW.

FLS_E_UNEXPECTED_FLASH_ID

Expected HW ID not matched.

FLS_E_BLANK_CHECK_FAILED

Flash Blank Check Failediin HW.

FLS_SID_INIT

The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error.

FLS_SID_ERASE

FLS_Erase() API Service ID.

FLS_SID_WRITE

FLS_Write() API Service ID.

FLS_SID_CANCEL

FLS_Cancel() API Service ID.

FLS_SID_GET_STATUS

FLS_GetStatus() API Service ID.

FLS_SID_GET_JOB_RESULT

Fls_GetJobResult() API Service ID.

FLS_SID_READ

FLS_Read() API Service ID.

FLS_SID_COMPARE

FLS_Compare() API Service ID.

FLS_SID_SET_MODE

FLS_SetMode() API Service ID.

FLS_SID_GET_VERSION_INFO

Fls_GetVersionInfo() API Service ID.

FLS_SID_BLANK_CHECK

FLS_BlankCheck() API Service ID.

FLS_SID_MAIN_FUNCTION

FLS_MainFunction() API Service ID.

5.3.4. Functions

Return type

Function Name

Brief

void

Fls_Init(const Fls_ConfigType * ConfigPtr)

Initializes the Flash Driver.

Std_ReturnType

Fls_Erase(Fls_AddressType TargetAddress, Fls_LengthType Length)

Erases flash sector(s).

Std_ReturnType

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

Writes one or more complete flash pages.

Std_ReturnType

Fls_Read(Fls_AddressType SourceAddress, uint8 * TargetAddressPtr, Fls_LengthType Length)

Reads from flash memory.

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.

Std_ReturnType

Fls_BlankCheck(Fls_AddressType Address, Fls_LengthType Length)

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

MemIf_StatusType

Fls_GetStatus(void )

Returns the driver state.

Std_ReturnType

Fls_GetVersionInfo(Std_VersionInfoType * versioninfo)

Returns the version information of this module.

MemIf_JobResultType

Fls_GetJobResult(void )

Returns the result of the last job.

void

Fls_MainFunction(void )

Performs the processing of jobs.

void

Fls_Cancel(void )

Cancels an ongoing job.

void

Fls_SetMode(MemIf_ModeType Mode)

Sets the flash driver’s operation mode. This is a dummy API which is not supported and added for integration purposes.

uint32

Fls_SetEraseType(Fls_EraseType erasetype)

Sets the parameters required in application, based on the erase type parameter passed to this function while calling from Application.

5.3.4.1. function Fls_Init

void Fls_Init(
    const Fls_ConfigType * ConfigPtr
)

Brief: Initializes the Flash Driver.

Parameters:

  • ConfigPtr : Pointer to flash driver configuration set

Return: None

Precondition: None

Postcondition: None

5.3.4.2. function Fls_Erase

Std_ReturnType Fls_Erase(
    Fls_AddressType TargetAddress,
    Fls_LengthType Length
)

Brief: Erases flash sector(s).

Parameters:

  • TargetAddress Target address in flash memory. This address offset will be added to the flash memory base address.

  • Length - Number of bytes to erase

Returns:

  • E_OK erase command has been accepted

  • E_NOT_OK erase command has not been accepted

Return: return_value

Precondition: Preconditions - Driver not already initialized

Postcondition: Postconditions - Driver in initialized state

5.3.4.3. function Fls_Write

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

Brief: Writes one or more complete flash pages.

Parameters:

  • TargetAddress Target address in flash memory. This address offset will be added to the flash memory base address.

  • SourceAddressPtr Pointer to source address

  • Length - Number of bytes to write

Returns:

  • E_OK write command has been accepted

  • E_NOT_OK write command has not been accepted

Return: Std_ReturnType

Precondition: Preconditions - Driver not already initialized

Postcondition: Postconditions - Driver in initialized state

5.3.4.4. function Fls_Read

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

Brief: Reads from flash memory.

Parameters:

  • SourceAddress Source address

  • Length - Number of bytes to read

  • TargetAddressPtr Pointer to target data buffer

Returns:

  • E_OK read command has been accepted

  • E_NOT_OK read command has not been accepted

Return: Std_ReturnType

Precondition: Preconditions - Driver not already initialized

Postcondition: Postconditions - Driver in initialized state

5.3.4.5. function Fls_Compare

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

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

Parameters:

  • SourceAddress Target address in flash memory. This address offset will be added to the flash memory base address.

  • TargetAddressPtr Pointer to target data buffer

  • Length - Number of bytes to compare

Returns:

  • E_OK compare command has been accepted

  • E_NOT_OK compare command has not been accepted

Return: Std_ReturnType

Precondition: Preconditions - Driver not already initialized

Postcondition: Postconditions - Driver in initialized state

5.3.4.6. function Fls_BlankCheck

Std_ReturnType Fls_BlankCheck(
    Fls_AddressType Address,
    Fls_LengthType Length
)

Brief: The function Fls_BlankCheck shall verify, whether a given memory area has been erased but not (yet) programmed.

Parameters:

  • Address Address in flash memory from which the blank check should be started.

  • Length - Number of bytes to be checked for erase pattern

Returns:

  • E_OK request for blank checking has been accepted by the module

  • E_NOT_OK request for blank checking has not been accepted by the module

Return: Std_ReturnType

Precondition: Preconditions - Driver not already initialized

Postcondition: Postconditions - Driver in initialized state

5.3.4.7. function Fls_GetStatus

MemIf_StatusType Fls_GetStatus(
    void 
)

Brief: Returns the driver state.

Return: MemIf_StatusType

Precondition: Preconditions - Driver not already initialized

Postcondition: Postconditions - Driver in initialized state

5.3.4.8. function Fls_GetVersionInfo

Std_ReturnType Fls_GetVersionInfo(
    Std_VersionInfoType * versioninfo
)

Brief: Returns the version information of this module.

Parameters:

  • versioninfo Pointer to where to store the version information of this module.

Return: None

Precondition: Preconditions - None

Postcondition: Postconditions - None

5.3.4.9. function Fls_GetJobResult

MemIf_JobResultType Fls_GetJobResult(
    void 
)

Brief: Returns the result of the last job.

Return: MemIf_JobResultType

Precondition: Preconditions - None

Postcondition: Postconditions - None

5.3.4.10. function Fls_MainFunction

void Fls_MainFunction(
    void 
)

Brief: Performs the processing of jobs.

Return: None

Precondition: Preconditions - None

Postcondition: Postconditions - None

5.3.4.11. function Fls_Cancel

void Fls_Cancel(
    void 
)

Brief: Cancels an ongoing job.

Return: None

Precondition: Preconditions - None

Postcondition: Postconditions - None

5.3.4.12. function Fls_SetMode

void Fls_SetMode(
    MemIf_ModeType Mode
)

Brief: Sets the flash driver’s operation mode. This is a dummy API which is not supported and added for integration purposes.

Return: None

Precondition: Preconditions - None

Postcondition: Postconditions - None

5.3.4.13. function Fls_SetEraseType

uint32 Fls_SetEraseType(
    Fls_EraseType erasetype
)

Brief: Sets the parameters required in application, based on the erase type parameter passed to this function while calling from Application.

Parameters:

  • erasetype

Return: Sector or bank size

Precondition: Preconditions - None

Postcondition: Postconditions - None

5.3.5. Detailed Description

This files defines FLS MCAL configuration structures