Datasheet
282
11011B–ATARM–21-Feb-12
SAM3N
Two errors can be detected in the EEFC_FSR register after a programming sequence:
• a Command Error: a bad keyword has been written in the EEFC_FCR register.
• a Lock Error: the page to be programmed belongs to a locked region. A command must be
previously run to unlock the corresponding region.
By using the WP command, a page can be programmed in several steps if it has been erased
before (see Figure 18-6).
Figure 18-6. Example of Partial Page Programming
The Partial Programming mode works only with 128-bit (or higher) boundaries. It cannot be used
with boundaries lower than 128 bits (8, 16 or 32-bit for example).
18.3.3.3 Erase Commands
Erase commands are allowed only on unlocked regions.
The erase sequence is:
• Erase starts as soon as one of the erase commands and the FARG field are written in the
Flash Command Register.
• When the programming completes, the FRDY bit in the Flash Programming Status Register
(EEFC_FSR) rises. If an interrupt has been enabled by setting the FRDY bit in EEFC_FMR,
the interrupt line of the NVIC is activated.
Two errors can be detected in the EEFC_FSR register after a programming sequence:
• a Command Error: a bad keyword has been written in the EEFC_FCR register.
• a Lock Error: at least one page to be erased belongs to a locked region. The erase command
has been refused, no page has been erased. A command must be run previously to unlock
the corresponding region.
18.3.3.4 Lock Bit Protection
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 protected
pages.
Erase All Flash Programming of the second part of Page Y Programming of the third part of Page Y
32-bit wide 32-bit wide 32-bit wide
X words
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
...
CA FE CA FE
CA FE CA FE
CA FE CA FE
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
CA FE CA FE
CA FE CA FE
CA FE CA FE
DE CA DE CA
DE CA DE CA
DE CA DE CA
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
Step 1. Step 2. Step 3.
...
...
...
...
...
...
...
...
...
...
...
X words
X words
X words
So Page Y erased