MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Flash_driver_api

Overview

Data Structures

struct  flash_mem_desc_t
 Flash memory descriptor. More...
 
struct  flash_config_t
 Flash driver state information. More...
 
struct  flash_driver_interface_t
 Interface for the flash driver. More...
 

Macros

#define FOUR_CHAR_CODE(a, b, c, d)   (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a)))
 Constructs the four character code for the Flash driver API key. More...
 
#define ALIGN_DOWN(x, a)   (((uint32_t)(x)) & ~((uint32_t)(a)-1u))
 Alignment(down) utility. More...
 

Enumerations

enum  _flash_driver_version_constants {
  kFLASH_DriverVersionName = 'F',
  kFLASH_DriverVersionMajor = 1,
  kFLASH_DriverVersionMinor = 1,
  kFLASH_DriverVersionBugfix = 0,
  kFLASH_DriverVersionName = 'F',
  kFLASH_DriverVersionMajor = 2,
  kFLASH_DriverVersionMinor = 1,
  kFLASH_DriverVersionBugfix = 0
}
 Flash driver version for ROM. More...
 
enum  flash_property_tag_t {
  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,
  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...
 

Functions

void FLASH_CACHE_Disable (void)
 FLASH_CACHE_Disable. More...
 
void FLASH_CACHE_Clear (bool isPreProcess)
 FLASH_CACHE_Clear. More...
 

Flash version

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

FLASH status

enum  
 FLASH driver status group. More...
 
enum  {
  kStatus_FLASH_Success = MAKE_STATUS(kStatusGroupGeneric, 0),
  kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4),
  kStatus_FLASH_SizeError = MAKE_STATUS(kStatusGroupFlashDriver, 0),
  kStatus_FLASH_AlignmentError,
  kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2),
  kStatus_FLASH_AccessError,
  kStatus_FLASH_ProtectionViolation,
  kStatus_FLASH_CommandFailure,
  kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6),
  kStatus_FLASH_EraseKeyError = MAKE_STATUS(kStatusGroupFlashDriver, 7),
  kStatus_FLASH_RegionExecuteOnly,
  kStatus_FLASH_ExecuteInRamFunctionNotReady,
  kStatus_FLASH_PartitionStatusUpdateFailure,
  kStatus_FLASH_SetFlexramAsEepromError,
  kStatus_FLASH_RecoverFlexramAsRamError,
  kStatus_FLASH_SetFlexramAsRamError = MAKE_STATUS(kStatusGroupFlashDriver, 13),
  kStatus_FLASH_RecoverFlexramAsEepromError,
  kStatus_FLASH_CommandNotSupported = MAKE_STATUS(kStatusGroupFlashDriver, 15),
  kStatus_FLASH_SwapSystemNotInUninitialized,
  kStatus_FLASH_SwapIndicatorAddressError,
  kStatus_FLASH_ReadOnlyProperty = MAKE_STATUS(kStatusGroupFlashDriver, 18),
  kStatus_FLASH_InvalidPropertyValue,
  kStatus_FLASH_InvalidSpeculationOption,
  kStatus_FLASH_CommandAborOption
}
 FLASH driver status codes. More...
 

Flash API key

enum  _flash_driver_api_keys {
  kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k'),
  kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k')
}
 Enumeration for Flash driver API keys. 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, FMU_Type *base, uint32_t start, uint32_t lengthInBytes, uint32_t key)
 Erases the Dflash sectors encompassed by parameters passed into function. More...
 

Programming

status_t FLASH_Program (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t *src, uint32_t lengthInBytes)
 Programs flash phrases with data at locations passed in through parameters. More...
 
status_t FLASH_ProgramPage (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t *src, uint32_t lengthInBytes)
 Programs flash pages with data at locations passed in through parameters. More...
 

Verification

status_t FLASH_VerifyEraseAll (FMU_Type *base)
 Verify that all flash and IFR space is erased. More...
 
status_t FLASH_VerifyErasePhrase (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t lengthInBytes)
 Verify that the flash phrases are erased. More...
 
status_t FLASH_VerifyErasePage (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t lengthInBytes)
 Verify that the flash pages are erased. More...
 
status_t FLASH_VerifyEraseSector (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t lengthInBytes)
 Verify that the flash sector are erased. More...
 
status_t FLASH_VerifyEraseIFRPhrase (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t lengthInBytes)
 Verify that the ifr phrases are erased. More...
 
status_t FLASH_VerifyEraseIFRPage (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t lengthInBytes)
 Verify that the ifr pages are erased. More...
 
