MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Files | |
file | fsl_iap.h |
Data Structures | |
struct | flash_ecc_log_t |
Flash ECC log info. More... | |
struct | flash_mode_config_t |
Flash controller paramter config. More... | |
struct | flash_ffr_config_t |
Flash controller paramter config. More... | |
struct | flash_config_t |
Flash driver state information. More... | |
Variables | |
uint32_t | flash_config_t::PFlashBlockBase |
A base address of the first PFlash block. | |
uint32_t | flash_config_t::PFlashTotalSize |
The size of the combined PFlash block. More... | |
uint32_t | flash_config_t::PFlashBlockCount |
A number of PFlash blocks. More... | |
uint32_t | flash_config_t::PFlashPageSize |
The size in bytes of a page of PFlash. More... | |
uint32_t | flash_config_t::PFlashSectorSize |
The size in bytes of a sector of PFlash. More... | |
Flash version | |
enum | _flash_driver_version_constants { kFLASH_DriverVersionName = 'F', kFLASH_DriverVersionMajor = 2, kFLASH_DriverVersionMinor = 0, kFLASH_DriverVersionBugfix = 0 } |
Flash driver version for ROM. More... | |
#define | MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) |
Constructs the version number for drivers. More... | |
#define | FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Flash driver version for SDK. More... | |
Flash configuration | |
#define | FSL_FEATURE_FLASH_IP_IS_C040HD_ATFC (1) |
Flash IP Type. More... | |
#define | FSL_FEATURE_FLASH_IP_IS_C040HD_FC (0) |
Flash API key | |
enum | _flash_driver_api_keys { kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', '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... | |
Erasing | |
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... | |
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... | |
Verification | |
status_t | FLASH_VerifyErase (flash_config_t *config, uint32_t start, uint32_t lengthInBytes) |
Verifies an erasure of the desired flash area at a specified margin level. More... | |
status_t | FLASH_VerifyProgram (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, const uint8_t *expectedData, uint32_t *failedAddress, uint32_t *failedData) |
Verifies programming of the desired flash area at a specified margin level. More... | |
Properties | |
status_t | FLASH_GetProperty (flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) |
Returns the desired flash property. More... | |
struct flash_ecc_log_t |
struct flash_mode_config_t |
struct flash_ffr_config_t |
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.
Data Fields | |
uint32_t | PFlashBlockBase |
A base address of the first PFlash block. | |
uint32_t | PFlashTotalSize |
The size of the combined PFlash block. More... | |
uint32_t | PFlashBlockCount |
A number of PFlash blocks. More... | |
uint32_t | PFlashPageSize |
The size in bytes of a page of PFlash. More... | |
uint32_t | PFlashSectorSize |
The size in bytes of a sector of PFlash. More... | |
#define MAKE_VERSION | ( | major, | |
minor, | |||
bugfix | |||
) | (((major) << 16) | ((minor) << 8) | (bugfix)) |
#define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Version 2.0.0.
#define FSL_FEATURE_FLASH_IP_IS_C040HD_ATFC (1) |
#define kStatusGroupGeneric 0 |
#define MAKE_STATUS | ( | group, | |
code | |||
) | ((((group)*100) + (code))) |
#define FOUR_CHAR_CODE | ( | a, | |
b, | |||
c, | |||
d | |||
) | (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) |
enum _flash_status |
enum flash_property_tag_t |
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_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
kStatus_FLASH_EccError | A correctable or uncorrectable error during command execution. |
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. |
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_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
kStatus_FLASH_EccError | A correctable or uncorrectable error during command execution. |
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.
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_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
kStatus_FLASH_EccError | A correctable or uncorrectable error during command execution. |
status_t FLASH_VerifyErase | ( | flash_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes | ||
) |
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. |
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. |
margin | Read margin choice. |
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_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
kStatus_FLASH_EccError | A correctable or uncorrectable error during command execution. |
status_t FLASH_VerifyProgram | ( | flash_config_t * | config, |
uint32_t | start, | ||
uint32_t | lengthInBytes, | ||
const uint8_t * | expectedData, | ||
uint32_t * | failedAddress, | ||
uint32_t * | failedData | ||
) |
This function verifies the data programed 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.
config | A pointer to the storage for the driver runtime state. |
start | The start address of the desired flash memory to be verified. Must be word-aligned. |
lengthInBytes | The length, given in bytes (not words or long-words), to be verified. Must be word-aligned. |
expectedData | A pointer to the expected data that is to be verified against. |
margin | Read margin choice. |
failedAddress | A pointer to the returned failing address. |
failedData | A 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. |
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_AccessError | Invalid instruction codes and out-of bounds addresses. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandFailure | Run-time error during the command execution. |
kStatus_FLASH_CommandNotSupported | Flash API is not supported. |
kStatus_FLASH_EccError | A correctable or uncorrectable error during command execution. |
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. |
uint32_t flash_config_t::PFlashTotalSize |
uint32_t flash_config_t::PFlashBlockCount |
uint32_t flash_config_t::PFlashPageSize |
uint32_t flash_config_t::PFlashSectorSize |