avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] XMEGA hardware CRC calculation


From: Simone Zamboni
Subject: [avr-libc-dev] XMEGA hardware CRC calculation
Date: Sat, 02 Oct 2010 17:08:37 +0200

I switched to a new discussion thread because I think this argument
could be of someone interest.

Bob Paddock wrote:
> 
> Real Soon Now I want to switch to the XMega hardware CRC calculator,
> but I have to write some code of the PC
> that precalculates the CRC Magic Number to put into the last three
> bytes of the application space.
> That way a good CRC will always have a constant value.
>  Be aware that the XMega CRC Range calculation does not work in
> revision prior to J; that don't seem to exist yet.
> 

I implemented a boot for my XMEGA projects that use internal CRC
calculation of all the flash to check for application integrity at start
time. If CRC is correct the boot starts the application otherwise it
listen to the serial port for commands.
I didn't use the flash range CRC because, as you stated, it is broken; I
used instead the app section CRC command.

Well, here is a big problem: the CRC reported in the XMEGA datasheet is
not a valid CRC so I asked Atmel for support and they sent me a C
routine to calculate the CRC as XMEGA does. The routine functions and
the CRC calculated matches the one calculated by the XMEGA but as soon
as I read through the code, I realized that that code doesn't calculate
a CRC but something resembling a CRC.
To make it short: you can't append the calculated 3 bytes at the end of
your app because you will never have a constant value when checking it
with XMEGA CRC function.

Maybe I'm wrong but if I remember well, I did all the test I could to
have that CRC work properly but without success.

I can supply some code if someone needs it to make further test.
Would be a nice thing to fix this issue. Atmel wasn't able to help me
more than this.

P.S. The last ATXMEGA128A1 die is revision H you were wrongly referring
to datasheet revision J. I strongly hope that with the next die release
of XMEGA A1 some errors will be fixed (XMEGA A1 datasheets revision M
reports 42 known problems!).





reply via email to

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