Hi Ruby,
ECC is hardware feature which helps with system safety. This feature is active only during reading from Flash (P-Flash, D-Flash). So, there isn’t any regular testing of whole flash. If you want do it, you have to simply read flash and check ECC flags or implements ECC interrupt.
For P-Flash memory, the ECC implementation requires that programming be done on an aligned 8 byte basis (a Flash phrase, 64bit). This programming writes additional 7 ECC bits to Flash.
ECC bits for D-Flash are generated per word (16bit) - it adds 6 ECC bits.
So, if you want check ECC over whole P-flash, you could just read unaligned words across two phrases with 16 byte distance. For testing ECC, you could read word at address 0x7C0007.. 0x7C0008, after that 0x7C0017.. 0x7C0018, 0x7C0027.. 0x7C0028,…
Since P-Flash memory is always read by phrase, only one single bit fault in the phrase containing the byte or word accessed will be corrected. Additionally some of multi-bit errors could stay unrecognized (More than 2 bit errors cannot be detected reliable. There are cases when 3 bit errors are detected as one bit errors and corrected.).
Unfortunately ECC isn’t 100% protection - the same as in case of CRC checksum. But it is big chance that ECC will discover bit errors when they appears.
So, it always depends on level of required paranoia.
Calculating CRC over whole Flash for every start isn’t typical solution. Some customers implemented it, but it is not widely used solution. It may have sense to calculate CRC for some smaller block and this way test any potential error in address decoder.
I would like to recommend our application note AN4505 Safety Considerations S12GFamily for more details about safety systems.
http://www.freescale.com/files/microcontrollers/doc/app_note/AN4505.pdf
Useful could be also AN4772 IEC 60730 Safety Routines for the DSC 56800EX Core, despite on fact that this application note was not created for S12 devices and it is rather for consumer applications. http://www.freescale.com/files/32bit/doc/app_note/An4772.pdf
Automotive safety is driven by ISO 26262 and IEC 61508:
http://www.freescale.com/webapp/sps/site/overview.jsp?code=FNCTNLSFTY
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------