![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Files | |
file | fsl_iap.h |
Driver version | |
#define | FSL_IAP_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) |
Version 2.0.3. More... | |
Basic operations | |
status_t | IAP_ReadPartID (uint32_t *partID) |
Read part identification number. More... | |
status_t | IAP_ReadBootCodeVersion (uint32_t *bootCodeVersion) |
Read boot code version number. More... | |
void | IAP_ReinvokeISP (uint8_t ispType, uint32_t *status) |
Reinvoke ISP. More... | |
status_t | IAP_ReadUniqueID (uint32_t *uniqueID) |
Read unique identification. More... | |
status_t | IAP_ReadFactorySettings (uint32_t dstRegAddr, uint32_t *factoryValue) |
Read factory settings. More... | |
Flash operations | |
status_t | IAP_PrepareSectorForWrite (uint32_t startSector, uint32_t endSector) |
Prepare sector for write operation. More... | |
status_t | IAP_CopyRamToFlash (uint32_t dstAddr, uint32_t *srcAddr, uint32_t numOfBytes, uint32_t systemCoreClock) |
Copy RAM to flash. More... | |
status_t | IAP_EraseSector (uint32_t startSector, uint32_t endSector, uint32_t systemCoreClock) |
Erase sector. More... | |
status_t | IAP_ErasePage (uint32_t startPage, uint32_t endPage, uint32_t systemCoreClock) |
Erase page. More... | |
status_t | IAP_BlankCheckSector (uint32_t startSector, uint32_t endSector) |
Blank check sector(s) More... | |
status_t | IAP_Compare (uint32_t dstAddr, uint32_t *srcAddr, uint32_t numOfBytes) |
Compare memory contents of flash with ram. More... | |
#define FSL_IAP_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) |
anonymous enum |
enum _iap_commands |
status_t IAP_ReadPartID | ( | uint32_t * | partID | ) |
This function is used to read the part identification number.
partID | Address to store the part identification number. |
kStatus_IAP_Success | Api has been executed successfully. |
status_t IAP_ReadBootCodeVersion | ( | uint32_t * | bootCodeVersion | ) |
This function is used to read the boot code version number.
bootCodeVersion | Address to store the boot code version. |
kStatus_IAP_Success | Api has been executed successfully. |
note Boot code version is two 32-bit words. Word 0 is the major version, word 1 is the minor version.
void IAP_ReinvokeISP | ( | uint8_t | ispType, |
uint32_t * | status | ||
) |
This function is used to invoke the boot loader in ISP mode. It maps boot vectors and configures the peripherals for ISP.
ispTyoe | ISP type selection. |
status | store the possible status. |
kStatus_IAP_ReinvokeISPConfig | reinvoke configuration error. |
note The error response will be returned when IAP is disabled or an invalid ISP type selection appears. The call won't return unless an error occurs, so there can be no status code.
status_t IAP_ReadUniqueID | ( | uint32_t * | uniqueID | ) |
This function is used to read the unique id.
uniqueID | store the uniqueID. |
kStatus_IAP_Success | Api has been executed successfully. |
status_t IAP_ReadFactorySettings | ( | uint32_t | dstRegAddr, |
uint32_t * | factoryValue | ||
) |
This function reads the factory settings for calibration registers.
dstRegAddr | Address of the targeted calibration register. |
factoryValue | Store the factory value |
kStatus_IAP_Success | Api has been executed successfully. |
kStatus_IAP_ParamError | Param0 is not one of the supported calibration registers. |
status_t IAP_PrepareSectorForWrite | ( | uint32_t | startSector, |
uint32_t | endSector | ||
) |
This function prepares sector(s) for write/erase operation. This function must be called before calling the IAP_CopyRamToFlash() or IAP_EraseSector() or IAP_ErasePage() function. The end sector number must be greater than or equal to the start sector number.
startSector | Start sector number. |
endSector | End sector number. |
kStatus_IAP_Success | Api has been executed successfully. |
kStatus_IAP_NoPower | Flash memory block is powered down. |
kStatus_IAP_NoClock | Flash memory block or controller is not clocked. |
kStatus_IAP_InvalidSector | Sector number is invalid or end sector number is greater than start sector number. |
kStatus_IAP_Busy | Flash programming hardware interface is busy. |
status_t IAP_CopyRamToFlash | ( | uint32_t | dstAddr, |
uint32_t * | srcAddr, | ||
uint32_t | numOfBytes, | ||
uint32_t | systemCoreClock | ||
) |
This function programs the flash memory. Corresponding sectors must be prepared via IAP_PrepareSectorForWrite before calling this function. The addresses should be a 256 byte boundary and the number of bytes should be 256 | 512 | 1024 | 4096.
dstAddr | Destination flash address where data bytes are to be written. |
srcAddr | Source ram address from where data bytes are to be read. |
numOfBytes | Number of bytes to be written. |
systemCoreClock | SystemCoreClock in Hz. It is converted to KHz before calling the rom IAP function. When the flash controller has a fixed reference clock, this parameter is bypassed. |
kStatus_IAP_Success | Api has been executed successfully. |
kStatus_IAP_NoPower | Flash memory block is powered down. |
kStatus_IAP_NoClock | Flash memory block or controller is not clocked. |
kStatus_IAP_SrcAddrError | Source address is not on word boundary. |
kStatus_IAP_DstAddrError | Destination address is not on a correct boundary. |
kStatus_IAP_SrcAddrNotMapped | Source address is not mapped in the memory map. |
kStatus_IAP_DstAddrNotMapped | Destination address is not mapped in the memory map. |
kStatus_IAP_CountError | Byte count is not multiple of 4 or is not a permitted value. |
kStatus_IAP_NotPrepared | Command to prepare sector for write operation has not been executed. |
kStatus_IAP_Busy | Flash programming hardware interface is busy. |
status_t IAP_EraseSector | ( | uint32_t | startSector, |
uint32_t | endSector, | ||
uint32_t | systemCoreClock | ||
) |
This function erases sector(s). The end sector number must be greater than or equal to the start sector number.
startSector | Start sector number. |
endSector | End sector number. |
systemCoreClock | SystemCoreClock in Hz. It is converted to KHz before calling the rom IAP function. When the flash controller has a fixed reference clock, this parameter is bypassed. |
kStatus_IAP_Success | Api has been executed successfully. |
kStatus_IAP_NoPower | Flash memory block is powered down. |
kStatus_IAP_NoClock | Flash memory block or controller is not clocked. |
kStatus_IAP_InvalidSector | Sector number is invalid or end sector number is greater than start sector number. |
kStatus_IAP_NotPrepared | Command to prepare sector for write operation has not been executed. |
kStatus_IAP_Busy | Flash programming hardware interface is busy. |
status_t IAP_ErasePage | ( | uint32_t | startPage, |
uint32_t | endPage, | ||
uint32_t | systemCoreClock | ||
) |
This function erases page(s). The end page number must be greater than or equal to the start page number.
startPage | Start page number. |
endPage | End page number. |
systemCoreClock | SystemCoreClock in Hz. It is converted to KHz before calling the rom IAP function. When the flash controller has a fixed reference clock, this parameter is bypassed. |
kStatus_IAP_Success | Api has been executed successfully. |
kStatus_IAP_NoPower | Flash memory block is powered down. |
kStatus_IAP_NoClock | Flash memory block or controller is not clocked. |
kStatus_IAP_InvalidSector | Page number is invalid or end page number is greater than start page number. |
kStatus_IAP_NotPrepared | Command to prepare sector for write operation has not been executed. |
kStatus_IAP_Busy | Flash programming hardware interface is busy. |
status_t IAP_BlankCheckSector | ( | uint32_t | startSector, |
uint32_t | endSector | ||
) |
Blank check single or multiples sectors of flash memory. The end sector number must be greater than or equal to the start sector number. It can be used to verify the sector erasure after IAP_EraseSector call.
startSector | Start sector number. |
endSector | End sector number. |
kStatus_IAP_Success | One or more sectors are in erased state. |
kStatus_IAP_NoPower | Flash memory block is powered down. |
kStatus_IAP_NoClock | Flash memory block or controller is not clocked. |
kStatus_IAP_SectorNotblank | One or more sectors are not blank. |
status_t IAP_Compare | ( | uint32_t | dstAddr, |
uint32_t * | srcAddr, | ||
uint32_t | numOfBytes | ||
) |
This function compares the contents of flash and ram. It can be used to verify the flash memory contents after IAP_CopyRamToFlash call.
dstAddr | Destination flash address. |
srcAddr | Source ram address. |
numOfBytes | Number of bytes to be compared. |
kStatus_IAP_Success | Contents of flash and ram match. |
kStatus_IAP_NoPower | Flash memory block is powered down. |
kStatus_IAP_NoClock | Flash memory block or controller is not clocked. |
kStatus_IAP_AddrError | Address is not on word boundary. |
kStatus_IAP_AddrNotMapped | Address is not mapped in the memory map. |
kStatus_IAP_CountError | Byte count is not multiple of 4 or is not a permitted value. |
kStatus_IAP_CompareError | Destination and source memory contents do not match. |