Endian-Problem ?
----- Original Message -----
From: <capiman@...>
To: <lpc2000@yahoogroups.com>
Sent: Thursday, November 18, 2004 9:42 PM
Subject: Re: [lpc2000] Re: Interrupt Handling (Vector checksum)
>
> Have you compared what value you get with your routine and perhaps load
> the
> same with my routine ?
> Is it really the same ? I see you are doing a +1 at the end ?
>
> Regards,
>
> Martin
>
> ----- Original Message -----
> From: "tom_laffey" <tom_laffey@...>
> To: <lpc2000@yahoogroups.com>
> Sent: Thursday, November 18, 2004 8:40 PM
> Subject: [lpc2000] Re: Interrupt Handling (Vector checksum)
>
>
>>
>>
>> Hi Robert,
>>
>> Thanks for your reply. I found Martin's checksum code, which is
>>
>> ivt_CRC = 0;
>> for(i = 0;i < 8; i++)
>> {
>> if(i == 5) continue; // Jump over address 0x14
>> ivt_CRC += BinaryContent_as_unsigned_long[i];
>> }
>>
>> ivt_CRC = 0 - ivt_CRC; // Negate result
>> BinaryContent_as_unsigned_long[5] = ivt_CRC;
>>
>> The code I am using is in a program to add this checksum to a
>> binary program file before downloading:
>>
>> // pBuf is char *, aligned 4
>> unsigned long * pVectors = (unsigned long *) pBuf;
>>
>> pVectors[5] = 0;
>> for( checksum = index = 0; index < 8; index++)
>> {
>> checksum += pVectors[index];
>> }
>> pVectors[5] = ~checksum + 1;
>>
>> which looks like it does the same thing as Martin's.
>>
>> This has me wondering what I am missing. When I modify the binary
>> image and load it with my ISP program, it is not recognized by the
>> Philips boot loader. I can tell by stopping the CPU and looking at
>> the PC: pc=0x7fffef32. Downloading the same image using the Philips
>> downloader (and a hex version of the executable), the program boots.
>>
>> Thanks,
>>
>>
>> Tom
>>
>>
>>
>>
>> --- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...>
>> wrote:
>>> At 06:30 PM 11/18/04 +0000, you wrote:
>>> >Did you ever solve the vector table checksum problem? Like you,
>> I've
>>> >tried the algorithm described in the manual (the one you typed
>> below)
>>> >and the boot code won't start when the file is loaded with IAP.
>> From
>>> >the description, the checksum covers the first 8 words.
>>> >
>>> >My application uses IAP for firmware updates, so long-term
>> dependency
>>> >on the Philips downloader is not an option.
>>>
>>> Take a look at the source for Martin's LPC21ISP. It does the
>> calculation
>>> and it should be simple to adapt.
>>>
>>> Robert
>>>
>>> " '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
>>
>>
>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>Message
Re: [lpc2000] Re: Interrupt Handling (Vector checksum)
2004-11-18 by capiman@t-online.de
Attachments
- No local attachments were found for this message.