To complete a full diagnostic of the Flash memory, a checksum of all used Flash needs to be calculated.
The current library uses a Fletcher's 64-bit checksum. The stl_Flash.h file defines the Flash size that needs to be monitored.
The proposed checksum Flash test reads each ROM or Flash location and accumulates the values in a 64-bit variable to calculate a running checksum of the entire user Flash memory. The actual 64-bit checksum of Flash is stored in the last 8 bytes of Flash itself. When the test reaches the end of Flash minus 8 bytes (0x7FF8 on 32-KB devices), it stops. Custom linker files are used to place the checksum in the desired location. The calculated checksum value is then compared with the actual value stored in the last 8 bytes of Flash. A mismatch indicates Flash failure. The checksum can also be stored in SFLASH, EEPROM, or any other external Flash.
API Reference | |
| Macros | |
| Functions | |