29.4.9 User Signature Area

Each product contains a user signature area of 32 Kbytes (8 x 4K) in one block. It can be used for storage. Read, write and erase of this area are allowed.

Only the first half of the signature area is erased by the erase pin assertion.

When reading from a user signature block, its Read and User/Privileged access rights must be honored as configured in the User Signature Rights register (EEFC_USR). Otherwise the read access returns a bus error which can be managed either as a synchronous abort exception for a CPU access or asynchronously as a security interrupt coming from the AHB matrix connected to the SEFC.

When writing the command to the Flash Command Register to program or erase a user signature block, its Write and User / Privileged access rights must be honored as configured in the User Signature Rights Register (EEFC_USR). Otherwise the command is ignored and a write protect violation error (WPERR) is flagged in EEFC_FSR.

The Access Rights can be locked per each user signature block x until hardware reset by writing the corresponding LOCKUSRBx bit to 1.

See Figure 29-1.

The sequence to read the user signature area is the following:

  1. Execute the ‘Start Read User Signature’ command by writing EEFC_FCR.FCMD with the STUS command. Field EEFC_FCR.FARG is meaningless.
  2. Wait until the bit EEFC_FSR.FRDY falls to read the user signature area. The user signature area is located in the first 32 Kbytes of the Flash memory mapping. The ‘Start Read User Signature’ command reuses some addresses of the memory plane but the user signature area is physically different from the memory plane
  3. To stop reading the user signature area, execute the ‘Stop Read User Signature’ command by writing EEFC_FCR.FCMD with the SPUS command. Field EEFC_FCR.FARG is meaningless.
  4. When the SPUI command has been executed, 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 be fetched from the Flash main memory area.

One error can be detected in EEFC_FSR after this sequence:

  • Command error: a wrong keyword was written in EEFC_FCR.

The sequence to write the user signature area is the following:

  1. Write the full page, at any page address, in the internal memory area address space.
  2. Execute the ‘Write User Signature’ command by writing EEFC_FCR.FCMD with the WUS command. The page to be written is specified in the FARG field of the EEFC_FCR.
  3. When programming is completed, the bit EEFC_FSR.FRDY rises. If an interrupt was 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 wrong keyword was written in EEFC_FCR.
  • Flash error: at the end of the programming, the WriteVerify test of the Flash memory failed.

The sequence to erase a user signature block is the following:

  1. Execute the ‘Erase User Signature’ command by writing EEFC_FCR.FCMD with the EUS command. The block to be erased is specified in the EEFC_FCR.FARG[15:3] field.
  2. When programming is completed, the bit EEFC_FSR.FRDY rises. If an interrupt was 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 wrong keyword was written in EEFC_FCR.
  • Flash error: at the end of the programming, the EraseVerify test of the Flash memory has failed.

The 4-Kbyte user signature block 7 is One Time Programmable only and cannot be erased by any mean. In particular, this means the ‘Erase User Signature’ command cannot be used with the FARG[15:3] field set to 7. Any attempt will have no effect but raise the Write Protection Error status flag (WPERR) in EEFC_FSR.

The One Time Programmable (OTP) block can be used for example to implement a monotonic counter in software, with 64 bits a least being written at a time as explained in Partial Page Programming.