MCUXpresso SDK API Reference Manual  Rev 2.15.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Ftftx FLASH Driver

Overview

Data Structures

union  _pflash_protection_status
 PFlash protection status. More...
 
struct  _flash_config
 Flash driver state information. More...
 

Typedefs

typedef enum
_flash_protection_state 
flash_prot_state_t
 Enumeration for the three possible flash protection levels.
 
typedef union
_pflash_protection_status 
pflash_prot_status_t
 PFlash protection status.
 
typedef enum
_flash_execute_only_access_state 
flash_xacc_state_t
 Enumeration for the three possible flash execute access levels.
 
typedef enum _flash_property_tag flash_property_tag_t
 Enumeration for various flash properties.
 
typedef struct _flash_config flash_config_t
 Flash driver state information. More...
 

Enumerations

enum  _flash_protection_state {
  kFLASH_ProtectionStateUnprotected,
  kFLASH_ProtectionStateProtected,
  kFLASH_ProtectionStateMixed
}
 Enumeration for the three possible flash protection levels. More...
 
enum  _flash_execute_only_access_state {
  kFLASH_AccessStateUnLimited,
  kFLASH_AccessStateExecuteOnly,
  kFLASH_AccessStateMixed
}
 Enumeration for the three possible flash execute access levels. More...
 
enum  _flash_property_tag {
  kFLASH_PropertyPflash0SectorSize = 0x00U,
  kFLASH_PropertyPflash0TotalSize = 0x01U,
  kFLASH_PropertyPflash0BlockSize = 0x02U,
  kFLASH_PropertyPflash0BlockCount = 0x03U,
  kFLASH_PropertyPflash0BlockBaseAddr = 0x04U,
  kFLASH_PropertyPflash0FacSupport = 0x05U,
  kFLASH_PropertyPflash0AccessSegmentSize = 0x06U,
  kFLASH_PropertyPflash0AccessSegmentCount = 0x07U,
  kFLASH_PropertyPflash1SectorSize = 0x10U,
  kFLASH_PropertyPflash1TotalSize = 0x11U,
  kFLASH_PropertyPflash1BlockSize = 0x12U,
  kFLASH_PropertyPflash1BlockCount = 0x13U,
  kFLASH_PropertyPflash1BlockBaseAddr = 0x14U,
  kFLASH_PropertyPflash1FacSupport = 0x15U,
  kFLASH_PropertyPflash1AccessSegmentSize = 0x16U,
  kFLASH_PropertyPflash1AccessSegmentCount = 0x17U,
  kFLASH_PropertyFlexRamBlockBaseAddr = 0x20U,
  kFLASH_PropertyFlexRamTotalSize = 0x21U
}
 Enumeration for various flash properties. More...
 

Flash version

#define FSL_FLASH_DRIVER_VERSION   (MAKE_VERSION(3U, 1U, 3U))
 Flash driver version for SDK. More...
 
#define FSL_FLASH_DRIVER_VERSION_ROM   (MAKE_VERSION(3U, 0U, 0U))
 Flash driver version for ROM. More...
 

Initialization

status_t FLASH_Init (flash_config_t *config)
 Initializes the global flash properties structure members. More...
 

Erasing

status_t FLASH_Erase (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key)
 Erases the Dflash sectors encompassed by parameters passed into function. More...
 
status_t FLASH_EraseSectorNonBlocking (flash_config_t *config, uint32_t start, uint32_t key)
 Erases the Dflash sectors encompassed by parameters passed into function. More...
 
status_t FLASH_EraseAll (flash_config_t *config, uint32_t key)
 Erases entire flexnvm. More...
 
status_t FLASH_EraseAllUnsecure (flash_config_t *config, uint32_t key)
 Erases the entire flexnvm, including protected sectors. More...
 

Programming

