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

[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()
issue.

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
functions:

_crc_ccitt_avr_update()
_crc_ieee32_avr_update()
_crc_atmel_flash_avr_update()

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:

  <http://savannah.nongnu.org/bugs/?37901>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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