![]() |
MCUXpresso SDK API Reference Manual
Rev 2.12.0
NXP Semiconductors
|
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... | |
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 API key | |
| enum | _flash_driver_api_keys { 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... | |
| struct flash_mem_desc_t |
Data Fields | |
| uint32_t | blockBase |
| A base address of the flash block. | |
| uint32_t | totalSize |
| The size of the flash block. More... | |
| uint32_t | blockCount |
| A number of flash blocks. More... | |
| 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 |
| #define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(1, 1, 0)) |
Version 1.1.0.
| #define FOUR_CHAR_CODE | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) |
| #define ALIGN_DOWN | ( | x, | |
| a | |||
| ) | (((uint32_t)(x)) & ~((uint32_t)(a)-1u)) |
| anonymous enum |
| anonymous enum |
| 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. |
| 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.
| config | The pointer to the storage for the driver runtime state. |
| start | The start address of the desired flash memory to be erased, Must be phrase-aligned. |
| lengthInBytes | The length, given in bytes to be erased, It is recommended that the length is aligned with the sector. |
| base | FMU base address. |
| 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_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.
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired flash memory to be programmed, Must be phrase-aligned. |
| src | A pointer to the source buffer of data that is to be programmed into the flash. |
| lengthInBytes | The length, given in bytes must be phrase-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_ProgramPage | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t * | src, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired flash memory to be programmed. Must be page-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 page-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_VerifyEraseAll | ( | FMU_Type * | base | ) |
| base | FMU base address. |
| kStatus_FLASH_Success | API was executed successfully. |
| kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
| 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_CommandAborOption |
| status_t FLASH_VerifyErasePhrase | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired flash memory to be verified. The start address need to be phrase-aligned. |
| lengthInBytes | The length, It is recommended that the length is aligned with the phrase. |
| 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_VerifyErasePage | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired flash memory to be verified. The start address must be page-aligned. |
| lengthInBytes | The length, It is recommended that the length is aligned with the page. |
| 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_VerifyEraseSector | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired flash memory to be verified. The start address need to be sector-aligned. |
| lengthInBytes | The length, It is recommended that the length is aligned with the page. |
| 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_VerifyEraseIFRPhrase | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired ifr memory to be verified. The start address need to be phrase-aligned. |
| lengthInBytes | The length, it is recommended that the length is aligned with the phrase. |
| 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_VerifyEraseIFRPage | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired ifr memory to be verified. The start address need to be page-aligned. |
| lengthInBytes | The length, it is recommended that the length is aligned with the page. |
| 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_VerifyEraseIFRSector | ( | flash_config_t * | config, |
| FMU_Type * | base, | ||
| uint32_t | start, | ||
| uint32_t | lengthInBytes | ||
| ) |
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired ifr memory to be verified. The start address need to be sector-aligned. |
| lengthInBytes | The length, it is recommended that the length is aligned with the page. |
| 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_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_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.
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired flash memory to be programed. The start address need to be page-aligned. |
| end | The end address of the desired flash memory to be programed. |
| seed | A pointer to the source buffer of seed that is to be programmed into the signature register . |
| signature | Returns the generated signature frome the flash specified area. |
| kStatus_FLASH_Success | API was executed successfully. |
| kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
| kStatus_FLASH_UnknownProperty | An unknown property tag. |
| kStatus_FLASH_CommandFailure | Run-time error during command execution. |
| 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_CommandAborOption | The 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.
| config | A pointer to the storage for the driver runtime state. |
| base | FMU base address. |
| start | The start address of the desired ifr memory to be programed. The start address need to be page-aligned. |
| end | The end address of the desired ifr memory to be programed. |
| seed | A pointer to the source buffer of seed that is to be programmed into the signature register . |
| signature | Returns the generated signature frome the ifr specified area. |
| kStatus_FLASH_Success | API was executed successfully. |
| kStatus_FLASH_InvalidArgument | An invalid argument is provided. |
| kStatus_FLASH_UnknownProperty | An unknown property tag. |
| kStatus_FLASH_CommandFailure | Run-time error during command execution. |
| 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_CommandAborOption | The 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
| isPreProcess,set | to true if it's before program/erase execution, set ti false if it's after the program/erase execution |