AT91SAM7S32-AI ATMEL [ATMEL Corporation], AT91SAM7S32-AI Datasheet - Page 96

no-image

AT91SAM7S32-AI

Manufacturer Part Number
AT91SAM7S32-AI
Description
AT91 ARM Thumb-based Microcontrollers
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
Erase All Command
Lock Bit Protection
96
AT91SAM7S32 Preliminary
The entire memory can be erased if the Erase All Command (EA) in the Flash Command Reg-
ister MC_FCR is written.
Erase All operation is allowed only if there are no lock bits set. Thus, if at least one lock region
is locked, the bit LOCKE in MC_FSR rises and the command is cancelled. If the bit LOCKE
has been written at 1 in MC_FMR, the interrupt line rises.
When programming is complete, the bit FRDY bit in the Flash Programming Status Register
(MC_FSR) rises. If an interrupt has been enabled by setting the bit FRDY in MC_FMR, the
interrupt line of the Memory Controller is activated.
Two errors can be detected in the MC_FSR register after a programming sequence:
Lock bits are associated with several pages in the embedded Flash memory plane. This
defines lock regions in the embedded Flash memory plane. They prevent writing/erasing pro-
tected pages.
After production, the device may have some embedded Flash lock regions locked. These
locked regions are reserved for a default application. Refer to the product definition section for
the default embedded Flash mapping. Locked sectors can be unlocked to be erased and then
programmed with another application or other data.
The lock sequence is:
A programming error, where a bad keyword and/or an invalid command have been written in
the MC_FCR register, may be detected in the MC_FSR register after a programming
sequence.
It is possible to clear lock bits that were set previously. Then the locked region can be erased
or programmed. The unlock sequence is:
A programming error, where a bad keyword and/or an invalid command have been written in
the MC_FCR register, may be detected in the MC_FSR register after a programming
sequence.
The Unlock command programs the lock bit to 1; the corresponding bit LOCKSx in MC_FSR
reads 0. The Lock command programs the lock bit to 0; the corresponding bit LOCKSx in
MC_FSR reads 1.
Note:
Programming Error: A bad keyword and/or an invalid command have been written in the
MC_FCR register.
Lock Error: At least one lock region to be erased is protected. The erase command has
been refused and no page has been erased. A Clear Lock Bit command must be executed
previously to unlock the corresponding lock regions.
The Flash Command register must be written with the following value:
(0x5A << 24) | (lockPageNumber << 8 & PAGEN) | SLB
lockPageNumber is a page of the corresponding lock region.
When locking completes, the bit FRDY in the Flash Programming Status Register
(MC_FSR) rises. If an interrupt has been enabled by setting the bit FRDY in MC_FMR, the
interrupt line of the Memory Controller is activated.
The Flash Command register must be written with the following value:
(0x5A << 24) | (lockPageNumber << 8 & PAGEN) | CLB
lockPageNumber is a page of the corresponding lock region.
When the unlock completes, the bit FRDY in the Flash Programming Status Register
(MC_FSR) rises. If an interrupt has been enabled by setting the bit FRDY in MC_FMR, the
interrupt line of the Memory Controller is activated.
Access to the Flash in Read Mode is permitted when a Lock or Unlock command is
performed.
6071A–ATARM–28-Oct-04

Related parts for AT91SAM7S32-AI