![]() |
Kinetis Bootloader
2.0.0
Common bootloader for Kinetis devices
|
Collaboration diagram for C90TFS Flash Driver:Data Structures | |
| struct | flash_execute_in_ram_function_config_t |
| Flash execute-in-ram function information. More... | |
| struct | flash_swap_state_config_t |
| Flash Swap information. More... | |
| struct | flash_swap_ifr_field_config_t |
| Flash Swap IFR fields. More... | |
| union | flash_swap_ifr_field_data_t |
| Flash Swap IFR field data. More... | |
| struct | flash_operation_config_t |
| Active flash information for current operation. More... | |
| struct | flash_config_t |
| Flash driver state information. More... | |
Typedefs | |
| typedef void(* | flash_callback_t) (void) |
| callback type used for pflash block | |
Flash version | |
| enum | _flash_driver_version_constants { kFLASH_DriverVersionName = 'F', kFLASH_DriverVersionMajor = 2, kFLASH_DriverVersionMinor = 1, kFLASH_DriverVersionBugfix = 0, kFLASH_DriverVersionName = 'F', kFLASH_DriverVersionMajor = 2, kFLASH_DriverVersionMinor = 1, kFLASH_DriverVersionBugfix = 0 } |
| FLASH driver version for ROM. More... | |
Flash API key | |
| enum | _flash_driver_api_keys { kFLASH_ApiEraseKey = FOUR_CHAR_CODE('k', 'f', 'e', 'k'), kFLASH_ApiEraseKey = FOUR_CHAR_CODE('k', 'f', 'e', 'k') } |
| Enumeration for flash driver API keys. More... | |
Initialization | |
| status_t | FLASH_Init (flash_config_t *config) |
| Initializes global flash properties structure members. More... | |
| status_t | FLASH_SetCallback (flash_config_t *config, flash_callback_t callback) |
| Set the desired flash callback function. More... | |
| status_t | FLASH_PrepareExecuteInRamFunctions (flash_config_t *config) |
| Prepare 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 flash sectors encompassed by parameters passed into function. More... | |
| status_t | FLASH_EraseAllUnsecure (flash_config_t *config, uint32_t key) |
| Erases entire flash, including protected sectors. More... | |
| status_t | FLASH_EraseAllExecuteOnlySegments (flash_config_t *config, uint32_t key) |
| Erases all program flash execute-only segments defined by the FXACC registers. 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_ProgramSection (flash_config_t *config, uint32_t start, uint32_t *src, uint32_t lengthInBytes) |
| Programs flash with data at locations passed in through parameters via Program Section command. More... | |
| status_t | FLASH_EepromWrite (flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) |
| Programs EEPROM with data at locations passed in through parameters. More... | |
Reading | |
| status_t | FLASH_ReadResource (flash_config_t *config, uint32_t start, uint32_t *dst, uint32_t lengthInBytes, flash_read_resource_option_t option) |
| Read resource with data at locations passed in through parameters. More... | |
| status_t | FLASH_ReadOnce (flash_config_t *config, uint32_t index, uint32_t *dst, uint32_t lengthInBytes) |
| Read 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 user 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 entire flash at specified margin level. More... | |
| status_t | FLASH_VerifyErase (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, flash_margin_value_t margin) |
| Verifies erasure of desired flash area at specified margin level. More... | |
| status_t | FLASH_VerifyProgram (flash_config_t *config, uint32_t start, uint32_t lengthInBytes, const uint32_t *expectedData, flash_margin_value_t margin, uint32_t *failedAddress, uint32_t *failedData) |
| Verifies programming of desired flash area at specified margin level. More... | |
| status_t | FLASH_VerifyEraseAllExecuteOnlySegments (flash_config_t *config, flash_margin_value_t margin) |
| Verifies if the program flash executeonly segments have been erased to the specified read 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 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_execute_only_access_state_t *access_state) |
| Returns the access state of 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... | |
FlexRAM | |
| status_t | FLASH_SetFlexramFunction (flash_config_t *config, flash_flexram_function_option_t option) |
| Set FlexRAM Function command. More... | |
Swap | |
| status_t | FLASH_SwapControl (flash_config_t *config, uint32_t address, flash_swap_control_option_t option, flash_swap_state_config_t *returnInfo) |
| Configure Swap function or Check the swap state of Flash Module. More... | |
| status_t | FLASH_Swap (flash_config_t *config, uint32_t address, flash_swap_function_option_t option) |
| Swap the lower half flash with the higher half flaock. More... | |
FlexNVM | |
| status_t | FLASH_ProgramPartition (flash_config_t *config, flash_partition_flexram_load_option_t option, uint32_t eepromDataSizeCode, uint32_t flexnvmPartitionCode) |
| Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the FlexRAM. More... | |
Flash Protection Utilities | |
| status_t | FLASH_PflashSetProtection (flash_config_t *config, uint32_t protectStatus) |
| Set PFLASH Protection to the intended protection status. More... | |
| status_t | FLASH_PflashGetProtection (flash_config_t *config, uint32_t *protectStatus) |
| Get PFLASH Protection Status. More... | |
| status_t | FLASH_DflashSetProtection (flash_config_t *config, uint8_t protectStatus) |
| Set DFLASH Protection to the intended protection status. More... | |
| status_t | FLASH_DflashGetProtection (flash_config_t *config, uint8_t *protectStatus) |
| Get DFLASH Protection Status. More... | |
| status_t | FLASH_EepromSetProtection (flash_config_t *config, uint8_t protectStatus) |
| Set EEPROM Protection to the intended protection status. More... | |
| status_t | FLASH_EepromGetProtection (flash_config_t *config, uint8_t *protectStatus) |
| Get DFLASH Protection Status. More... | |
The flash provides the C90TFS Flash driver of Kinetis devices with the C90TFS Flash module inside. The flash provides general APIs to handle specific operations on C90TFS/FTFx 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.
| struct flash_execute_in_ram_function_config_t |
| struct flash_swap_state_config_t |
Flash Swap information.
| Data Fields | ||
|---|---|---|
| flash_swap_block_status_t | currentSwapBlockStatus |
Current swap block status. |
| flash_swap_state_t | flashSwapState |
Current swap system status. |
| flash_swap_block_status_t | nextSwapBlockStatus |
Next swap block status. |
| struct flash_swap_ifr_field_config_t |
Flash Swap IFR fields.
| union flash_swap_ifr_field_data_t |
Flash Swap IFR field data.
Collaboration diagram for flash_swap_ifr_field_data_t:| Data Fields | ||
|---|---|---|
| uint32_t | flashSwapIfrData[2] |
Flash Swap IFR field data . |
| flash_swap_ifr_field_config_t | flashSwapIfrField |
Flash Swap IFR field struct. |
| struct flash_operation_config_t |
Active flash information for current operation.
| struct flash_config_t |
Flash driver state information.
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 | DFlashBlockBase |
For FlexNVM device, this is the base address of D-Flash memory (FlexNVM memory); For non-FlexNVM device, this field is unused |
| uint32_t | DFlashTotalSize |
For FlexNVM device, this is total size of the FlexNVM memory; For non-FlexNVM device, this field is unused |
| uint32_t | EEpromTotalSize |
For FlexNVM device, this is the size in byte of EEPROM area which was partitioned from FlexRAM; For non-FlexNVM device, this field is unused |
| uint32_t * | flashExecuteInRamFunctionInfo |
Info struct of flash execute-in-ram function. |
| uint32_t | FlexRAMBlockBase |
For FlexNVM device, this is the base address of FlexRAM For non-FlexNVM device, this is the base address of acceleration RAM memory |
| uint32_t | FlexRAMTotalSize |
For FlexNVM device, this is the size of FlexRAM For non-FlexNVM device, this is the size of acceleration RAM memory |
| uint32_t | PFlashAccessSegmentCount |
Number of PFlash access segments. |
| uint32_t | PFlashAccessSegmentSize |
Size in bytes of a access segment of PFlash. |
| uint32_t | PFlashBlockBase |
Base address of the first PFlash block |
| uint32_t | PFlashBlockCount |
Number of PFlash blocks. |
| flash_callback_t | PFlashCallback |
Callback function for flash API. |
| uint32_t | PFlashSectorSize |
Size in bytes of a sector of PFlash. |
| uint32_t | PFlashTotalSize |
Size of all combined PFlash block. |
Enumeration for flash driver API keys.
| Enumerator | |
|---|---|
| kFLASH_ApiEraseKey |
Key value used to validate all flash erase APIs. |
| kFLASH_ApiEraseKey |
Key value used to validate all flash erase APIs. |
FLASH driver version for ROM.
Constants for execute-in-ram flash function.
Enumeration for the range of special-purpose flash resource.
| enum _flash_status |
Flash driver status codes.
Enumeration for the three possible flash execute access levels.
| enum flash_margin_value_t |
Enumeration for supported flash margin levels.
| enum flash_property_tag_t |
Enumeration for various flash properties.
Enumeration for the three possible flash protection levels.
Enumeration for the two possible options of flash read resource command.
Enumeration for the three possible flash security states.
Enumeration for the possible options of Swap Control commands.
| enum flash_swap_state_t |
Enumeration for the possible flash swap status.
| status_t FLASH_DflashGetProtection | ( | flash_config_t * | config, |
| uint8_t * | protectStatus | ||
| ) |
Get DFLASH Protection Status.
| config | Pointer to storage for the driver runtime state. |
| protectStatus | DFlash Protect status returned by PFlash IP. Each bit is corresponding to protection of 1/8 of the total DFlash. The least significant bit is corresponding to the lowest address area of DFlash. The most significant bit is corresponding to the highest address area of DFlash and so on. There are two possible cases as below: 0: this area is protected. 1: this area is unprotected. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_CommandNotSupported | Flash api is not supported |
| status_t FLASH_DflashSetProtection | ( | flash_config_t * | config, |
| uint8_t | protectStatus | ||
| ) |
Set DFLASH Protection to the intended protection status.
| config | Pointer to storage for the driver runtime state. |
| protectStatus | The expected protect status user wants to set to DFlash protection register. Each bit is corresponding to protection of 1/8 of the total DFlash. The least significant bit is corresponding to the lowest address area of DFlash. The most significant bit is corresponding to the highest address area of DFlash. There are two possible cases as shown below: 0: this area is protected. 1: this area is unprotected. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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 | ||
| ) |
Get DFLASH Protection Status.
| config | Pointer to storage for the driver runtime state. |
| protectStatus | DFlash Protect status returned by PFlash IP. Each bit is corresponding to protection of 1/8 of the total EEPROM. The least significant bit is corresponding to the lowest address area of EEPROM. The most significant bit is corresponding to the highest address area of EEPROM. There are two possible cases as below: 0: this area is protected. 1: this area is unprotected. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_CommandNotSupported | Flash api is not supported. |
| status_t FLASH_EepromSetProtection | ( | flash_config_t * | config, |
| uint8_t | protectStatus | ||
| ) |
Set EEPROM Protection to the intended protection status.
| config | Pointer to storage for the driver runtime state. |
| protectStatus | The expected protect status user wants to set to EEPROM protection register. Each bit is corresponding to protection of 1/8 of the total EEPROM. The least significant bit is corresponding to the lowest address area of EEPROM. The most significant bit is corresponding to the highest address area of EEPROM, and so on. There are two possible cases as shown below: 0: this area is protected. 1: this area is unprotected. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_CommandNotSupported | Flash api is not supported |
| kStatus_FLASH_CommandFailure | Run-time error during command execution. |
| status_t FLASH_EepromWrite | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint8_t * | src, | ||
| uint32_t | lengthInBytes | ||
| ) |
Programs EEPROM with data at locations passed in through parameters.
This function programs the Emulated EEPROM with desired data for a given flash area as determined by the start address and length.
| config | Pointer to storage for the driver runtime state. |
| start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
| src | 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 | Invalid argument is provided. |
| kStatus_FLASH_AddressError | Address is out of range. |
| kStatus_FLASH_SetFlexramAsEepromError | Failed to set flexram as eeprom. |
| kStatus_FLASH_ProtectionViolation | The program/erase operation is requested to execute on protected areas. |
| kStatus_FLASH_RecoverFlexramAsRamError | Failed to recover flexram as ram |
| status_t FLASH_Erase | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint32_t | lengthInBytes, | ||
| uint32_t | key | ||
| ) |
Erases flash sectors encompassed by parameters passed into function.
This function erases the appropriate number of flash sectors based on the desired start address and length.
| config | Pointer to 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 | value used to validate all flash erase APIs. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| kStatus_FLASH_AddressError | Address is out of range. |
| 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. |
| status_t FLASH_EraseAll | ( | flash_config_t * | config, |
| uint32_t | key | ||
| ) |
Erases entire flash.
| config | Pointer to storage for the driver runtime state. |
| key | value used to validate all flash erase APIs. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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_PartitionStatusUpdateFailure | Failed to update partition status |
| status_t FLASH_EraseAllExecuteOnlySegments | ( | flash_config_t * | config, |
| uint32_t | key | ||
| ) |
Erases all program flash execute-only segments defined by the FXACC registers.
| config | Pointer to storage for the driver runtime state. |
| key | value used to validate all flash erase APIs. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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. |
| status_t FLASH_EraseAllUnsecure | ( | flash_config_t * | config, |
| uint32_t | key | ||
| ) |
Erases entire flash, including protected sectors.
| config | Pointer to storage for the driver runtime state. |
| key | value used to validate all flash erase APIs. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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_PartitionStatusUpdateFailure | Failed to update partition status |
| status_t FLASH_GetProperty | ( | flash_config_t * | config, |
| flash_property_tag_t | whichProperty, | ||
| uint32_t * | value | ||
| ) |
Returns the desired flash property.
| config | Pointer to storage for the driver runtime state. |
| whichProperty | The desired property from the list of properties in enum flash_property_tag_t |
| value | Pointer to the value returned for the desired flash property |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_UnknownProperty | unknown property tag |
| status_t FLASH_GetSecurityState | ( | flash_config_t * | config, |
| flash_security_state_t * | state | ||
| ) |
Returns the security state via the pointer passed into the function.
This function retrieves the current Flash security status, including the security enabling state and the backdoor key enabling state.
| config | Pointer to storage for the driver runtime state. |
| state | Pointer to the value returned for the current security status code: |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| status_t FLASH_Init | ( | flash_config_t * | config | ) |
Initializes global flash properties structure members.
This function checks and initializes Flash module for the other Flash APIs.
| config | Pointer to storage for the driver runtime state. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_ExecuteInRamFunctionNotReady | Execute-in-ram function is not available. |
| kStatus_FLASH_PartitionStatusUpdateFailure | Failed to update partition status. |
| status_t FLASH_IsExecuteOnly | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint32_t | lengthInBytes, | ||
| flash_execute_only_access_state_t * | access_state | ||
| ) |
Returns the access state of desired flash area via the pointer passed into the function.
This function retrieves the current Flash access status for a given flash area as determined by the start address and length.
| config | Pointer to 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. |
| access_state | Pointer to the value returned for the current access status code for the desired flash area. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| kStatus_FLASH_AddressError | Address is out of range. |
| 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 desired flash area via the pointer passed into the function.
This function retrieves the current Flash protect status for a given flash area as determined by the start address and length.
| config | Pointer to 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 | 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 | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| kStatus_FLASH_AddressError | Address is out of range. |
| status_t FLASH_PflashGetProtection | ( | flash_config_t * | config, |
| uint32_t * | protectStatus | ||
| ) |
Get PFLASH Protection Status.
| config | Pointer to storage for the driver runtime state. |
| protectStatus | Protect status returned by PFlash IP. Each bit is corresponding to protection of 1/32 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. Thee are two possible cases as below: 0: this area is protected. 1: this area is unprotected. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| status_t FLASH_PflashSetProtection | ( | flash_config_t * | config, |
| uint32_t | protectStatus | ||
| ) |
Set PFLASH Protection to the intended protection status.
| config | Pointer to storage for the driver runtime state. |
| protectStatus | The expected protect status user wants to set to PFlash protection register. Each bit is corresponding to protection of 1/32 of the total PFlash. The least significant bit is corresponding to the lowest address area of P-Flash. 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. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_CommandFailure | Run-time error during command execution. |
| status_t FLASH_PrepareExecuteInRamFunctions | ( | flash_config_t * | config | ) |
Prepare flash execute-in-ram functions.
| config | Pointer to storage for the driver runtime state. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| 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.
This function programs the flash memory with desired data for a given flash area as determined by the start address and length.
| config | Pointer to storage for the driver runtime state. |
| start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
| src | 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 | 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 command execution. |
| status_t FLASH_ProgramOnce | ( | flash_config_t * | config, |
| uint32_t | index, | ||
| uint32_t * | src, | ||
| uint32_t | lengthInBytes | ||
| ) |
Programs Program Once Field through parameters.
This function programs the Program Once Field with desired data for a given flash area as determined by the index and length.
| config | Pointer to storage for the driver runtime state. |
| index | The index indicating which area of Program Once Field to be programmed. |
| src | 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 | 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 command execution. |
| status_t FLASH_ProgramPartition | ( | flash_config_t * | config, |
| flash_partition_flexram_load_option_t | option, | ||
| uint32_t | eepromDataSizeCode, | ||
| uint32_t | flexnvmPartitionCode | ||
| ) |
Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the FlexRAM.
| config | Pointer to storage for the driver runtime state. |
| option | The option used to set FlexRAM load behavior during reset. |
| eepromDataSizeCode | Determines the amount of FlexRAM used in each of the available EEPROM subsystems. |
| flexnvmPartitionCode | Specifies how to split the FlexNVM block between data flash memory and EEPROM backup memory supporting EEPROM functions. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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 command execution. |
| status_t FLASH_ProgramSection | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint32_t * | src, | ||
| uint32_t | lengthInBytes | ||
| ) |
Programs flash with data at locations passed in through parameters via Program Section command.
This function programs the flash memory with desired data for a given flash area as determined by the start address and length.
| config | Pointer to storage for the driver runtime state. |
| start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
| src | 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 | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| kStatus_FLASH_AddressError | Address is out of range. |
| kStatus_FLASH_SetFlexramAsRamError | Failed to set flexram as ram |
| 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_RecoverFlexramAsEepromError | Failed to recover flexram as eeprom |
| status_t FLASH_ReadOnce | ( | flash_config_t * | config, |
| uint32_t | index, | ||
| uint32_t * | dst, | ||
| uint32_t | lengthInBytes | ||
| ) |
Read Program Once Field through parameters.
This function reads the read once feild with given index and length
| config | Pointer to storage for the driver runtime state. |
| index | The index indicating the area of program once field to be read. |
| dst | 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 | 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 command execution. |
| status_t FLASH_ReadResource | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint32_t * | dst, | ||
| uint32_t | lengthInBytes, | ||
| flash_read_resource_option_t | option | ||
| ) |
Read resource with data at locations passed in through parameters.
This function reads the flash memory with desired location for a given flash area as determined by the start address and length.
| config | Pointer to storage for the driver runtime state. |
| start | The start address of the desired flash memory to be programmed. Must be word-aligned. |
| dst | 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 read. Must be word-aligned. |
| option | The resource option which indicates which area should be read back. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| 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. |
| status_t FLASH_SecurityBypass | ( | flash_config_t * | config, |
| const uint8_t * | backdoorKey | ||
| ) |
Allows user to bypass security with a backdoor key.
If the MCU is in secured state, this function will unsecure the MCU by comparing the provided backdoor key with ones in the Flash Configuration Field.
| config | Pointer to storage for the driver runtime state. |
| backdoorKey | Pointer to the user buffer containing the backdoor key. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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 command execution. |
| status_t FLASH_SetCallback | ( | flash_config_t * | config, |
| flash_callback_t | callback | ||
| ) |
Set the desired flash callback function.
| config | Pointer to storage for the driver runtime state. |
| callback | callback function to be stored in driver |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| status_t FLASH_SetFlexramFunction | ( | flash_config_t * | config, |
| flash_flexram_function_option_t | option | ||
| ) |
Set FlexRAM Function command.
| config | Pointer to storage for the driver runtime state. |
| option | The option used to set work mode of FlexRAM |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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 command execution. |
| status_t FLASH_Swap | ( | flash_config_t * | config, |
| uint32_t | address, | ||
| flash_swap_function_option_t | option | ||
| ) |
Swap the lower half flash with the higher half flaock.
| config | Pointer to storage for the driver runtime state. |
| address | Address used to configure the flash swap function |
| option | The possible option used to configure Flash Swap function or check the flash swap status |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| kStatus_FLASH_SwapIndicatorAddressError | Swap indicator address 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_SwapSystemNotInUninitialized | Swap system is not in uninitialzed state |
| status_t FLASH_SwapControl | ( | flash_config_t * | config, |
| uint32_t | address, | ||
| flash_swap_control_option_t | option, | ||
| flash_swap_state_config_t * | returnInfo | ||
| ) |
Configure Swap function or Check the swap state of Flash Module.
| config | Pointer to storage for the driver runtime state. |
| address | Address used to configure the flash swap function |
| option | The possible option used to configure Flash Swap function or check the flash swap status |
| returnInfo | Pointer to the data which is used to return the information of flash swap. |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | Invalid argument is provided. |
| kStatus_FLASH_AlignmentError | Parameter is not aligned with specified baseline. |
| kStatus_FLASH_SwapIndicatorAddressError | Swap indicator address 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. |
| status_t FLASH_VerifyErase | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint32_t | lengthInBytes, | ||
| flash_margin_value_t | margin | ||
| ) |
Verifies erasure of desired flash area at specified margin level.
This function will check the appropriate number of flash sectors based on the desired start address and length to see if the flash have been erased to the specified read margin level.
| config | Pointer to 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 | 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 command execution. |
| status_t FLASH_VerifyEraseAll | ( | flash_config_t * | config, |
| flash_margin_value_t | margin | ||
| ) |
Verifies erasure of entire flash at specified margin level.
This function will check to see if the flash have been erased to the specified read margin level.
| config | Pointer to storage for the driver runtime state. |
| margin | Read margin choice |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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 command execution. |
| status_t FLASH_VerifyEraseAllExecuteOnlySegments | ( | flash_config_t * | config, |
| flash_margin_value_t | margin | ||
| ) |
Verifies if the program flash executeonly segments have been erased to the specified read margin level.
| config | Pointer to storage for the driver runtime state. |
| margin | Read margin choice |
| kStatus_FLASH_Success | Api was executed successfully. |
| kStatus_FLASH_InvalidArgument | 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 command execution. |
| status_t FLASH_VerifyProgram | ( | flash_config_t * | config, |
| uint32_t | start, | ||
| uint32_t | lengthInBytes, | ||
| const uint32_t * | expectedData, | ||
| flash_margin_value_t | margin, | ||
| uint32_t * | failedAddress, | ||
| uint32_t * | failedData | ||
| ) |
Verifies programming of desired flash area at specified margin level.
This function verifies the data programed in the flash memory using the Flash Program Check Command and compares it with expected data for a given flash area as determined by the start address and length.
| config | Pointer to 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 | Pointer to the expected data that is to be verified against. |
| margin | Read margin choice |
| failedAddress | Pointer to returned failing address. |
| failedData | Pointer to returned failing data. Some derivitives do not included 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 | 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 command execution. |