Does the Arduino platform offer flash code (CRC) scanning?

The Arduino does not currently do a code scan. There is nothing that would prevent it from doing so as an add-on, but there are a couple of issues:

  • You have to decide whether you're going to include the bootloader, keeping in mind that the sketch and the bootloader code can change independently. And that the upload procedure can't write EEPROM on most Arduinos.
  • Same issue WRT "empty" program memory. The last page of a program written to flash can contain somewhat random data, I think...
  • Most importantly, you have to have some idea what it is you're going to do if the CRC fails. Is "don't run at all" actually better than "run with a piece of corrupted memory"? How do you indicate the error to the user/owner, considering that there may not be any visible connection, and/or that doing anything to a visible connection may involve the damaged memory?
  • On top of that, corrupted flash memory is pretty rare. Short of the upload itself (which is already verified), you are much more likely to have developer-induced bugs than experience corruption of the flash memory.

IMNSHO, these "CRC the code" schemes are something dreamed up some management wog with a CS background, and not much practical experience. :frowning: