ISP-IAP API Copy RAM to flash ISP

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 64 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 follows from the application of ECC to the flash write operation, see ISP-IAP API General description.
  3. To avoid write disturbance (a mechanism intrinsic to flash memories), an erase should be performed after following 16 consecutive writes inside the same page. Note that the erase operation then erases the entire sector.
    Note: 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).
Table 1. ISP-IAP API 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 64 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 64 | 128 | 256 | 512 | 1024.

Return Code CMD_SUCCESS |

SRC_ADDR_ERROR (Address not on word boundary) |

DST_ADDR_ERROR (Address not on correct boundary) |



COUNT_ERROR (Byte count is not 64 | 128 | 256 | 512 | 1024) |






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.