Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Working with two Applications (Boot and MainApp)

2004-07-28 by givc@yahoo.com

Hi everyone,

In the project I'm working on, I'm loading two separate applications 
to the LPC2119 Flash, the first one is the Boot Application and the 
2nd is the Main Application. I make the final binary file with a 
small App I made.

The Boot App is in first two sectors and the Main App has 13 sectors 
available from 3rd to 15th sector(not at the very beginning of 3rd 
sector because I save App Version, App Size and Checksum first and 
then the Main App Code). 

#define APPLICATION_ADDRESS ((unsigned char*) 0x00004010) 
#define APPLICATION_VERSION_ADDRESS ((unsigned long*)  0x00004000)
#define APPLICATION_SIZE_ADDRESS ((unsigned long*)  0x00004004)
#define APPLICATION_CHECKSUM_ADDRESS ((unsigned short*)  0x00004008)

From the BootApp the MainApp is called this way:

(defined and declared at the beginning)
typedef void (*tFuncP)();

(In Main() function...)
tFuncP pFunction;

pFunction = (tFuncP)(APPLICATION_ADDRESS);
(*pFunction)();

Ok, when I call the MainApp, the program restarts itself and the 
BootApp is executed again. DOES ANYONE KNOWS IF THERE'S SOMETHING 
TRICKY TO DO BEFORE BE ABLE TO CALL ANOTHER APPLICATION??

Both Applications have their own entry file(in asm) and I'm using 
MEMMAP to remap the vector table to the base of RAM. Before the 
MainApp is called i copy their first 64 bytes to the base of RAM so 
it has the MainApp Vector table.

Hope somebody can help me...

Thanks in advance!

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.