![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The flash provides the FTMRx Flash driver of MCUXpresso SDK devices with the FTMRx Flash module inside. The flash driver provides general APIs to handle specific operations on the FTMRx Flash module. The user can use those APIs directly in the application. In addition, it provides internal functions called by the driver. Although these functions are not meant to be called from the user's application directly, the APIs can still be used.
Data Structures | |
struct | _pflash_protection_status |
PFlash protection status - full. More... | |
struct | _flash_prefetch_speculation_status |
Flash prefetch speculation status. More... | |
struct | _flash_protection_config |
Active flash protection information for the current operation. More... | |
struct | _flash_operation_config |
Active flash information for the current operation. More... | |
union | function_run_command_t |
Flash execute-in-RAM command. More... | |
struct | _flash_execute_in_ram_function_config |
Flash execute-in-RAM function information. More... | |
struct | _flash_config |
Flash driver state information. More... | |
Typedefs | |
typedef enum _flash_user_margin_value | flash_user_margin_value_t |
Enumeration for supported flash user margin levels. | |
typedef enum _flash_factory_margin_value | flash_factory_margin_value_t |
Enumeration for supported factory margin levels. | |
typedef enum _flash_margin_value | flash_margin_value_t |
Enumeration for supported flash margin levels. | |
typedef enum _flash_security_state | flash_security_state_t |
Enumeration for the three possible flash security states. | |
typedef enum _flash_protection_state | flash_protection_state_t |
Enumeration for the three possible flash protection levels. | |
typedef enum _flash_property_tag | flash_property_tag_t |
Enumeration for various flash properties. | |
typedef struct _pflash_protection_status | pflash_protection_status_t |
PFlash protection status - full. | |
typedef enum _flash_memory_index | flash_memory_index_t |
Enumeration for the flash memory index. | |
typedef enum _flash_cache_controller_index | flash_cache_controller_index_t |
Enumeration for the flash cache controller index. | |
typedef void(* | flash_callback_t )(void) |
A callback type used for the Pflash block. | |
typedef enum _flash_prefetch_speculation_option | flash_prefetch_speculation_option_t |
Enumeration for the two possible options of flash prefetch speculation. | |
typedef struct _flash_prefetch_speculation_status | flash_prefetch_speculation_status_t |
Flash prefetch speculation status. | |
typedef enum _flash_cache_clear_process | flash_cache_clear_process_t |
Flash cache clear process code. | |
typedef struct _flash_protection_config | flash_protection_config_t |
Active flash protection information for the current operation. | |
typedef struct _flash_operation_config | flash_operation_config_t |
Active flash information for the current operation. | |
typedef struct _flash_execute_in_ram_function_config | flash_execute_in_ram_function_config_t |
Flash execute-in-RAM function information. | |
typedef struct _flash_config | flash_config_t |
Flash driver state information. More... | |
Flash version | |
enum | _flash_driver_version_constants { kFLASH_DriverVersionName = 'F', kFLASH_DriverVersionMajor = 2, kFLASH_DriverVersionMinor = 1, kFLASH_DriverVersionBugfix = 1 } |
Flash driver version for ROM. More... | |
#define | FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) |
Constructs the version number for drivers. More... | |
Flash configuration | |
#define | FLASH_SSD_CONFIG_ENABLE_EEPROM_SUPPORT 1 |
Indicates whether to support EEPROM in the Flash driver. More... | |
#define | FLASH_SSD_IS_EEPROM_ENABLED FLASH_SSD_CONFIG_ENABLE_EEPROM_SUPPORT |
Indicates whether the EEPROM is enabled in the Flash driver. | |
#define | FLASH_SSD_CONFIG_ENABLE_SECONDARY_FLASH_SUPPORT 1 |
Indicates whether to support Secondary flash in the Flash driver. More... | |
#define | FLASH_SSD_IS_SECONDARY_FLASH_ENABLED (0) |
Indicates whether the secondary flash is supported in the Flash driver. | |
#define | FLASH_DRIVER_IS_FLASH_RESIDENT 1 |
Flash driver location. More... | |
#define | FLASH_DRIVER_IS_EXPORTED 0 |
Flash Driver Export option. More... | |
#define | FLASH_ENABLE_STALLING_FLASH_CONTROLLER 1 |
Enable flash stalling controller. | |
Flash API key | |
enum | _flash_driver_api_keys { kFLASH_ApiEraseKey = FOUR_CHAR_CODE('k', 'f', 'e', 'k') } |
Enumeration for Flash driver API keys. More... | |
#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... | |
Initialization | |
status_t | FLASH_Init (flash_config_t *config) |
Initializes the global flash properties structure members. More... | |
status_t | FLASH_SetCallback (flash_config_t *config, flash_callback_t callback) |
Sets the desired flash callback function. More... | |
status_t | FLASH_PrepareExecuteInRamFunctions (flash_config_t *config) |
Prepares flash execute-in-RAM functions. More... | |
Erasing | |
status_t | FLASH_EraseAll (flash_config_t *config, uint32_t key) |
Erases entire flash. More... | |
status_t | FLASH_Erase (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) |
Erases the flash sectors encompassed by parameters passed into function. More... | |
status_t | FLASH_EraseEEprom (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) |
Erases the eeprom sectors encompassed by parameters passed into function. More... | |
status_t | FLASH_EraseAllUnsecure (flash_config_t *config, uint32_t key) |
Erases the entire flash, including protected sectors. More... | |
Programming | |
status_t | FLASH_Program (flash_config_t *config, uint32_t start, uint32_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, uint32_t *src, uint32_t lengthInBytes) |
Programs Program Once Field through parameters. More... | |
status_t | FLASH_EepromWrite (flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) |
Programs the EEPROM with data at locations passed in through parameters. More... | |
Reading | |
status_t | FLASH_ReadOnce (flash_config_t *config, uint32_t index, uint32_t *dst, uint32_t lengthInBytes) |
Reads the Program Once Field through parameters. More... | |
Security | |
status_t | FLASH_GetSecurityState (flash_config_t *config, flash_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... | |
Verification | |
status_t | FLASH_VerifyEraseAll (flash_config_t *config, flash_margin_value_t margin) |
Verifies erasure of the entire flash at a specified margin level. More... | |
status_t | FLASH_VerifyErase (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, flash_margin_value_t margin) |
Verifies an erasure of the desired flash area at a specified margin level. More... | |
Protection | |
status_t | FLASH_IsProtected (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, flash_protection_state_t *protection_state) |
Returns the protection state of the desired flash area via the pointer passed into the function. More... | |
Properties | |
status_t | FLASH_GetProperty (flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) |
Returns the desired flash property. More... | |
status_t | FLASH_SetProperty (flash_config_t *config, flash_property_tag_t whichProperty, uint32_t value) |
Sets the desired flash property. More... | |
Flash Protection Utilities | |
status_t | FLASH_PflashSetProtection (flash_config_t *config, pflash_protection_status_t *protectStatus) |
Sets the PFlash Protection to the intended protection status. More... | |
status_t | FLASH_PflashGetProtection (flash_config_t *config, pflash_protection_status_t *protectStatus) |
Gets the PFlash protection status. More... | |
status_t | FLASH_EepromSetProtection (flash_config_t *config, uint8_t protectStatus) |
Sets the EEPROM protection to the intended protection status. More... | |
status_t | FLASH_EepromGetProtection (flash_config_t *config, uint8_t *protectStatus) |
Gets the EEPROM protection status. More... | |
Flash Speculation Utilities | |
status_t | FLASH_PflashSetPrefetchSpeculation (flash_prefetch_speculation_status_t *speculationStatus) |
Sets the PFlash prefetch speculation to the intended speculation status. More... | |
status_t | FLASH_PflashGetPrefetchSpeculation (flash_prefetch_speculation_status_t *speculationStatus) |
Gets the PFlash prefetch speculation status. More... | |
struct _pflash_protection_status |
Data Fields | |
uint8_t | fprotvalue |
FPROT[7:0] . More... | |
uint8_t _pflash_protection_status::fprotvalue |
struct _flash_prefetch_speculation_status |
Data Fields | |
flash_prefetch_speculation_option_t | instructionOption |
Instruction speculation. More... | |
flash_prefetch_speculation_option_t | dataOption |
Data speculation. More... | |
flash_prefetch_speculation_option_t _flash_prefetch_speculation_status::instructionOption |
flash_prefetch_speculation_option_t _flash_prefetch_speculation_status::dataOption |
struct _flash_protection_config |
Data Fields | |
uint32_t | lowRegionStart |
Start address of flash protection low region. More... | |
uint32_t | lowRegionEnd |
End address of flash protection low region. More... | |
uint32_t | highRegionStart |
Start address of flash protection high region. More... | |
uint32_t | highRegionEnd |
End address of flash protection high region. More... | |
uint32_t _flash_protection_config::lowRegionStart |
uint32_t _flash_protection_config::lowRegionEnd |
uint32_t _flash_protection_config::highRegionStart |
uint32_t _flash_protection_config::highRegionEnd |
struct _flash_operation_config |
Data Fields | |
uint32_t | convertedAddress |
A converted address for the current flash type. More... | |
uint32_t | activeSectorSize |
A sector size of the current flash type. More... | |
uint32_t | activeBlockSize |
A block size of the current flash type. More... | |
uint32_t | blockWriteUnitSize |
The write unit size. More... | |
uint32_t | sectorCmdAddressAligment |
An erase sector command address alignment. More... | |
uint32_t | sectionCmdAddressAligment |
A program/verify section command address alignment. More... | |
uint32_t | programCmdAddressAligment |
A program flash command address alignment. More... | |
uint32_t _flash_operation_config::convertedAddress |
uint32_t _flash_operation_config::activeSectorSize |
uint32_t _flash_operation_config::activeBlockSize |
uint32_t _flash_operation_config::blockWriteUnitSize |
uint32_t _flash_operation_config::sectorCmdAddressAligment |
uint32_t _flash_operation_config::sectionCmdAddressAligment |
uint32_t _flash_operation_config::programCmdAddressAligment |
union function_run_command_t |
struct _flash_execute_in_ram_function_config |
Data Fields | |
uint32_t | activeFunctionCount |
Number of available execute-in-RAM functions. More... | |
function_run_command_t | runCmdFuncAddr |
Execute-in-RAM function: flash_run_command. More... | |
uint32_t _flash_execute_in_ram_function_config::activeFunctionCount |
function_run_command_t _flash_execute_in_ram_function_config::runCmdFuncAddr |
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.
Data Fields | |
uint32_t | PFlashBlockBase |
A base address of the first PFlash block. | |
uint32_t | PFlashTotalSize |
The size of the combined PFlash block. More... | |
uint8_t | PFlashBlockCount |
A number of PFlash blocks. More... | |
uint8_t | FlashMemoryIndex |
0 - primary flash; 1 - secondary flash | |
uint8_t | FlashCacheControllerIndex |
0 - Controller for core 0; 1 - Controller for core 1 | |
uint8_t | Reserved0 |
Reserved field 0. | |
uint32_t | PFlashSectorSize |
The size in bytes of a sector of PFlash. More... | |
flash_callback_t | PFlashCallback |
The callback function for the flash API. More... | |
uint32_t * | flashExecuteInRamFunctionInfo |
An information structure of the flash execute-in-RAM function. More... | |
uint32_t | EEpromTotalSize |
For the FlexNVM device, this is the size in bytes of the EEPROM area which was partitioned from FlexRAM. More... | |
uint32_t | EEpromBlockBase |
This is the base address of the Eeprom. More... | |
uint8_t | EEpromBlockCount |
A number of EEPROM blocks. More... | |
uint8_t | EEpromSectorSize |
The size in bytes of a sector of EEPROM. More... | |
uint8_t | Reserved1 [2] |
Reserved field 1. | |
uint32_t | PFlashClockFreq |
The flash peripheral clock frequency. | |
uint32_t | PFlashMarginLevel |
The margin level. | |
uint32_t _flash_config::PFlashTotalSize |
uint8_t _flash_config::PFlashBlockCount |
uint32_t _flash_config::PFlashSectorSize |
flash_callback_t _flash_config::PFlashCallback |
uint32_t* _flash_config::flashExecuteInRamFunctionInfo |
uint32_t _flash_config::EEpromTotalSize |
For the non-FlexNVM device, this field is unused
uint32_t _flash_config::EEpromBlockBase |
For the non-Eeprom device, this field is unused
uint8_t _flash_config::EEpromBlockCount |
For the non-Eeprom device, this field is unused
uint8_t _flash_config::EEpromSectorSize |
For the non-Eeprom device, this field is unused
#define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) |
Flash driver version for SDK Version 2.1.2.
#define FLASH_SSD_CONFIG_ENABLE_EEPROM_SUPPORT 1 |
Enables the EEPROM support.
#define FLASH_SSD_CONFIG_ENABLE_SECONDARY_FLASH_SUPPORT 1 |
Enables the secondary flash support by default.
#define FLASH_DRIVER_IS_FLASH_RESIDENT 1 |
Used for the flash resident application.
#define FLASH_DRIVER_IS_EXPORTED 0 |
Used for the MCUXpresso SDK application.
#define kStatusGroupGeneric 0 |
#define FOUR_CHAR_CODE | ( | a, | |
b, | |||
c, | |||
d | |||
) | (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) |
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.
anonymous enum |
Flash driver status codes.
enum _flash_margin_value |
enum _flash_property_tag |
anonymous enum |
enum _flash_memory_index |
status_t FLASH_Init | ( | flash_config_t * | config | ) |
This function checks and initializes the Flash module for the other Flash APIs.
config | Pointer to the storage for the driver runtime state. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_ClockDivider | Flash clock prescaler is wrong. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
status_t FLASH_SetCallback | ( | flash_config_t * | config, |
flash_callback_t | callback | ||
) |
config | Pointer to the storage for the driver runtime state. |
callback | A callback function to be stored in the driver. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
status_t FLASH_PrepareExecuteInRamFunctions | ( | flash_config_t * | config | ) |
config | Pointer to the storage for the driver runtime state. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
status_t FLASH_EraseAll | ( | flash_config_t * | config, |
uint32_t | key | ||
) |
config | Pointer to the storage for the driver runtime state. |
key | A value used to validate all flash erase APIs. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_EraseKeyError | API erase key is invalid. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds 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_EepromSingleBitFault | EEPROM single bit fault error code. |
kStatus_FLASH_EepromDoubleBitFault | EEPROM double bit fault error code. |
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.
config | The pointer to the storage for the driver runtime state. |
start | The 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. |
lengthInBytes | The length, given in bytes (not words or long-words) to be erased. Must be word-aligned. |
key | The value used to validate all flash erase APIs. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_AlignmentError | The parameter is not aligned with the specified baseline. |
kStatus_FLASH_AddressError | The address is out of range. |
kStatus_FLASH_EraseKeyError | The API erase key is invalid. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_EraseEEprom | ( | flash_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
uint32_t | key | ||
) |
This function erases the appropriate number of eeprom sectors based on the desired start address and length.
config | The pointer to the storage for the driver runtime state. |
start | The start address of the desired eeprom memory to be erased. The start address does not need to be sector-aligned but must be word-aligned. |
lengthInBytes | The length, given in bytes (not words or long-words) to be erased. Must be word-aligned. |
key | The value used to validate all eeprom erase APIs. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_AlignmentError | The parameter is not aligned with the specified baseline. |
kStatus_FLASH_AddressError | The address is out of range. |
kStatus_FLASH_EraseKeyError | The API erase key is invalid. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_EraseAllUnsecure | ( | flash_config_t * | config, |
uint32_t | key | ||
) |
config | Pointer to the storage for the driver runtime state. |
key | A value used to validate all flash erase APIs. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_EraseKeyError | API erase key is invalid. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds 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_EepromSingleBitFault | EEPROM single bit fault error code. |
kStatus_FLASH_EepromDoubleBitFault | EEPROM double bit fault error code. |
status_t FLASH_Program | ( | flash_config_t * | config, |
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.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
src | A pointer to the source buffer of data that is to be programmed into the flash. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_AlignmentError | Parameter is not aligned with the specified baseline. |
kStatus_FLASH_AddressError | Address is out of range. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_ProgramOnce | ( | flash_config_t * | config, |
uint32_t | index, | ||
uint32_t * | src, | ||
uint32_t | lengthInBytes | ||
) |
This function programs the Program Once Field with the desired data for a given flash area as determined by the index and length.
config | A pointer to the storage for the driver runtime state. |
index | The index indicating which area of the Program Once Field to be programmed. |
src | A pointer to the source buffer of data that is to be programmed into the Program Once Field. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_EepromWrite | ( | flash_config_t * | config, |
uint32_t | start, | ||
uint8_t * | src, | ||
uint32_t | lengthInBytes | ||
) |
This function programs the emulated EEPROM with the desired data for a given flash area as determined by the start address and length.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
src | A pointer to the source buffer of data that is to be programmed into the flash. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_AddressError | Address is out of range. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_EepromSingleBitFault | EEPROM single bit fault error code. |
kStatus_FLASH_EepromDoubleBitFault | EEPROM double bit fault error code. |
status_t FLASH_ReadOnce | ( | flash_config_t * | config, |
uint32_t | index, | ||
uint32_t * | dst, | ||
uint32_t | lengthInBytes | ||
) |
This function reads the read once feild with given index and length.
config | A pointer to the storage for the driver runtime state. |
index | The index indicating the area of program once field to be read. |
dst | A pointer to the destination buffer of data that is used to store data to be read. |
lengthInBytes | The length, given in bytes (not words or long-words), to be programmed. Must be word-aligned. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_GetSecurityState | ( | flash_config_t * | config, |
flash_security_state_t * | state | ||
) |
This function retrieves the current flash security status, including the security enabling state and the backdoor key enabling state.
config | A pointer to storage for the driver runtime state. |
state | A pointer to the value returned for the current security status code: |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An 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.
config | A pointer to the storage for the driver runtime state. |
backdoorKey | A pointer to the user buffer containing the backdoor key. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_VerifyEraseAll | ( | flash_config_t * | config, |
flash_margin_value_t | margin | ||
) |
This function checks whether the flash is erased to the specified read margin level.
config | A pointer to the storage for the driver runtime state. |
margin | Read margin choice. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_EepromSingleBitFault | EEPROM single bit fault error code. |
kStatus_FLASH_EepromDoubleBitFault | EEPROM double bit fault error code. |
status_t FLASH_VerifyErase | ( | flash_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
flash_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.
config | A pointer to the storage for the driver runtime state. |
margin | Read margin choice. |
start | The 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. |
lengthInBytes | The length, given in bytes (not words or long-words), to be verified. Must be word-aligned. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
kStatus_FLASH_AddressError | Address is out of range. |
kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-RAM function is not available. |
kStatus_FLASH_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
status_t FLASH_IsProtected | ( | flash_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
flash_protection_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.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be checked. Must be word-aligned. |
lengthInBytes | The length, given in bytes (not words or long-words) to be checked. Must be word-aligned. |
protection_state | A pointer to the value returned for the current protection status code for the desired flash area. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
kStatus_FLASH_AddressError | The address is out of range. |
status_t FLASH_GetProperty | ( | flash_config_t * | config, |
flash_property_tag_t | whichProperty, | ||
uint32_t * | value | ||
) |
config | A pointer to the storage for the driver runtime state. |
whichProperty | The desired property from the list of properties in enum flash_property_tag_t |
value | A pointer to the value returned for the desired flash property. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_UnknownProperty | An unknown property tag. |
status_t FLASH_SetProperty | ( | flash_config_t * | config, |
flash_property_tag_t | whichProperty, | ||
uint32_t | value | ||
) |
config | A pointer to the storage for the driver runtime state. |
whichProperty | The desired property from the list of properties in enum flash_property_tag_t |
value | A to set for the desired flash property. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_UnknownProperty | An unknown property tag. |
kStatus_FLASH_InvalidPropertyValue | An invalid property value. |
kStatus_FLASH_ReadOnlyProperty | An read-only property tag. |
status_t FLASH_PflashSetProtection | ( | flash_config_t * | config, |
pflash_protection_status_t * | protectStatus | ||
) |
config | A pointer to storage for the driver runtime state. |
protectStatus | The expected protect status to set to the PFlash protection register. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_CommandFailure | Run-time error during command execution. |
status_t FLASH_PflashGetProtection | ( | flash_config_t * | config, |
pflash_protection_status_t * | protectStatus | ||
) |
config | A pointer to the storage for the driver runtime state. |
protectStatus | Protect status returned by the PFlash IP. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
status_t FLASH_EepromSetProtection | ( | flash_config_t * | config, |
uint8_t | protectStatus | ||
) |
config | A pointer to the storage for the driver runtime state. |
protectStatus | The expected protect status to set to the EEPROM protection register. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
kStatus_FLASH_CommandFailure | Run-time error during command execution. |
status_t FLASH_EepromGetProtection | ( | flash_config_t * | config, |
uint8_t * | protectStatus | ||
) |
config | A pointer to the storage for the driver runtime state. |
protectStatus | EEPROM Protect status returned by the EEPROM IP. |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
status_t FLASH_PflashSetPrefetchSpeculation | ( | flash_prefetch_speculation_status_t * | speculationStatus | ) |
speculationStatus | The expected protect status to set to the PFlash protection register. Each bit is |
kStatus_FLASH_Success | API was executed successfully. |
kStatus_FLASH_InvalidSpeculationOption | An invalid speculation option argument is provided. |
status_t FLASH_PflashGetPrefetchSpeculation | ( | flash_prefetch_speculation_status_t * | speculationStatus | ) |
speculationStatus | Speculation status returned by the PFlash IP. |
kStatus_FLASH_Success | API was executed successfully. |