Search the web
Sign In
New User? Sign Up
lpc2000 · LPC ARM Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Boot Monitors and remapping interrupt vectors   Message List  
Reply | Forward Message #24510 of 45919 |
I'm using an LPC2138/2148 with Rowley CrossWorks and GCC 4.1.1

Essentially, I have a boot monitor in the first two sectors of flash
that checks the primary application image against another
application image, and if required copies the upgrade over the
primary application.

Addr: 0x0000 0000 - 0x0000 1FFF (sect: 0 - 1) - Custom boot monitor
Addr: 0x0000 4000 - 0x0001 FFFF (sect: 4 - 10) - Primary Application
Addr: 0x0002 0000 - 0x0003 FFFF (sect: 11 - 14) - Upgrade Image

The boot monitor then performs a jump to the primary application,
using the method:

typedef void (*func_ptr)(void);

func_ptr func = (void*)0x4000;
func();


The primary application then reconfigures the device, trashing all
the memory used by the boot monitor - reconfiguring stack sizes and
all that jazz. After jumping to the application, interrupts no
longer function. I had a suspicion this would be the case before
starting on this, but wasn't totally sure of that until I got this
far.

I think my solutions are along the lines of...
a) Have the primary application place it's interrupt vectors in RAM
and configure MEMMAP to RAM mode.
b) Configure the boot monitor interrupt vectors to jump ahead into
the vectors of the application (i'm unsure about how suitable this
is). Interrupts are NOT used by the boot monitor.

There are bound to be other people that have implemented similar
solutions, are there any pros/cons to each method?


Is this a reasonable method in which to implement a boot monitor
(not to be confused with the boot loader of course)?

Is there a better way to jump to the main application?

Thanks very much
Cheers
Darcy




Sat Apr 28, 2007 1:28 am

darcy_will
Offline Offline
Send Email Send Email

Forward
Message #24510 of 45919 |
Expand Messages Author Sort by Date

I'm using an LPC2138/2148 with Rowley CrossWorks and GCC 4.1.1 Essentially, I have a boot monitor in the first two sectors of flash that checks the primary...
Darcy Williams
darcy_will
Offline Send Email
Apr 28, 2007
1:32 am

I just started going through the pregenerated "startup.s" provided by Rowley and found a preprocessor definition I hadn't noticed before. The answer to my...
Darcy Williams
darcy_will
Offline Send Email
Apr 28, 2007
2:46 am

... You pretty much have the general sense of how it would be done. The devil IS in the details though. On the system that I am building, there are three...
Tom Walsh
twalsh0001
Offline Send Email
Apr 28, 2007
4:35 am

That's an excellent description! Thanks! That sounds like it could have been very complicated to set up for the first time. I'm wondering if I can do without...
Darcy Williams
darcy_will
Offline Send Email
Apr 28, 2007
5:07 am

... could ... yet...? ... never ... to ... You'll probably find that your requirements are somewhat simpler than Tom's, and you can use one stack quite...
Brendan Murphy
brendanmurphy37
Offline Send Email
Apr 28, 2007
7:31 am

... return on ... For the benefit of those who are looking at abstracting a general purpose re-entrant IRQ handler from the above solution, I like to point out...
jayasooriah
Offline Send Email
Apr 28, 2007
9:33 am

... as ... In the general case, this is of course true: best not make any assumptions about the rest of the system, and to always restore it to the state you...
Brendan Murphy
brendanmurphy37
Offline Send Email
Apr 28, 2007
1:56 pm

... If it is true that one "loses the benefits of FIQ" by disabling FIQ, then the same should apply to disabling IRQ. Clearly it is not true. If you could not...
jayasooriah
Offline Send Email
Apr 28, 2007
2:47 pm

... true. I rather think you've missed the point. If you need to have an interrupt that needs on occasion to be disabled, just define it as an IRQ. ... suspend...
Brendan Murphy
brendanmurphy37
Offline Send Email
Apr 28, 2007
3:33 pm

... Every time someone does not agree with you, you accuse them of missing the point. This is why I dont like to respond to your posts. There is little point...
jayasooriah
Offline Send Email
Apr 28, 2007
3:53 pm

... Apologies, your statement: <QUOTE/ If it is true that one "loses the benefits of FIQ" by disabling FIQ, then the same should apply to disabling IRQ /END...
Brendan Murphy
brendanmurphy37
Offline Send Email
Apr 28, 2007
6:35 pm

... only if you disable them *at a time when they are needed*. DMA (to use the canonical example) is not needed while it is being set up. ... You are right of...
wouter van ooijen
wvooijen
Offline Send Email
May 5, 2007
8:52 am

... Heh, I forgot to mention, the FIQ exception is not used in my system. That is a good point though, I should be careful of that and setup some vector in the...
Tom Walsh
twalsh0001
Offline Send Email
Apr 28, 2007
3:42 pm

Hi Darcy, Looks like a lot of LPC users have given this a lot of thought. I kept things a lot simpler than the other replies I read. For the Software Interrupt...
Richard Duits
id6495
Offline Send Email
Apr 28, 2007
12:50 pm

Hi Richard, What a can of worms :) I like that little solution. I can't see it saving many instructions but I suppose if you see the need to do it, an extra...
Darcy Williams
darcy_will
Offline Send Email
Apr 28, 2007
9:28 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help