[Top][All Lists]

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

[avr-libc-dev] [bug #37901] CRC-CCITT calculation incorrect

From: mojo
Subject: [avr-libc-dev] [bug #37901] CRC-CCITT calculation incorrect
Date: Tue, 11 Dec 2012 16:35:31 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11

Follow-up Comment #4, bug #37901 (project avr-libc):

I disagree. The way you are looking at it is bitwise, but programmers these
days are probably looking at it bytewise. The USART takes care of bit order,
all the programmer gets is their byte in the DATA register.

That is exactly what I expected, so on one device I just fed the bytes in to
_crc_ccitt_update() and on the other one I spooled them into the XMEGA's
CRC.DATAIN. The results did not match, despite both claiming to be an
implementation of CRC-CCITT.

The XMEGA implementation matches all the publicly available code I found on
Google with a few quick searches. Many big and popular libraries include such
code. Naturally instead of re-inventing the wheel I use one of those
implementations in my desktop app and as a fix for the _crc_ccitt_update()

As I said, even if we don't rename anything it should at least be made clear
in the documentation. Personally I would suggest implementing three new


I'm sure someone can think of better names. At least then people would be less
confused and compatibility with the AVR CRC generator hardware would be
explicitly mentioned.

I have code available for the ieee32 and atmel_flash CRCs, BTW. I will prepare
a patch.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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