363
SAM4CP [DATASHEET]
43051E–ATPL–08/14
22.4.3.9 User Signature
Each part contains a user signature of 512 bytes. It can be used for storage. Read, write and erase of this area is
allowed.
To read the user signature, the sequence is as follows:
1.
Send the Start read user signature (STUS) command by writing EEFC_FCR with the STUS command.
2.
When the user signature is ready to be read, the bit EEFC_FSR.FRDY falls.
3.
The User Signature is located in the first 512 bytes of the Flash memory mapping, thus, at the address
0x1000000-0x10001FF.
4.
To stop the user signature mode, the user needs to send the Stop read user signature (SPUS) command by writing
EEFC_FCR with the SPUS command.
5.
When the SPUS command has been performed, the bit EEFC_FSR.FRDY rises. If an interrupt was enabled by
setting the bit EEFC_FMR.FRDY, the interrupt line of the interrupt controller is activated.
Note that during the sequence, the software cannot run out of Flash or the second plane, in case of dual plane.
One error can be detected in EEFC_FSR after this sequence:
Command Error: a bad keyword has been written in EEFC_FCR.
To write the user signature, the sequence is:
1.
Write the full page, at any page address, within the internal memory area address space.
2.
Send the Write user signature (WUS) command by writing EEFC_FCR with the WUS command.
3.
When programming is completed, the bit EEFC_FSR.FRDY rises. If an interrupt has been enabled by setting the
bit EEFC_FMR.FRDY, the corresponding interrupt line of the interrupt controller is activated.
Two errors can be detected in EEFC_FSR after this sequence:
Command Error: a bad keyword has been written in EEFC_FCR.
Flash Error: at the end of the programming, the WriteVerify test of the Flash memory has failed.
To erase the user signature, the sequence is:
1.
Send the Erase user signature (EUS) command by writing the EEFC_FCR with the EUS command.
2.
When programming is completed, the bit EEFC_FSR.FRDY rises. If an interrupt has been enabled by setting the
bit EEFC_FMR.FRDY, the corresponding interrupt line of the interrupt controller is activated.
Two errors can be detected in EEFC_FSR after this sequence:
Command Error: a bad keyword has been written in EEFC_FCR.
Flash Error: at the end of the programming, the EraseVerify test of the Flash memory has failed.
22.4.3.10 ECC Errors and Corrections
The Flash embeds an ECC module able to correct one unique error and able to detect two errors. The errors are
detected while a read access is performed into memory array and stored in EEFC_FSR (see
Section 22.5.3 “EEFC Flash
Status Register” on page 368
). The error report is kept until EEFC_FSR is read.
There is one flag for a unique error on lower half part of the Flash word (64 LSB) and one flag for the upper half part
(MSB). The multiple errors are reported in the same way.
Due to the anticipation mechanism to improve bandwidth throughput on instruction fetch, a reported error can be located
in the next sequential Flash word compared to the location of the instruction being executed, which is located in the
previously fetched Flash word.
If a software routine processes the error detection independently from the main software routine, the entire Flash located
software must be rewritten because there is no storage of the error location.
If only a software routine is running to program and check pages by reading EEFC_FSR, the situation differs from
previous case. Performing a check for ECC unique errors just after page programming completion involves a read of the
newly programmed page. This read sequence is viewed as data accesses and is not optimized by the Flash controller.
Thus, in case of unique error, only the current page must be reprogrammed.