
109
SAM7S Series [DATASHEET]
6175M–ATARM–26-Oct-12
19.2.3
Write Operations
The internal memory area reserved for the embedded Flash can also be written through a write-only latch buffer.
Write operations take into account only the 8 lowest address bits and thus wrap around within the internal memory
area address space and appear to be repeated 1024 times within it.
Write operations can be prevented by programming the Memory Protection Unit of the product.
Writing 8-bit and 16-bit data is not allowed and may lead to unpredictable data corruption.
Write operations are performed in the number of wait states equal to the number of wait states for read operations
19.2.4
Flash Commands
The EFC offers a command set to manage programming the memory flash, locking and unlocking lock sectors,
consecutive programming and locking, and full Flash erasing.
To run one of these commands, the field FCMD of the MC_FCR register has to be written with the command num-
ber. As soon as the MC_FCR register is written, the FRDY flag is automatically cleared. Once the current
command is achieved, then the FRDY flag is automatically set. If an interrupt has been enabled by setting the bit
FRDY in MC_FMR, the interrupt line of the Memory Controller is activated.
All the commands are protected by the same keyword, which has to be written in the eight highest bits of the
MC_FCR register.
Writing MC_FCR with data that does not contain the correct key and/or with an invalid command has no effect on
the memory plane; however, the PROGE flag is set in the MC_FSR register. This flag is automatically cleared by a
read access to the MC_FSR register.
When the current command writes or erases a page in a locked region, the command has no effect on the whole
memory plane; however, the LOCKE flag is set in the MC_FSR register. This flag is automatically cleared by a read
access to the MC_FSR register.
Table 19-2.
Set of Commands
Command
Value
Mnemonic
Write page
0x01
WP
Set Lock Bit
0x02
SLB
Write Page and Lock
0x03
WPL
Clear Lock Bit
0x04
CLB
Erase all
0x08
EA
Set General-purpose NVM Bit
0x0B
SGPB
Clear General-purpose NVM Bit
0x0D
CGPB
Set Security Bit
0x0F
SSB