Philips LPC2194 User Manual page 279

Table of Contents

Advertisement

Philips Semiconductors
ARM-based Microcontroller
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 50. 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 "Blank
check sector(s)" command. The command handler sends the status code INVALID_COMMAND when an undefined command
is received. The IAP routine resides at 0x7FFFFFF0 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[2];
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:
#<SYMDEFS># ARM Linker, ADS1.2 [Build 826]: Last Updated: Wed May 08 16:12:23 2002
0x7fffff90 T rm_init_entry
0x7fffffa0 A rm_undef_handler
Flash Memory System and Programming
LPC2119/2129/2194/2292/2294
279
Preliminary User Manual
May 03, 2004

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2129Lpc2119Lpc2292Lpc2294

Table of Contents