Yahoo Groups archive

Lpc2000

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

Message

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

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.