UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
1189 of 1269
NXP Semiconductors
UM10503
Chapter 46: LPC43xx flash programming/ISP and IAP
46.8.4 Erase Sectors
Table 1045.IAP Copy RAM to Flash command
Command
Copy RAM to Flash
Input
Command code: 51 (decimal)
Param0(DST):
Destination flash address where data bytes are to be written. This
address should be a 512 byte boundary.
Param1(SRC):
Source RAM address from which data bytes are to be read. This
address should be a word boundary.
Param2:
Number of bytes to be written. Should be 512 | 1024 | 4096.
Param3:
CPU Clock Frequency (CCLK) in kHz.
Return Code
CMD_SUCCESS |
SRC_ADDR_ERROR (Address not a word boundary) |
DST_ADDR_ERROR (Address not on correct boundary) |
SRC_ADDR_NOT_MAPPED |
DST_ADDR_NOT_MAPPED |
COUNT_ERROR (Byte count is not 512 | 1024 | 4096) |
SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION |
BUSY
Result
None
Description
This command is used to program the flash memory. The affected sectors should
be prepared first by calling "Prepare Sector for Write Operation" command. The
affected sectors are automatically protected again once the copy command is
successfully executed.
Stack usage
208 B
Table 1046.IAP Erase Sectors command
Command
Erase Sectors
Input
Command code: 52 (decimal)
Param0:
Start Sector Number
Param1:
End Sector Number (should be greater than or equal to start sector
number).
Param2:
CPU Clock Frequency (CCLK) in kHz.
Param3:
Flash bank (0 = flash bank A, 1 = flash bank B)
Return Code
CMD_SUCCESS |
BUSY |
SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION |
INVALID_SECTOR | INVALID_FLASH_UNIT
Result
None
Description
This command is used to erase a sector or multiple sectors of on-chip flash
memory. To erase a single sector use the same "Start" and "End" sector numbers.
Stack usage
136 B