English
Language : 

LM3S317 Datasheet, PDF (214/551 Pages) List of Unclassifed Manufacturers – Microcontroller
Internal Memory
6.3
6.3.1
In the initial state provided from the factory, access is enabled in order to facilitate code development
and debug. Access to the DAP may be disabled at the end of the manufacturing flow, once all tests
have passed and software has been loaded. This change does not take effect until the next power-up
of the device. Note that it is recommended that disabling access to the DAP be combined with a
mechanism for providing end-user installable updates (if necessary) such as the Stellaris boot loader.
Important: Once the DBG field is cleared and committed, this field can never be restored to the
factory-programmed value—which means the JTAG/SWD interface to the debug module
can never be re-enabled. This sequence does NOT disable the JTAG controller, it only
disables the access of the DAP through the JTAG or SWD interfaces. The JTAG interface
remains functional and access to the Test Access Port remains enabled, allowing the
user to execute the IEEE JTAG-defined instructions (for example, to perform boundary
scan operations).
When using the FMPRE bits to protect Flash memory from being read as data (to mark sets of 2-KB
blocks of Flash memory as execute-only), these one-time-programmable bits should be written at
the same time that the debug disable bits are programmed. Mechanisms to execute the one-time
code sequence to disable all debug access include:
■ Selecting the debug disable option in the Stellaris boot loader
■ Loading the debug disable sequence into SRAM and running it once from SRAM after
programming the final end application code into Flash memory
Flash Memory Initialization and Configuration
This section shows examples for using the flash controller to perform various operations on the
contents of the flash memory.
Changing Flash Protection Bits
As discussed in “Flash Memory Protection” on page 211, changes to the protection bits must be
committed before they take effect. The sequence below is used change and commit a block protection
bit in the FMPRE or FMPPE registers. 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 Program
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 217) bit 0 is set to 1 if the FMPPE register
is to be committed; otherwise, a 0 commits the FMPRE register.
3. The Flash Memory Control (FMC) register (see page 219) is written with the COMT bit set. This
initiates a write sequence and commits the changes.
There is a special sequence to change and commit the DBG bits in the Flash Memory Protection
Read Enable (FMPRE) register. This sequence also sets and commits any changes from 1 to 0 in
the block protection bits (for execute-only) in the FMPRE register.
1. The Flash Memory Protection Read Enable (FMPRE) register is 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 217) is written with a value of 0x900.
214
July 14, 2014
Texas Instruments-Production Data