status_t FLASH_Program (flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
 Programs flash with data at locations passed in through parameters. More...
 
status_t FLASH_ProgramOnce (flash_config_t *config, uint32_t index, uint8_t *src, uint32_t lengthInBytes)
 Program the Program-Once-Field through parameters. More...
 
status_t FLASH_ProgramSection (flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
 Programs flash with data at locations passed in through parameters via the Program Section command. More...
 

Reading

status_t FLASH_ReadOnce (flash_config_t *config, uint32_t index, uint8_t *dst, uint32_t lengthInBytes)
 Reads the Program Once Field through parameters. More...
 

Verification

status_t FLASH_VerifyErase (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, ftfx_margin_value_t margin)
 Verifies an erasure of the desired flash area at a specified margin level. More...
 
status_t FLASH_VerifyEraseAll (flash_config_t *config, ftfx_margin_value_t margin)
 Verifies erasure of the entire flash at a specified margin level. More...
 
status_t FLASH_VerifyProgram (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, const uint8_t *expectedData, ftfx_margin_value_t margin, uint32_t *failedAddress, uint32_t *failedData)
 Verifies programming of the desired flash area at a specified margin level. More...
 

Security

status_t FLASH_GetSecurityState (flash_config_t *config, ftfx_security_state_t *state)
 Returns the security state via the pointer passed into the function. More...
 
status_t FLASH_SecurityBypass (flash_config_t *config, const uint8_t *backdoorKey)
 Allows users to bypass security with a backdoor key. More...
 

Swap

status_t FLASH_Swap (flash_config_t *config, uint32_t address, bool isSetEnable)
 Swaps the lower half flash with the higher half flash. More...
 

Protection

status_t FLASH_IsProtected (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, flash_prot_state_t *protection_state)
 Returns the protection state of the desired flash area via the pointer passed into the function. More...
 
status_t FLASH_IsExecuteOnly (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, flash_xacc_state_t *access_state)
 Returns the access state of the desired flash area via the pointer passed into the function. More...
 
status_t FLASH_PflashSetProtection (flash_config_t *config, pflash_prot_status_t *protectStatus)
 Sets the PFlash Protection to the intended protection status. More...
 
status_t FLASH_PflashGetProtection (flash_config_t *config, pflash_prot_status_t *protectStatus)
 Gets the PFlash protection status. More...
 

Properties

status_t FLASH_GetProperty (flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value)
 Returns the desired flash property. More...
 

commantStatus

status_t FLASH_GetCommandState (void)
 Get previous command status. More...
 

Data Structure Documentation

union _pflash_protection_status

Data Fields

uint32_t protl
 PROT[31:0] . More...
 
uint32_t proth
 PROT[63:32]. More...
 
uint8_t protsl
 PROTS[7:0] . More...
 
uint8_t protsh
 PROTS[15:8] . More...
 

Field Documentation

uint32_t _pflash_protection_status::protl
uint32_t _pflash_protection_status::proth
uint8_t _pflash_protection_status::protsl
uint8_t _pflash_protection_status::protsh
struct _flash_config

An instance of this structure is allocated by the user of the flash driver and passed into each of the driver APIs.

Macro Definition Documentation

#define FSL_FLASH_DRIVER_VERSION   (MAKE_VERSION(3U, 1U, 3U))

Version 3.1.3.

#define FSL_FLASH_DRIVER_VERSION_ROM   (MAKE_VERSION(3U, 0U, 0U))

Version 3.0.0.

Typedef Documentation

typedef struct _flash_config flash_config_t

An instance of this structure is allocated by the user of the flash driver and passed into each of the driver APIs.

Enumeration Type Documentation

Enumerator
kFLASH_ProtectionStateUnprotected 

Flash region is not protected.

kFLASH_ProtectionStateProtected 

Flash region is protected.

kFLASH_ProtectionStateMixed 

Flash is mixed with protected and unprotected region.

Enumerator
kFLASH_AccessStateUnLimited 

Flash region is unlimited.

kFLASH_AccessStateExecuteOnly 

Flash region is execute only.

kFLASH_AccessStateMixed 

Flash is mixed with unlimited and execute only region.

Enumerator
kFLASH_PropertyPflash0SectorSize 

Pflash sector size property.

kFLASH_PropertyPflash0TotalSize 

Pflash total size property.

kFLASH_PropertyPflash0BlockSize 

Pflash block size property.

kFLASH_PropertyPflash0BlockCount 

Pflash block count property.

kFLASH_PropertyPflash0BlockBaseAddr 

Pflash block base address property.

kFLASH_PropertyPflash0FacSupport 

Pflash fac support property.

kFLASH_PropertyPflash0AccessSegmentSize 

Pflash access segment size property.

kFLASH_PropertyPflash0AccessSegmentCount 

Pflash access segment count property.

kFLASH_PropertyPflash1SectorSize 

Pflash sector size property.

kFLASH_PropertyPflash1TotalSize 

Pflash total size property.

kFLASH_PropertyPflash1BlockSize 

Pflash block size property.

kFLASH_PropertyPflash1BlockCount 

Pflash block count property.

kFLASH_PropertyPflash1BlockBaseAddr 

Pflash block base address property.

kFLASH_PropertyPflash1FacSupport 

Pflash fac support property.

kFLASH_PropertyPflash1AccessSegmentSize 

Pflash access segment size property.

kFLASH_PropertyPflash1AccessSegmentCount 

Pflash access segment count property.

kFLASH_PropertyFlexRamBlockBaseAddr 

FlexRam block base address property.

kFLASH_PropertyFlexRamTotalSize 

FlexRam total size property.

Function Documentation

status_t FLASH_Init ( flash_config_t config)

This function checks and initializes the Flash module for the other Flash APIs.

Parameters
configPointer to the storage for the driver runtime state.
Return values
kStatus_FTFx_SuccessAPI was executed successfully.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_PartitionStatusUpdateFailureFailed to update the partition status.
status_t FLASH_Erase ( flash_config_t config,
uint32_t  start,
uint32_t  lengthInBytes,
uint32_t  key 
)

This function erases the appropriate number of flash sectors based on the desired start address and length.

Parameters
configThe pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be erased. The start address does not need to be sector-aligned but must be word-aligned.
lengthInBytesThe length, given in bytes (not words or long-words) to be erased. Must be word-aligned.
keyThe value used to validate all flash erase APIs.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the appropriate number of flash sectors based on the desired start address and length were erased successfully.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorThe parameter is not aligned with the specified baseline.
kStatus_FTFx_AddressErrorThe address is out of range.
kStatus_FTFx_EraseKeyErrorThe API erase key is invalid.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_EraseSectorNonBlocking ( flash_config_t config,
uint32_t  start,
uint32_t  key 
)

This function erases one flash sector size based on the start address, and it is executed asynchronously.

NOTE: This function can only erase one flash sector at a time, and the other commands can be executed after the previous command has been completed.

Parameters
configThe pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be erased. The start address does not need to be sector-aligned but must be word-aligned.
keyThe value used to validate all flash erase APIs.
Return values
kStatus_FTFx_SuccessAPI was executed successfully.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorThe parameter is not aligned with the specified baseline.
kStatus_FTFx_AddressErrorThe address is out of range.
kStatus_FTFx_EraseKeyErrorThe API erase key is invalid.
status_t FLASH_EraseAll ( flash_config_t config,
uint32_t  key 
)
Parameters
configPointer to the storage for the driver runtime state.
keyA value used to validate all flash erase APIs.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the all pflash and flexnvm were erased successfully, the swap and eeprom have been reset to unconfigured state.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_EraseKeyErrorAPI erase key is invalid.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during command execution.
kStatus_FTFx_PartitionStatusUpdateFailureFailed to update the partition status.
status_t FLASH_EraseAllUnsecure ( flash_config_t config,
uint32_t  key 
)
Parameters
configPointer to the storage for the driver runtime state.
keyA value used to validate all flash erase APIs.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the protected sectors of flash were reset to unprotected status.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_EraseKeyErrorAPI erase key is invalid.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during command execution.
kStatus_FTFx_PartitionStatusUpdateFailureFailed to update the partition status.
status_t FLASH_Program ( flash_config_t config,
uint32_t  start,
uint8_t *  src,
uint32_t  lengthInBytes 
)

This function programs the flash memory with the desired data for a given flash area as determined by the start address and the length.

Parameters
configA pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be programmed. Must be word-aligned.
srcA pointer to the source buffer of data that is to be programmed into the flash.
lengthInBytesThe length, given in bytes (not words or long-words), to be programmed. Must be word-aligned.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the desired data were programed successfully into flash based on desired start address and length.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorParameter is not aligned with the specified baseline.
kStatus_FTFx_AddressErrorAddress is out of range.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_ProgramOnce ( flash_config_t config,
uint32_t  index,
uint8_t *  src,
uint32_t  lengthInBytes 
)

This function Program the Program-once-feild with given index and length.

Parameters
configA pointer to the storage for the driver runtime state.
indexThe index indicating the area of program once field to be read.
srcA pointer to the source buffer of data that is used to store data to be write.
lengthInBytesThe length, given in bytes (not words or long-words), to be programmed. Must be word-aligned.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; The index indicating the area of program once field was programed successfully.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_ProgramSection ( flash_config_t config,
uint32_t  start,
uint8_t *  src,
uint32_t  lengthInBytes 
)

This function programs the flash memory with the desired data for a given flash area as determined by the start address and length.

Parameters
configA pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be programmed. Must be word-aligned.
srcA pointer to the source buffer of data that is to be programmed into the flash.
lengthInBytesThe length, given in bytes (not words or long-words), to be programmed. Must be word-aligned.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the desired data have been programed successfully into flash based on start address and length.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FTFx_AddressErrorAddress is out of range.
kStatus_FTFx_SetFlexramAsRamErrorFailed to set flexram as RAM.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during command execution.
kStatus_FTFx_RecoverFlexramAsEepromErrorFailed to recover FlexRAM as EEPROM.
status_t FLASH_ReadOnce ( flash_config_t config,
uint32_t  index,
uint8_t *  dst,
uint32_t  lengthInBytes 
)

This function reads the read once feild with given index and length.

Parameters
configA pointer to the storage for the driver runtime state.
indexThe index indicating the area of program once field to be read.
dstA pointer to the destination buffer of data that is used to store data to be read.
lengthInBytesThe length, given in bytes (not words or long-words), to be programmed. Must be word-aligned.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the data have been successfuly read form Program flash0 IFR map and Program Once field based on index and length.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyErase ( flash_config_t config,
uint32_t  start,
uint32_t  lengthInBytes,
ftfx_margin_value_t  margin 
)

This function checks the appropriate number of flash sectors based on the desired start address and length to check whether the flash is erased to the specified read margin level.

Parameters
configA pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be verified. The start address does not need to be sector-aligned but must be word-aligned.
lengthInBytesThe length, given in bytes (not words or long-words), to be verified. Must be word-aligned.
marginRead margin choice.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the specified FLASH region has been erased.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FTFx_AddressErrorAddress is out of range.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyEraseAll ( flash_config_t config,
ftfx_margin_value_t  margin 
)

This function checks whether the flash is erased to the specified read margin level.

Parameters
configA pointer to the storage for the driver runtime state.
marginRead margin choice.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; all program flash and flexnvm were in erased state.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyProgram ( flash_config_t config,
uint32_t  start,
uint32_t  lengthInBytes,
const uint8_t *  expectedData,
ftfx_margin_value_t  margin,
uint32_t *  failedAddress,
uint32_t *  failedData 
)

This function verifies the data programmed in the flash memory using the Flash Program Check Command and compares it to the expected data for a given flash area as determined by the start address and length.

Parameters
configA pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be verified. Must be word-aligned.
lengthInBytesThe length, given in bytes (not words or long-words), to be verified. Must be word-aligned.
expectedDataA pointer to the expected data that is to be verified against.
marginRead margin choice.
failedAddressA pointer to the returned failing address.
failedDataA pointer to the returned failing data. Some derivatives do not include failed data as part of the FCCOBx registers. In this case, zeros are returned upon failure.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the desired data have been successfully programed into specified FLASH region.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FTFx_AddressErrorAddress is out of range.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_GetSecurityState ( flash_config_t config,
ftfx_security_state_t state 
)

This function retrieves the current flash security status, including the security enabling state and the backdoor key enabling state.

Parameters
configA pointer to storage for the driver runtime state.
stateA pointer to the value returned for the current security status code:
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the security state of flash was stored to state.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
status_t FLASH_SecurityBypass ( flash_config_t config,
const uint8_t *  backdoorKey 
)

If the MCU is in secured state, this function unsecures the MCU by comparing the provided backdoor key with ones in the flash configuration field.

Parameters
configA pointer to the storage for the driver runtime state.
backdoorKeyA pointer to the user buffer containing the backdoor key.
Return values
kStatus_FTFx_SuccessAPI was executed successfully.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.
status_t FLASH_Swap ( flash_config_t config,
uint32_t  address,
bool  isSetEnable 
)
Parameters
configA pointer to the storage for the driver runtime state.
addressAddress used to configure the flash swap function
isSetEnableThe possible option used to configure the Flash Swap function or check the flash Swap status.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the lower half flash and higher half flash have been swaped.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FTFx_SwapIndicatorAddressErrorSwap indicator address is invalid.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during command execution.
kStatus_FTFx_SwapSystemNotInUninitializedSwap system is not in an uninitialized state.
status_t FLASH_IsProtected ( flash_config_t config,
uint32_t  start,
uint32_t  lengthInBytes,
flash_prot_state_t protection_state 
)

This function retrieves the current flash protect status for a given flash area as determined by the start address and length.

Parameters
configA pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be checked. Must be word-aligned.
lengthInBytesThe length, given in bytes (not words or long-words) to be checked. Must be word-aligned.
protection_stateA pointer to the value returned for the current protection status code for the desired flash area.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the protection state of specified FLASH region was stored to protection_state.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FTFx_AddressErrorThe address is out of range.
status_t FLASH_IsExecuteOnly ( flash_config_t config,
uint32_t  start,
uint32_t  lengthInBytes,
flash_xacc_state_t access_state 
)

This function retrieves the current flash access status for a given flash area as determined by the start address and length.

Parameters
configA pointer to the storage for the driver runtime state.
startThe start address of the desired flash memory to be checked. Must be word-aligned.
lengthInBytesThe length, given in bytes (not words or long-words), to be checked. Must be word-aligned.
access_stateA pointer to the value returned for the current access status code for the desired flash area.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the executeOnly state of specified FLASH region was stored to access_state.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_AlignmentErrorThe parameter is not aligned to the specified baseline.
kStatus_FTFx_AddressErrorThe address is out of range.
status_t FLASH_PflashSetProtection ( flash_config_t config,
pflash_prot_status_t protectStatus 
)
Parameters
configA pointer to storage for the driver runtime state.
protectStatusThe expected protect status to set to the PFlash protection register. Each bit is corresponding to protection of 1/32(64) of the total PFlash. The least significant bit is corresponding to the lowest address area of PFlash. The most significant bit is corresponding to the highest address area of PFlash. There are two possible cases as shown below: 0: this area is protected. 1: this area is unprotected.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the specified FLASH region is protected.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_CommandFailureRun-time error during command execution.
status_t FLASH_PflashGetProtection ( flash_config_t config,
pflash_prot_status_t protectStatus 
)
Parameters
configA pointer to the storage for the driver runtime state.
protectStatusProtect status returned by the PFlash IP. Each bit is corresponding to the protection of 1/32(64) of the total PFlash. The least significant bit corresponds to the lowest address area of the PFlash. The most significant bit corresponds to the highest address area of PFlash. There are two possible cases as shown below: 0: this area is protected. 1: this area is unprotected.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the Protection state was stored to protectStatus;
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
status_t FLASH_GetProperty ( flash_config_t config,
flash_property_tag_t  whichProperty,
uint32_t *  value 
)
Parameters
configA pointer to the storage for the driver runtime state.
whichPropertyThe desired property from the list of properties in enum flash_property_tag_t
valueA pointer to the value returned for the desired flash property.
Return values
kStatus_FTFx_SuccessAPI was executed successfully; the flash property was stored to value.
kStatus_FTFx_InvalidArgumentAn invalid argument is provided.
kStatus_FTFx_UnknownPropertyAn unknown property tag.
status_t FLASH_GetCommandState ( void  )

This function is used to obtain the execution status of the previous command.

Return values
kStatus_FTFx_SuccessThe previous command is executed successfully.
kStatus_FTFx_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FTFx_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FTFx_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FTFx_CommandFailureRun-time error during the command execution.