UM10237_2 © NXP B.V. 2008. All rights reserved.
User manual Rev. 02 — 19 December 2008 690 o f 792
NXP Semiconductors UM10237
Chapter 30: LPC24XX Flash memory programming firmware
10. IAP commands
For in application programming the IAP routine should be called with a word pointer in
register r0 pointing to memory (RAM) containing command code and parameters. Result
of the IAP command is returned in the result table pointed to by register r1. The user can
reuse the command table for result by passing the same pointer in registers r0 and r1. The
parameter table should be big enough to hold all the results in case if number of results
are more than number of parameters. Parameter passing is illustrated in the
Figure 30–140. The number of parameters and results vary according to the IAP
command. The maximum number of parameters is 5, passed to the "Copy RAM to
FLASH" command. The maximum number of results is 2, returned by the "Blankcheck
sector(s)" command. The command handler sends the status code INVALID_COMMAND
when an undefined command is received. The IAP routine resides at 0x7FFF FFF0
location and it is thumb code.
The IAP function could be called in the following way using C.
3 DST_ADDR_ERROR Destination address is not on a correct boundary.
4 SRC_ADDR_NOT_MAPPED Source address is not mapped in the memory map.
Count value is taken in to consideration where
applicable.
5 DST_ADDR_NOT_MAPPED Destination address is not mapped in the memory
map. Count value is taken in to consideration
where applicable.
6 COUNT_ERROR Byte count is not multiple of 4 or is not a permitted
value.
7 INVALID_SECTOR Sector number is invalid or end sector number is
greater than start sector number.
8 SECTOR_NOT_BLANK Sector is not blank.
9 SECTOR_NOT_PREPARED_FOR_
WRITE_OPERATION Command to prepare sector for write operation
was not executed.
10 COMPARE_ERROR Source and destination data not equal.
11 BUSY Flash programming hardware interface is busy.
12 PARAM_ERROR Insufficient number of parameters or invalid
parameter.
13 ADDR_ERROR Address is not on word boundary.
14 ADDR_NOT_MAPPED Address is not mapped in the memory map. Count
value is taken in to consideration where applicable.
15 CMD_LOCKED Command is locked.
16 INVALID_CODE Unlock code is invalid.
17 INVALID_BAUD_RATE Invalid baud rate setting.
18 INVALID_STOP_BIT Invalid stop bit setting.
19 CODE_READ_PROTECTION_
ENABLED Code read protection enabled.
Table 620. ISP Retu rn Codes Summary
Return
Code Mnemonic Description