status_t FLASH_VerifyEraseIFRSector (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t lengthInBytes)
 Verify that the ifr sectors are erased. More...
 

Properties

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

Read (Main Array or IFR) Into MISR

status_t FLASH_ReadIntoMisr (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t end, uint32_t *seed, uint32_t *signature)
 Read into MISR. More...
 
status_t FLASH_ReadIFRIntoMisr (flash_config_t *config, FMU_Type *base, uint32_t start, uint32_t end, uint32_t *seed, uint32_t *signature)
 Read IFR into MISR. More...
 

Data Structure Documentation

struct flash_mem_desc_t

Data Fields

uint32_t blockBase
 A base address of the flash block. More...
 
uint32_t totalSize
 The size of the flash block. More...
 
uint32_t blockCount
 A number of flash blocks. More...
 

Field Documentation

uint32_t flash_mem_desc_t::blockBase

Base address of the flash block.

uint32_t flash_mem_desc_t::totalSize
uint32_t flash_mem_desc_t::blockCount
struct 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.

struct flash_driver_interface_t

Macro Definition Documentation

#define FSL_FLASH_DRIVER_VERSION   (MAKE_VERSION(1, 1, 0))

Version 1.1.0.

#define FOUR_CHAR_CODE (   a,
  b,
  c,
 
)    (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a)))
#define ALIGN_DOWN (   x,
 
)    (((uint32_t)(x)) & ~((uint32_t)(a)-1u))

Enumeration Type Documentation

Enumerator
kFLASH_DriverVersionName 

Flash driver version name.

kFLASH_DriverVersionMajor 

Major flash driver version.

kFLASH_DriverVersionMinor 

Minor flash driver version.

kFLASH_DriverVersionBugfix 

Bugfix for flash driver version.

kFLASH_DriverVersionName 

Flash driver version name.

kFLASH_DriverVersionMajor 

Major flash driver version.

kFLASH_DriverVersionMinor 

Minor flash driver version.

kFLASH_DriverVersionBugfix 

Bugfix for flash driver version.

anonymous enum
anonymous enum
Enumerator
kStatus_FLASH_Success 

API is executed successfully.

kStatus_FLASH_InvalidArgument 

Invalid argument.

kStatus_FLASH_SizeError 

Error size.

kStatus_FLASH_AlignmentError 

Parameter is not aligned with the specified baseline.

kStatus_FLASH_AddressError 

Address is out of range.

kStatus_FLASH_AccessError 

Invalid instruction codes and out-of bound addresses.

kStatus_FLASH_ProtectionViolation 

The program/erase operation is requested to execute on protected areas.

kStatus_FLASH_CommandFailure 

Run-time error during command execution.

kStatus_FLASH_UnknownProperty 

Unknown property.

kStatus_FLASH_EraseKeyError 

API erase key is invalid.

kStatus_FLASH_RegionExecuteOnly 

The current region is execute-only.

kStatus_FLASH_ExecuteInRamFunctionNotReady 

Execute-in-RAM function is not available.

kStatus_FLASH_PartitionStatusUpdateFailure 

Failed to update partition status.

kStatus_FLASH_SetFlexramAsEepromError 

Failed to set FlexRAM as EEPROM.

kStatus_FLASH_RecoverFlexramAsRamError 

Failed to recover FlexRAM as RAM.

kStatus_FLASH_SetFlexramAsRamError 

Failed to set FlexRAM as RAM.

kStatus_FLASH_RecoverFlexramAsEepromError 

Failed to recover FlexRAM as EEPROM.

kStatus_FLASH_CommandNotSupported 

Flash API is not supported.

kStatus_FLASH_SwapSystemNotInUninitialized 

Swap system is not in an uninitialzed state.

kStatus_FLASH_SwapIndicatorAddressError 

The swap indicator address is invalid.

kStatus_FLASH_ReadOnlyProperty 

The flash property is read-only.

kStatus_FLASH_InvalidPropertyValue 

The flash property value is out of range.

kStatus_FLASH_InvalidSpeculationOption 

The option of flash prefetch speculation is invalid.

kStatus_FLASH_CommandAborOption 

The option of flash prefetch speculation is invalid.

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.

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.

Note
The resulting value is built with a byte order such that the string being readable in expected order when viewed in a hex editor, if the value is treated as a 32-bit little endian value.
Enumerator
kFLASH_ApiEraseKey 

Key value used to validate all flash erase APIs.

kFLASH_ApiEraseKey 

