![]() |
MCUSW
|
The flash driver provides services for reading, writing and erasing flash memory.
The Flash Driver implements a standardized interface specified in the AUTOSAR_SWS_FlashDriver document.
Only the following combinations of modes are supported:
Following combinations of modes are not supported:
Sub Modules | |
FLS Configuration | |
FLS Driver ID Info | |
typedef uint32 | Fls_AddressType |
Type of address type. | |
typedef uint32 | Fls_LengthType |
#define | FLS_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID. | |
#define | FLS_MODULE_ID ((uint16) 92U) |
FLS Driver Module ID. | |
#define | FLS_INSTANCE_ID ((uint8) 0U) |
FLS Driver Instance ID. | |
FLS Driver Module SW Version Info | |
Defines for FLS Driver version used for compatibility checks | |
#define | FLS_SW_MAJOR_VERSION (11U) |
Driver Implementation Major Version. | |
#define | FLS_SW_MINOR_VERSION (0U) |
Driver Implementation Minor Version. | |
#define | FLS_SW_PATCH_VERSION (0U) |
Driver Implementation Patch Version. | |
FLS Driver Module AUTOSAR Version Info | |
Defines for FLS Driver AUTOSAR version used for compatibility checks | |
#define | FLS_AR_RELEASE_MAJOR_VERSION (4U) |
AUTOSAR Major version specification implemented by FLS Driver. | |
#define | FLS_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by FLS Driver. | |
#define | FLS_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by FLS Driver. | |
FLS Error Codes | |
Error codes returned by FLS functions | |
#define | FLS_E_PARAM_CONFIG ((uint8) 0x01U) |
API service called with wrong parameter. | |
#define | FLS_E_PARAM_ADDRESS ((uint8) 0x02U) |
API service called with wrong parameter. | |
#define | FLS_E_PARAM_LENGTH ((uint8) 0x03U) |
API service called with wrong parameter. | |
#define | FLS_E_PARAM_DATA ((uint8) 0x04U) |
API service called with wrong parameter. | |
#define | FLS_E_UNINIT ((uint8) 0x05U) |
API service used without module initiali-zation. | |
#define | FLS_E_BUSY ((uint8) 0x06U) |
APIs called when module is busy. | |
#define | FLS_E_PARAM_POINTER ((uint8) 0x0AU) |
APIs called with a Null Pointer. | |
#define | FLS_E_VERIFY_ERASE_FAILED ((uint8) 0x07U) |
APIs service Erase Verification (BlankCheck) failed. | |
#define | FLS_E_VERIFY_WRITE_FAILED ((uint8) 0x08U) |
APIs serice Write Verification (Compare) failed. | |
#define | FLS_E_TIMEOUT ((uint8) 0x09U) |
APIs Timeout Exceeded. | |
#define | FLS_E_ERASE_FAILED ((uint8) 0x01U) |
Flash Erase Failed in HW. | |
#define | FLS_E_WRITE_FAILED ((uint8) 0x02U) |
Flash Write Failed in HW. | |
#define | FLS_E_READ_FAILED ((uint8) 0x03U) |
Flash Read Failed in HW. | |
#define | FLS_E_COMPARE_FAILED ((uint8) 0x04U) |
Flash Compare Failediin HW. | |
#define | FLS_E_UNEXPECTED_FLASH_ID ((uint8) 0x05U) |
Expected HW ID not matched. | |
FLS Service Ids | |
The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error | |
#define | FLS_SID_INIT ((uint8) 0x00U) |
FLS_Init() API Service ID. | |
#define | FLS_SID_ERASE ((uint8) 0x01U) |
FLS_Erase() API Service ID. | |
#define | FLS_SID_WRITE ((uint8) 0x02U) |
FLS_Write() API Service ID. | |
#define | FLS_SID_CANCEL ((uint8) 0x03U) |
FLS_Cancel() API Service ID. | |
#define | FLS_SID_GET_STATUS ((uint8) 0x04U) |
FLS_GetStatus() API Service ID. | |
#define | FLS_SID_GET_JOB_RESULT ((uint8) 0x05U) |
Fls_GetJobResult() API Service ID. | |
#define | FLS_SID_READ ((uint8) 0x07U) |
FLS_Read() API Service ID. | |
#define | FLS_SID_COMPARE ((uint8) 0x08U) |
FLS_Compare() API Service ID. | |
#define | FLS_SID_SET_MODE ((uint8) 0x09U) |
FLS_SetMode() API Service ID. | |
#define | FLS_SID_GET_VERSION_INFO ((uint8) 0x10U) |
Fls_GetVersionInfo() API Service ID. | |
#define | FLS_SID_BLANK_CHECK ((uint8) 0x0AU) |
FLS_BlankCheck() API Service ID. | |
#define | FLS_SID_MAIN_FUNCTION ((uint8) 0x06U) |
FLS_MainFunction() API Service ID. | |
enum | OSPI_xferLines { OSPI_XFER_LINES_SINGLE = 0U , OSPI_XFER_LINES_DUAL , OSPI_XFER_LINES_QUAD , OSPI_XFER_LINES_OCTAL } |
Number of lines used for OSPI read/write transaction. More... | |
void | Fls_SwitchMode (boolean dacEnable, boolean xipEnable) |
Switch Mode of the OSPI Driver Parameters (in) : boolean dacEnable - should DAC mode be enaled or disabled Parameters (in) : boolean xipEnable - should XIP mode be enaled or disabled Mode : Supervisor Mode (Privileged Mode) | |
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) |
This service 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. | |
#define FLS_SW_MAJOR_VERSION (11U) |
Driver Implementation Major Version.
#define FLS_SW_MINOR_VERSION (0U) |
Driver Implementation Minor Version.
#define FLS_SW_PATCH_VERSION (0U) |
Driver Implementation Patch Version.
#define FLS_AR_RELEASE_MAJOR_VERSION (4U) |
AUTOSAR Major version specification implemented by FLS Driver.
#define FLS_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by FLS Driver.
#define FLS_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by FLS Driver.
#define FLS_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID.
#define FLS_MODULE_ID ((uint16) 92U) |
FLS Driver Module ID.
#define FLS_INSTANCE_ID ((uint8) 0U) |
FLS Driver Instance ID.
#define FLS_E_PARAM_CONFIG ((uint8) 0x01U) |
API service called with wrong parameter.
#define FLS_E_PARAM_ADDRESS ((uint8) 0x02U) |
API service called with wrong parameter.
#define FLS_E_PARAM_LENGTH ((uint8) 0x03U) |
API service called with wrong parameter.
#define FLS_E_PARAM_DATA ((uint8) 0x04U) |
API service called with wrong parameter.
#define FLS_E_UNINIT ((uint8) 0x05U) |
API service used without module initiali-zation.
#define FLS_E_BUSY ((uint8) 0x06U) |
APIs called when module is busy.
#define FLS_E_PARAM_POINTER ((uint8) 0x0AU) |
APIs called with a Null Pointer.
#define FLS_E_VERIFY_ERASE_FAILED ((uint8) 0x07U) |
APIs service Erase Verification (BlankCheck) failed.
#define FLS_E_VERIFY_WRITE_FAILED ((uint8) 0x08U) |
APIs serice Write Verification (Compare) failed.
#define FLS_E_TIMEOUT ((uint8) 0x09U) |
APIs Timeout Exceeded.
#define FLS_E_ERASE_FAILED ((uint8) 0x01U) |
Flash Erase Failed in HW.
#define FLS_E_WRITE_FAILED ((uint8) 0x02U) |
Flash Write Failed in HW.
#define FLS_E_READ_FAILED ((uint8) 0x03U) |
Flash Read Failed in HW.
#define FLS_E_COMPARE_FAILED ((uint8) 0x04U) |
Flash Compare Failediin HW.
#define FLS_E_UNEXPECTED_FLASH_ID ((uint8) 0x05U) |
Expected HW ID not matched.
#define FLS_SID_INIT ((uint8) 0x00U) |
FLS_Init() API Service ID.
#define FLS_SID_ERASE ((uint8) 0x01U) |
FLS_Erase() API Service ID.
#define FLS_SID_WRITE ((uint8) 0x02U) |
FLS_Write() API Service ID.
#define FLS_SID_CANCEL ((uint8) 0x03U) |
FLS_Cancel() API Service ID.
#define FLS_SID_GET_STATUS ((uint8) 0x04U) |
FLS_GetStatus() API Service ID.
#define FLS_SID_GET_JOB_RESULT ((uint8) 0x05U) |
Fls_GetJobResult() API Service ID.
#define FLS_SID_READ ((uint8) 0x07U) |
FLS_Read() API Service ID.
#define FLS_SID_COMPARE ((uint8) 0x08U) |
FLS_Compare() API Service ID.
#define FLS_SID_SET_MODE ((uint8) 0x09U) |
FLS_SetMode() API Service ID.
#define FLS_SID_GET_VERSION_INFO ((uint8) 0x10U) |
Fls_GetVersionInfo() API Service ID.
#define FLS_SID_BLANK_CHECK ((uint8) 0x0AU) |
FLS_BlankCheck() API Service ID.
#define FLS_SID_MAIN_FUNCTION ((uint8) 0x06U) |
FLS_MainFunction() API Service ID.
typedef uint32 Fls_AddressType |
Type of address type.
typedef uint32 Fls_LengthType |
enum OSPI_xferLines |
void Fls_SwitchMode | ( | boolean | dacEnable, |
boolean | xipEnable ) |
Switch Mode of the OSPI Driver Parameters (in) : boolean dacEnable - should DAC mode be enaled or disabled Parameters (in) : boolean xipEnable - should XIP mode be enaled or disabled Mode : Supervisor Mode (Privileged Mode)
void Fls_Init | ( | const Fls_ConfigType * | ConfigPtr | ) |
Initializes the Flash Driver.
* Service name : Fls_Init * Syntax : void Fls_Init( const Fls_ConfigType* ConfigPtr ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x00 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : ConfigPtr - Pointer to flash driver configuration set * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Initializes the Flash Driver *
Std_ReturnType Fls_Erase | ( | Fls_AddressType | TargetAddress, |
Fls_LengthType | Length ) |
Erases flash sector(s).
* Service name : Fls_Erase * Syntax : Std_ReturnType Fls_Erase(Fls_AddressType TargetAddress * ,Fls_LengthType Length) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x01 * Sync/Async : Asynchronous * Reentrancy : Non Reentrant * Parameters (in) : TargetAddress - Target address in flash memory. * This address offset will be added to the flash memory * base address. * Length - Number of bytes to erase * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType - * E_OK: erase command has been accepted * E_NOT_OK: erase command has not been accepted * Description : Erases flash sector(s). *
Std_ReturnType Fls_Write | ( | Fls_AddressType | TargetAddress, |
const uint8 * | SourceAddressPtr, | ||
Fls_LengthType | Length ) |
Writes one or more complete flash pages.
* Service name : Fls_Write * Syntax : Std_ReturnType Fls_Write(Fls_AddressType TargetAddress * ,const uint8* SourceAddressPtr, * Fls_LengthType Length) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x02 * Sync/Async : Asynchronous * Reentrancy : Non Reentrant * Parameters (in) : TargetAddress - Target address in flash memory. * This address offset will be added to the flash memory * base address. * SourceAddressPtr - Pointer to source data buffer * Length - Number of bytes to erase * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType - * E_OK: write command has been accepted * E_NOT_OK: write command has not been accepted * Description : Writes one or more complete flash pages. *
Std_ReturnType Fls_Read | ( | Fls_AddressType | SourceAddress, |
uint8 * | TargetAddressPtr, | ||
Fls_LengthType | Length ) |
Reads from flash memory..
* Service name : Fls_Read * Syntax : Std_ReturnType Fls_Read((Fls_AddressType SourceAddress * ,const uint8* TargetAddressPtr, * Fls_LengthType Length) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x07 * Sync/Async : Asynchronous * Reentrancy : Non Reentrant * Parameters (in) : SourceAddress - source address in flash memory. * This address offset will be added to the flash memory * base address. * TargetAddressPtr - Pointer to source data buffer * Length - Number of bytes to erase * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType - * E_OK: read command has been accepted * E_NOT_OK: read command has not been accepted * Description : 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.
* Service name : Fls_Compare * Syntax : Std_ReturnType Fls_Compare * (Fls_AddressType SourceAddress, * const uint8* TargetAddressPtr, * Fls_LengthType Length) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x08 * Sync/Async : Asynchronous * Reentrancy : Non Reentrant * Parameters (in) : SourceAddress - Target address in flash memory. * This address offset will be added to the flash memory * base address. * TargetAddressPtr - Pointer to source data buffer * Length - Number of bytes to erase * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType - * E_OK: compare command has been accepted * E_NOT_OK: compare command has not been accepted * Description : 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.
* Service name : Fls_BlankCheck * Syntax : Std_ReturnType Fls_Compare * (Fls_AddressType TargetAddress,, * Fls_LengthType Length) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x0a * Sync/Async : Asynchronous * Reentrancy : Non Reentrant * Parameters (in) : TargetAddress - Target address in flash memory. * This address offset will be added to the flash memory * base address. * SourceAddressPtr - Pointer to source data buffer * Length - Number of bytes to erase * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType - * E_OK: BlankCheck command has been accepted * E_NOT_OK: BlankCheck command has not been accepted * Description : 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.
* Service name : Fls_GetStatus * Syntax : MemIf_StatusType Fls_GetStatus( void ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x04 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : None * Parameters (inout) : None * Parameters (out) : None * Return value : MemIf_StatusType * Description : Returns the driver state. *
Std_ReturnType Fls_GetVersionInfo | ( | Std_VersionInfoType * | versioninfo | ) |
This service returns the version information of this module.
* Service name : Fls_GetVersionInfo * Syntax : void Fls_GetVersionInfo( Std_VersionInfoType* * versioninfo ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x10 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : None * Parameters (inout) : versioninfo - Pointer to where to store the version * information of this module * Parameters (out) : None * Return value : None * Description : This service returns the version information of this * module *
MemIf_JobResultType Fls_GetJobResult | ( | void | ) |
Returns the result of the last job.
* Service name : Fls_GetJobResult * Syntax : MemIf_JobResultType Fls_GetJobResult(void) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x05 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : None * Parameters (inout) : None * Parameters (out) : None * Return value : MemIf_JobResultType * Description : Returns the result of the last job. *
void Fls_MainFunction | ( | void | ) |
Performs the processing of jobs.
* Service name : Fls_MainFunction * Syntax : void Fls_MainFunction(void) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x06 * Description : Performs the processing of jobs. *
void Fls_Cancel | ( | void | ) |
Cancels an ongoing job.
* Service name : Fls_Cancel * Syntax : void Fls_Cancel(void) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x03 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : None * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Cancels an ongoing job. *