Datasheet

UM10398 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2014. All rights reserved.
User manual Rev. 12.3 — 10 June 2014 428 of 547
NXP Semiconductors
UM10398
Chapter 26: LPC111x/LPC11Cxx Flash programming firmware
Remark: Once a page has been written to 16 times, it is still possible to write to other
pages within the same sector without performing a sector erase (assuming that those
pages have been erased previously).
26.5.8 Go <address> <mode> (UART ISP)
The GO command is usually used after the flash image has been updated. After the
update a reset is required. Therefore, the GO command should point to the RESET
handler. Since the device is still in ISP mode, the RESET handler should do the following:
Re-initialize the SP pointer to the application default.
Set the SYSMEMREMAP to either 0x01 or 0x02.
While in ISP mode, the SYSMEMREMAP is set to 0x00.
Alternatively, the following snippet can be loaded into the RAM for execution:
SCB->AIRCR = 0x05FA0004; //issue system reset
while(1); //should never come here
This snippet will issue a system reset request to the core.
Table 382. UART ISP Copy RAM to flash command
Command C
Input Flash Address (DST): Destination flash address where data bytes are to be
written. The destination address should be a 256 byte boundary.
RAM Address (SRC): Source RAM address from where data bytes are to be read.
Number of Bytes: Number of bytes to be written. Should be 256 | 512 | 1024 |
4096.
Remark: In parts with less than 4 kB SRAM, the number of bytes is limited to 1024
(see Table 3 ).
Return Code CMD_SUCCESS |
SRC_ADDR_ERROR (Address not on word boundary) |
DST_ADDR_ERROR (Address not on correct boundary) |
SRC_ADDR_NOT_MAPPED |
DST_ADDR_NOT_MAPPED |
COUNT_ERROR (Byte count is not 256 | 512 | 1024 | 4096) |
SECTOR_NOT_PREPARED_FOR WRITE_OPERATION |
BUSY |
CMD_LOCKED |
PARAM_ERROR |
CODE_READ_PROTECTION_ENABLED
Description This command is used to program the flash memory. The "Prepare Sector(s) for
Write Operation" command should precede this command. The affected sectors are
automatically protected again once the copy command is successfully executed.
The boot block cannot be written by this command. This command is blocked when
code read protection is enabled.
Example "C 0 268437504 512<CR><LF>" copies 512 bytes from the RAM address
0x1000 0800 to the flash address 0.