
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
606 of 808
NXP Semiconductors
UM10360
Chapter 32: LPC17xx Flash memory interface and programming
8.2 Copy RAM to Flash
8.3 Erase Sector(s)
Table 572. IAP Copy RAM to Flash command
Command
Copy RAM to Flash
Input
Command code: 51
10
Param0(DST):
Destination flash address where data bytes are to be written. This
address should be a 256 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 256 | 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 256 | 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.
Table 573. IAP Erase Sector(s) command
Command
Erase Sector(s)
Input
Command code: 52
10
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.
Return Code
CMD_SUCCESS |
BUSY |
SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION |
INVALID_SECTOR
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.