NXP Semiconductors LPC24XX UM10237 User Manual
Page 691
![background image](/manuals/190592/691/background.png)
UM10237_4
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 04 — 26 August 2009
691 of 792
NXP Semiconductors
UM10237
Chapter 30: LPC24XX Flash memory programming firmware
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.
Define the IAP location entry point. Since the 0th bit of the IAP location is set there will be
a change to Thumb instruction set when the program counter branches to this address.
#define IAP_LOCATION 0x7ffffff1
Define data structure or pointers to pass IAP command table and result table to the IAP
function:
unsigned long command[5];
unsigned long result[3];
or
unsigned long * command;
unsigned long * result;
command=(unsigned long *) 0x……
result= (unsigned long *) 0x……
Define pointer to function type, which takes two parameters and returns void. Note the IAP
returns the result with the base address of the table residing in R1.
typedef void (*IAP)(unsigned int [],unsigned int[]);
IAP iap_entry;
Setting function pointer:
iap_entry=(IAP) IAP_LOCATION;
Whenever you wish to call IAP you could use the following statement.
iap_entry (command, result);
The IAP call could be simplified further by using the symbol definition file feature
supported by ARM Linker in ADS (ARM Developer Suite). You could also call the IAP
routine using assembly code.
The following symbol definitions can be used to link IAP routine and user application:
#
0x7fffff90 T rm_init_entry
0x7fffffa0 A rm_undef_handler
0x7fffffb0 A rm_prefetchabort_handler
0x7fffffc0 A rm_dataabort_handler
0x7fffffd0 A rm_irqhandler
0x7fffffe0 A rm_irqhandler2
0x7ffffff0 T iap_entry