On 2006-08-07, Bill Knight <[email protected]> wrote:
>> */David Peters <[email protected]>/* wrote:
>>
>> Is it possible for the GCC tools to generate a
>> checksum from the generated code and embed it into the
>> hex file at a specific address? I've done this in the
>> past using the IAR compiler and need it for the
>> bootloader to check the new code being loaded into
>> flash.
>
> Just to stir the pot a bit... CRCs were originally done in hardware on
> a serial bit stream. Well maybe not originally, but a long time ago.
> As such, they operated on data as it appeared bit-by-bit. If the data
> was being transmitted via a UART it appeared LSbit first. If it was
> some form of synchronous serial data stream, it might appear MSbit
> first. Because of that history, table driven CRCs many times have two
> tables which operate on bytes. One assumes the data arrives LSbit first
> while the other table assumes the data arrives MSbit first. Both are
> correct.
Just to stir the pot a bit further, CRCs are used in
communications applications for two reasons:
1) They're trivial to do in hardware.
2) They're very good at detecting burst errors.
I'm baffled why people persist in using CRCs in software for
things like EEPROM and flash ROM.
Firstly, CRCs are a bitch to implement in software: they're way
more expenive than any other alternative I've seen.
Secondly, I've never seen any evidence that the failure modes
of EEPROMs and flash ROMs are the same as those for a
telecommunications link (e.g. burst errors).
IOW, people are paying a lot extra for something that may not
even work as well as a far cheaper solution.
--
Grant Edwards grante Yow! I've got a COUSIN
at who works in the GARMENT
visi.com DISTRICT...