HI, Actually i am doing IAP PROGRAMMING FOR lpc 2468.I am displaying the menu using uart 2 to run,progarm the user code. whenever i reset my controller the menu gets diaplayed and always ask for a command whether to run, program. my question is ,if i have programmed user code at 0x10000 location ,the next time when i reset my controller how can my controller run the user code and when iwant to change my application code how can i go back to IAP MODE i.e. how can i switch between IAP and user application mode????
I am not aware of anything called "IAP mode". You can, while in user mode or privileged mode, use IAP functions by addressing their fixed location in on-chip ROM.
Note that IAP stands for In-Application-Programming - so to say "IAP Programming" is a tautology:
dictionary.cambridge.org/.../tautology
"how can my controller run the user code"
Take a look at your menu code to see what it does when you select the 'Run' option - and do that!
"and when iwant to change my application code how can i go back to IAP MODE"
Take a look at your menu code to see what it does when you select the 'Program' option - and do that!
You really have to think out a suitable answer to your questions - you know your needs and requirements.
One alternative: Check a specific processor pin. If held active, then display menu. If no valid CRC for applicatino area, then display menu. Else auto-start application.
Or store a flag in a flash sector - the application can then have a menu or other way to undertsand that it should do IAP to write a flag "upgrade me" and then do a watchdog reset to force the board back into your own boot loader.
Or always wait 3 seconds in the boot loader. If no data received on serial port during these three seconds (and there is a valid program in the application area) then continue to start the application. Else, display boot menu.
Invent any number of other alternatives for the boot loader to decide if it should start the application or wait for the download of new firmware.