Yahoo Groups archive

Lpc2000

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

Thread

Is there an elegant way to set interrupt vector 0x14?

Is there an elegant way to set interrupt vector 0x14?

2004-03-06 by embedder22

Hello everybody,

I am starting to evaluate LPC2100 family and I've got a question 
about interrupt vector 0x14, which is checked by the bootloader. Is 
there a way to tell the linker, that it must be an inverted checksum 
of remaining vectors? Or Philips ISP utility automaticaly sets it to 
a proper value?
Isn't there also a shortcomming in a bootloader logic? Suppose for 
example that the flash is unprogrammed (all vectors are 
0xffffffff's). So their checksum is 0, which for the bootloader is a 
valid program! Or may be the checksum, which is used is not simple 
EORing of all 8 vectors?

Regards,
Ivan

Re: Is there an elegant way to set interrupt vector 0x14?

2004-03-07 by embeddedjanitor

--- In lpc2000@yahoogroups.com, "embedder22" <ivanov_i@s...> wrote:
> Hello everybody,
> 
> I am starting to evaluate LPC2100 family and I've got a question 
> about interrupt vector 0x14, which is checked by the bootloader. Is 
> there a way to tell the linker, that it must be an inverted
checksum 
> of remaining vectors? Or Philips ISP utility automaticaly sets it
to 
> a proper value?
> Isn't there also a shortcomming in a bootloader logic? Suppose for 
> example that the flash is unprogrammed (all vectors are 
> 0xffffffff's). So their checksum is 0, which for the bootloader is
a 
> valid program! Or may be the checksum, which is used is not simple 
> EORing of all 8 vectors?
> 
> Regards,
> Ivan

Ivan

I can't think of an easy way to do this with the standard tools 
(linker etc), but I guess you could write an assembler macro if you 
were keen enough.

The check just **adds** up the first 8 vectors. The sum must be zero. 
If you add up eight FFFFFFFFs you'll end up with -8, which won't pass.

The simplest way to do the calc is as follows:

int i;
U32 sum
U32 *vector;// pointer to vector region

sum = 0;
for(i=0; i < 8; i++)
  if(i != 5) sum += vector[i];
vector[5] = -sum;

If you're using the ISP tools they should be doing this for you
during 
the download. If you want to do it yourself, then just write a simple 
C program to post-massage the code.

-- Charles

Re: [lpc2000] Re: Is there an elegant way to set interrupt vector 0x14?

2004-03-07 by Robert Adsett

At 07:59 AM 3/7/04 +0000, you wrote:
> > I am starting to evaluate LPC2100 family and I've got a question
> > about interrupt vector 0x14, which is checked by the bootloader. Is
> > there a way to tell the linker, that it must be an inverted
>checksum
> > of remaining vectors? Or Philips ISP utility automaticaly sets it
>to
> > a proper value?

The Philips ISP program does indeed do this.

> > Isn't there also a shortcomming in a bootloader logic? Suppose for
> > example that the flash is unprogrammed (all vectors are
> > 0xffffffff's). So their checksum is 0, which for the bootloader is
>a
> > valid program! Or may be the checksum, which is used is not simple
> > EORing of all 8 vectors?

Since the boot logic only checks the exception vectors, I don't see that it 
matters.  It doesn't guarantee that the program is complete anyway.  It's 
also more checking than at least some ISP chips do (they simply execute 
whatever is there).


" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

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.