UM10850
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 2.4 — 13 September 2016
425 of 464
NXP Semiconductors
UM10850
Chapter 31: LPC5410x Flash API
31.5.5 Read Memory
Reads the plain binary code of the data stream, followed by the CMD_SUCCESS return
code.
31.5.6 Prepare sectors for write operation
This command makes flash write/erase operation a two step process.
31.5.7 Copy RAM to flash
When writing to the flash, the following limitations apply:
1. The smallest amount of data that can be written to flash by the copy RAM to flash
command is 256 byte (equal to one page).
2. One page consists of 16 flash words (lines), and the smallest amount that can be
modified per flash write is one flash word (one line). This limitation exists because
ECC is applied during the flash write operation, see
3. To avoid write disturbance (a mechanism intrinsic to flash memories), an erase should
be performed after 16 consecutive writes inside the same page. Note that the erase
operation then erases the entire sector.
Table 481. USART ISP Read Memory command
Command
R
Input
Start Address:
Address from where data bytes are to be read. This address should be a word boundary.
Number of Bytes:
Number of bytes to be read. Count should be a multiple of 4.
Return Code
CMD_SUCCESS followed by <actual data (plain binary)> |
ADDR_ERROR (Address not on word boundary) |
ADDR_NOT_MAPPED |
COUNT_ERROR (Byte count is not a multiple of 4) |
PARAM_ERROR |
CODE_READ_PROTECTION_ENABLED
Description
This command is used to read data from RAM or flash memory. This command is blocked when code read
protection is enabled.
Example
"R 33554432 4<CR><LF>" reads 4 bytes of data from address 0x0200 0000.
Table 482. USART ISP Prepare sectors for write operation command
Command
P
Input
Start Sector Number
End Sector Number:
Should be greater than or equal to start sector number.
Return Code
CMD_SUCCESS |
BUSY |
INVALID_SECTOR |
PARAM_ERROR
Description
This command must be executed before executing "Copy RAM to flash" or "Erase Sector(s)" command.
Successful execution of the "Copy RAM to flash" or "Erase Sector(s)" command causes relevant sectors to
be protected again. To prepare a single sector use the same "Start" and "End" sector numbers.
Example
"P 0 0<CR><LF>" prepares the flash sector 0.