avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Embedding CRC into hex file


From: Bob Paddock
Subject: Re: [avr-gcc-list] Embedding CRC into hex file
Date: Tue, 27 Mar 2007 15:01:44 -0400
User-agent: Opera Mail/9.10 (Win32)

On Tue, 27 Mar 2007 14:34:27 -0400, larry barello <address@hidden> wrote:

Srec_cat has CCITT 16 built in.  What stopping you?

How do you initialize it with all ones?  Last I looked
it was initialized with all zeros, and I did
not see away to initialize it otherwise.

If you initialize with zero, you miss extraneous
leading zero insertions.

What is the magic # you refer to?

Store the compliment of the CRC value, least significant
byte first, as the last two bytes past your data.

Then when you do your CRC, you CRC those two
bytes as if they where just to more bytes of data.
If the CRC is valid the answer will *always* be 0xF0B8,
any other answer and the CRC is bad.

Usual CRC caveats apply, such as them being valid
only over bit blocks under the size allowed by
the syndrome length... Someone will want to shift things
from the other direction and say the magic number
is really 0x1D0F etc...

BTW Thanks.  The solution appears simple.

Your welcome.

On my far to long ToDo list is to get a proper CCITT-CRC16 into
srec_cat so that you can get the 0xF0B8 magic number test to work.
The XMODEM version used here can miss leading zeros.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]