Hello! I need some information about CRC. I have a new question. I have finished my code. I am working with Keil to program a XC167CI microcontroller, but I have to guarantee the code programmed in memories. So I have to develop cyclic redundace check subroutines to guarantee the code. Can you help about that?
A CRC is all very well for confirming that your code is OK, but you need to think very carefully indeed about what will happen if there is a code error... If the code memory is corrupt, you have (virtually?) no way to predict how it will run!!
Just to comment the XC16x Flash devices implement Error Correction Code (ECC) when accessing the on-chip flash. Single bit errors are detected and automatically corrected on-the-fly (during run-time). Therefore, single bit errors do not affect system operation. Double bit errors are detected and trigger an Access Fault trap. This prevents erroneous instructions or data from being used. Problematic bits can be detected by combining a verify operation (CRC for example) with margin check control. Thus even single bit errors can be avoided by detecting problematic (moving) bits before they lead to a read error (and a recovery operation during runtime) and by reprogramming (refreshing) them in advance.
"Double bit errors are detected and trigger an Access Fault trap. This prevents erroneous instructions or data from being used." What if a double bit (or worse) error occurs in your trap handler...?
What if a double bit (or worse) error occurs in your trap handler...? That is where some (at least the somewhat intelligent) realize that the only way to perform code checking is by "remote control" Erik