UM10462
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 5.5 — 21 December 2016
392 of 523
NXP Semiconductors
UM10462
Chapter 20: LPC11U3x/2x/1x Flash programming firmware
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.
20.7 Criterion for Valid User Code
The reserved ARM Cortex-M0 exception vector location 7 (offset 0x0000 001C in the
vector table) should contain the 2’s complement of the check-sum of table entries 0
through 6. This causes the checksum of the first 8 table entries to be 0. The bootloader
code checksums the first 8 locations in sector 0 of the flash. If the result is 0, then
execution control is transferred to the user code.
If the signature is not valid, the auto-baud routine synchronizes with the host via the serial
port (UART).
If the UART is selected, the host should send a ’?’ (0x3F) as a synchronization character
and wait for a response. The host side serial port settings should be 8 data bits, 1 stop bit
and no parity. The auto-baud routine measures the bit time of the received
synchronization character in terms of its own frequency and programs the baud rate
generator of the serial port. It also sends an ASCII string ("Synchronized<CR><LF>") to
the host. In response to this host should send the same string
("Synchronized<CR><LF>"). The auto-baud routine looks at the received characters to
verify synchronization. If synchronization is verified then "OK<CR><LF>" string is sent to
the host. Host should respond by sending the crystal frequency (in kHz) at which the part
is running. For example, if the part is running at 10 MHz, the response from the host
should be "10000<CR><LF>". "OK<CR><LF>" string is sent to the host after receiving the
crystal frequency. If synchronization is not verified then the auto-baud routine waits again
for a synchronization character. For auto-baud to work correctly in case of user invoked
ISP, the CCLK frequency should be greater than or equal to 10 MHz. In USART ISP
mode, the LPC11U3x/2x/1x is clocked by the IRC and the crystal frequency is ignored.
Once the crystal frequency is received the part is initialized and the ISP command handler
is invoked. For safety reasons an "Unlock" command is required before executing the
commands resulting in flash erase/write operations and the "Go" command. The rest of
the commands can be executed without the unlock command. The Unlock command is
required to be executed once per ISP session. The Unlock command is explained in