
LM3S101 Data Sheet
March 22, 2006
82
Preliminary
An access that attempts to program or erase a PE-protected block is prohibited. A controller 
interrupt may be optionally generated (by setting the 
AMASK
 bit in the 
FIM
 register) to alert 
software developers of poorly behaving software during the development and debug phases. 
An access that attempts to read an RE-protected block is prohibited. Such accesses return data 
filled with all 0s. A controller interrupt may be optionally generated to alert software developers of 
poorly behaving software during the development and debug phases.
The factory settings for the 
FMPRE
 and 
FMPPE
 registers are a value of 1 for all implemented 
banks. This implements a policy of open access and programmability. The register bits may be 
changed by writing the specific register bit. The changes are not permanent until the register is 
committed (saved), at which point the bit change is permanent. If a bit is changed from a 1 to a 0 
and not committed, it may be restored by executing a power-on reset sequence.
7.2.2.3
Flash Memory Programming
Writing the flash memory requires that the code be executed out of SRAM to avoid corrupting or 
interrupting the bus timing. Flash pages can be erased on a page basis (1 KB in size), or by 
performing a mass erase of the entire flash.
All erase and program operations are performed using the 
Flash Memory Address (FMA)
, 
Flash 
Memory Data (FMD)
 and 
Flash Memory Control (FMC)
 registers. See section 7.3 for examples.
7.3
Initialization and Configuration
This section shows examples for using the flash controller to perform various operations on the 
contents of the flash memory.
7.3.1
Changing Flash Protection Bits
As discussed in Section 7.2.2.2, changes to the protection bits must be committed before they 
take effect. The sequence to change and commit a bit in software is as follows:
1.
The 
Flash Memory Protection Read Enable (FMPRE)
 and 
Flash Memory Protection Pro-
gram Enable (FMPPE)
 registers are written, changing the intended bit(s). The action of these 
changes can be tested by software while in this state. 
2.
The 
Flash Memory Address (FMA)
 register (see page 86) bit 0 is set to 1 if the 
FMPPE
 reg-
ister is to be committed; otherwise, a 0 commits the 
FMPRE
 register.
3.
The 
Flash Memory Control (FMC)
 register (see page 88) is written with the 
COMT
 bit set. This 
initiates a write sequence and commits the changes.
7.3.2
Flash Programming
The Stellaris devices provide a user-friendly interface for flash programming. All erase/program 
operations are handled via three registers: 
FMA
, 
FMD
 and 
FMC
.
0
1
Read-only protection. The block may be read or executed but may not be 
written or erased. This mode is used to lock the block from further modification 
while allowing any read or execute access.
1
1
No protection. The block may be written, erased, executed or read.
Table 7-1.
Flash Protection Policy Combinations
FMPPE
FMPRE
Protection