Key value used to validate all flash erase APIs.

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_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
kStatus_FLASH_CommandNotSupportedFlash API is not supported.
status_t FLASH_Erase ( flash_config_t config,
FMU_Type *  base,
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, Must be phrase-aligned.
lengthInBytesThe length, given in bytes to be erased, It is recommended that the length is aligned with the sector.
baseFMU base address.
keyThe value used to validate all flash erase APIs.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorThe parameter is not aligned with the specified baseline.
kStatus_FLASH_AddressErrorThe address is out of range.
kStatus_FLASH_EraseKeyErrorThe API erase key is invalid.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_Program ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_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.
baseFMU base address.
startThe start address of the desired flash memory to be programmed, Must be phrase-aligned.
srcA pointer to the source buffer of data that is to be programmed into the flash.
lengthInBytesThe length, given in bytes must be phrase-aligned.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with the specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_ProgramPage ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t *  src,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired flash memory to be programmed. Must be page-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 page-aligned.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with the specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyEraseAll ( FMU_Type *  base)
Parameters
baseFMU base address.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
kStatus_FLASH_CommandAborOption
status_t FLASH_VerifyErasePhrase ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired flash memory to be verified. The start address need to be phrase-aligned.
lengthInBytesThe length, It is recommended that the length is aligned with the phrase.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyErasePage ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired flash memory to be verified. The start address must be page-aligned.
lengthInBytesThe length, It is recommended that the length is aligned with the page.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyEraseSector ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired flash memory to be verified. The start address need to be sector-aligned.
lengthInBytesThe length, It is recommended that the length is aligned with the page.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyEraseIFRPhrase ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired ifr memory to be verified. The start address need to be phrase-aligned.
lengthInBytesThe length, it is recommended that the length is aligned with the phrase.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyEraseIFRPage ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired ifr memory to be verified. The start address need to be page-aligned.
lengthInBytesThe length, it is recommended that the length is aligned with the page.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
status_t FLASH_VerifyEraseIFRSector ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  lengthInBytes 
)
Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired ifr memory to be verified. The start address need to be sector-aligned.
lengthInBytesThe length, it is recommended that the length is aligned with the page.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_AlignmentErrorParameter is not aligned with specified baseline.
kStatus_FLASH_AddressErrorAddress is out of range.
kStatus_FLASH_ExecuteInRamFunctionNotReadyExecute-in-RAM function is not available.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bounds addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandFailureRun-time error during the command execution.
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_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_UnknownPropertyAn unknown property tag.
status_t FLASH_ReadIntoMisr ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  end,
uint32_t *  seed,
uint32_t *  signature 
)

The Read into MISR operation generates a signature based on the contents of the selected flash memory using an embedded MISR.

Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired flash memory to be programed. The start address need to be page-aligned.
endThe end address of the desired flash memory to be programed.
seedA pointer to the source buffer of seed that is to be programmed into the signature register .
signatureReturns the generated signature frome the flash specified area.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_UnknownPropertyAn unknown property tag.
kStatus_FLASH_CommandFailureRun-time error during command execution.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bound addresses
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandAborOptionThe option of flash prefetch speculation is invalid.
status_t FLASH_ReadIFRIntoMisr ( flash_config_t config,
FMU_Type *  base,
uint32_t  start,
uint32_t  end,
uint32_t *  seed,
uint32_t *  signature 
)

The Read IFR into MISR operation generates a signature based on the contents of the selected IFR space using an embedded MISR.

Parameters
configA pointer to the storage for the driver runtime state.
baseFMU base address.
startThe start address of the desired ifr memory to be programed. The start address need to be page-aligned.
endThe end address of the desired ifr memory to be programed.
seedA pointer to the source buffer of seed that is to be programmed into the signature register .
signatureReturns the generated signature frome the ifr specified area.
Return values
kStatus_FLASH_SuccessAPI was executed successfully.
kStatus_FLASH_InvalidArgumentAn invalid argument is provided.
kStatus_FLASH_UnknownPropertyAn unknown property tag.
kStatus_FLASH_CommandFailureRun-time error during command execution.
kStatus_FLASH_AccessErrorInvalid instruction codes and out-of bound addresses.
kStatus_FLASH_ProtectionViolationThe program/erase operation is requested to execute on protected areas.
kStatus_FLASH_CommandAborOptionThe option of flash prefetch speculation is invalid.
void FLASH_CACHE_Disable ( void  )

FLASH_CACHE_Disable disables the cache of FMU0, but not radio FMU

void FLASH_CACHE_Clear ( bool  isPreProcess)

FLASH_CACHE_Clear clears cache of FMU0, but not radio FMU

Parameters
isPreProcess,setto true if it's before program/erase execution, set ti false if it's after the program/erase execution