331
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
19.4.3
Flash Commands
The Enhanced Embedded Flash Controller (EEFC) offers a set of commands such as program-
ming the memory Flash, locking and unlocking lock regions, consecutive programming and
locking and full Flash erasing, etc.
In order to perform one of these commands, the Flash Command Register (EEFC_FCR) has to
be written with the correct command using the FCMD field. As soon as the EEFC_FCR register
is written, the FRDY flag and the FVALUE field in the EEFC_FRR register are automatically
cleared. Once the current command is achieved, then the FRDY flag is automatically set. If an
interrupt has been enabled by setting the FRDY bit in EEFC_FMR, the corresponding interrupt
line of the NVIC is activated. (Note that this is true for all commands except for the STUI Com-
mand. The FRDY flag is not set when the STUI command is achieved.)
All the commands are protected by the same keyword, which has to be written in the 8 highest
bits of the EEFC_FCR register.
Writing EEFC_FCR with data that does not contain the correct key and/or with an invalid com-
mand has no effect on the whole memory plane, but the FCMDE flag is set in the EEFC_FSR
register. This flag is automatically cleared by a read access to the EEFC_FSR register.
Table 19-2.
Set of Commands
Command
Value
Mnemonic
Get Flash Descriptor
0x00
GETD
Write page
0x01
WP
Write page and lock
0x02
WPL
Erase page and write page
0x03
EWP
Erase page and write page then lock
0x04
EWPL
Erase all
0x05
EA
Erase Pages
0x07
EPA
Set Lock Bit
0x08
SLB
Clear Lock Bit
0x09
CLB
Get Lock Bit
0x0A
GLB
Set GPNVM Bit
0x0B
SGPB
Clear GPNVM Bit
0x0C
CGPB
Get GPNVM Bit
0x0D
GGPB
Start Read Unique Identifier
0x0E
STUI
Stop Read Unique Identifier
0x0F
SPUI
Get CALIB Bit
0x10
GCALB
Erase Sector
0x11
ES
Write User Signature
0x12
WUS
Erase User Signature
0x13
EUS
Start Read User Signature
0x14
STUS
Stop Read User Signature
0x15
SPUS
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...