
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
61 of 808
NXP Semiconductors
UM10360
Chapter 5: LPC17xx Flash accelerator
5.
Operation
Simply put, the flash accelerator attempts to have the next Cortex-M3 instruction that will
be needed in its latches in time to prevent CPU fetch stalls. The LPC17xx uses one bank
of flash memory. The flash accelerator includes an array of eight 128-bit buffers to store
both instructions and data in a configurable manner. Each 128-bit buffer in the array can
include four 32-bit instructions, eight 16-bit instructions or some combination of the two.
During sequential code execution, a buffer typically contains the current instruction and
the entire flash line that contains that instruction, or one flash line of data containing a
previously requested address. Buffers are marked according to how they are used (as
instruction or data buffers), and when they have been accessed. This information is used
to carry out the buffer replacement strategy.
The Cortex-M3 provides a separate bus for instruction access (ICode) and data access
(DCode) in the code memory space. These buses, plus the General Purpose DMA
Controllers’s master port, are arbitrated by the AHB multilayer matrix. Any access to the
flash memory’s address space is presented to the flash accelerator.
If a flash instruction fetch and a flash data access from the CPU occur at the same time,
the multilayer matrix gives precedence to the data access. This is because a stalled data
access always slows down execution, while a stalled instruction fetch often does not.
When the flash data access is concluded, any flash fetch or prefetch that had been in
progress is re-initiated.
Branches and other program flow changes cause a break in the sequential flow of
instruction fetches described above. Buffer replacement strategy in the flash accelerator
attempts to maximize the chances that potentially reusable information is retained until it
is needed again.
If an attempt is made to write directly to the flash memory without using the normal flash
programming interface (via Boot ROM function calls), the flash accelerator generates an
error condition. The CPU treats this error as a data abort. the GPDMA handles error
conditions as described in
.
15:12 FLASHTIM
Flash access time. The value of this field plus 1 gives the number of CPU clocks used
for a flash access.
Warning:
improper setting of this value may result in incorrect operation of the device.
Important Note: Frequency values shown below are estimates at this time.
0x3
0000
Flash accesses use 1 CPU clock. Use for up to 20 MHz CPU clock.
0001
Flash accesses use 2 CPU clocks. Use for up to 40 MHz CPU clock.
0010
Flash accesses use 3 CPU clocks. Use for up to 60 MHz CPU clock.
0011
Flash accesses use 4 CPU clocks. Use for up to 80 MHz CPU clock.
0100
Flash accesses use 5 CPU clocks. Use for up to 100 MHz CPU clock.
0101
Flash accesses use 6 CPU clocks. This “safe” setting will work under any conditions.
Other Intended for potential future higher speed devices.
Table 49.
Flash Accelerator Configuration register (FLASHCFG - address 0x400F C000) bit description
Bit
Symbol
Value Description
Reset
value