Yahoo Groups archive

Lpc2000

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

Message

Re: Working with two Applications (Boot and MainApp)

2004-07-29 by Leighton Rowe

You're keeping the address list and the BootApp close together , 
which is a safe thing todo. Try see if u can call an application 
that's further down in the flash...say 0x0001c400. Success in this 
means that u can branch to any flash location u want.

I wasn't able to branch that far using C-code as all i got were 
prefetch abort errors...not sure why. I'm resorting to an assembly 
boot routine that's similar to the C Code u described. It works fine 
works fine as the PC can branch anywhere with ease.



--- In lpc2000@yahoogroups.com, givc@y... wrote:
> Nevermind... I found out that the problem was when the 2nd 
> Application tried to set the VPB clock again. I just skip that 
> setting in the 2nd app and it all works great!
> 
> --- In lpc2000@yahoogroups.com, givc@y... wrote:
> > 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.