The goal of this application note is to present a software technique for determining if data and program in FLASH have been corrupted and if so not to run the user program. The program described in this application note has been written for the ST72F26x family (ST72260G1, ST72262G1, ST72262G2, ST72264G1, ST72264G2) but can be extended to all other ST7 MCUs. In this application, we chose to use a ST72264G2.
This document presents a software technique for determining if data and programs in FLASH memory have been corrupted. The goal is to prevent the user program from running if corruption is detected. The described program was written for the ST72F26x family but can be extended to other ST7 MCUs.
The note details the calculation of a checksum by adding the content of the FLASH memory. It explains how to integrate a 'Safe' routine into the application, modify the reset vector, and use the emulator to calculate and store the checksum. The document also describes the operation of the Safe routine, which halts the microcontroller if the checksum comparison fails, and provides flowcharts for the process.
| Supported Device Family | ST72F26x family |
|---|---|
| Specific Devices | ST72260G1, ST72262G1, ST72262G2, ST72264G1, ST72264G2 |
| Checksum Calculation Time (4k device) | 13.7 ms |
| CPU Frequency for Timing | 8MHz |
The goal is to determine if data and program in FLASH have been corrupted and, if so, not to run the user program.
The checksum is calculated by a simple addition of the content of the FLASH.
The microcontroller is halted, and the user application won't be run.