UM10429
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2010. All rights reserved.
User manual
Rev. 1 — 20 October 2010
150 of 258
NXP Semiconductors
UM10429
Chapter 17: LPC1102 Flash memory programming firmware
17.3.5 Sector numbers
Some IAP and ISP commands operate on sectors and specify sector numbers. The
following table shows the correspondence between sector numbers and memory
addresses for LPC1102 devices.
17.3.6 Flash content protection mechanism
The LPC1102 is equipped with the Error Correction Code (ECC) capable Flash memory.
The purpose of an error correction module is twofold. Firstly, it decodes data words read
from the memory into output data words. Secondly, it encodes data words to be written to
the memory. The error correction capability consists of single bit error correction with
Hamming code.
The operation of ECC is transparent to the running application. The ECC content itself is
stored in a flash memory not accessible by user’s code to either read from it or write into it
on its own. A byte of ECC corresponds to every consecutive 128 bits of the user
accessible Flash. Consequently, Flash bytes from 0x0000 0000 to 0x0000 000F are
protected by the first ECC byte, Flash bytes from 0x0000 0010 to 0x0000 001F are
protected by the second ECC byte, etc.
Whenever the CPU requests a read from user’s Flash, both 128 bits of raw data
containing the specified memory location and the matching ECC byte are evaluated. If the
ECC mechanism detects a single error in the fetched data, a correction will be applied
before data are provided to the CPU. When a write request into the user’s Flash is made,
write of user specified content is accompanied by a matching ECC value calculated and
stored in the ECC memory.
When a sector of Flash memory is erased, the corresponding ECC bytes are also erased.
Once an ECC byte is written, it can not be updated unless it is erased first. Therefore, for
the implemented ECC mechanism to perform properly, data must be written into the flash
memory in groups of 16 bytes (or multiples of 16), aligned as described above.
17.3.7 Code Read Protection (CRP)
Code Read Protection is a mechanism that allows the user to enable different levels of
security in the system so that access to the on-chip flash and use of the ISP can be
restricted. When needed, CRP is invoked by programming a specific pattern in flash
location at 0x0000 02FC. IAP commands are not affected by the code read protection.
Table 147. Flash sector configuration
Sector
number
Sector size
Address range
LPC1102
32 kB flash
0
4 kB
0x0000 0000 - 0x0000 0FFF
yes
1
4 kB
0x0000 1000 - 0x0000 1FFF
yes
2
4 kB
0x0000 2000 - 0x0000 2FFF
yes
3
4 kB
0x0000 3000 - 0x0000 3FFF
yes
4
4 kB
0x0000 4000 - 0x0000 4FFF
yes
5
4 kB
0x0000 5000 - 0x0000 5FFF
yes
6
4 kB
0x0000 6000 - 0x0000 6FFF
yes
7
4 kB
0x0000 7000 - 0x0000 7FFF
yes