![NXP Semiconductors MKL27Z128VFM4 Reference Manual Download Page 204](http://html1.mh-extra.com/html/nxp-semiconductors/mkl27z128vfm4/mkl27z128vfm4_reference-manual_1721847204.webp)
13.3.8.9 WriteMemory command
The WriteMemory command writes data provided in the data phase to a specified range
of bytes in memory (flash or RAM). However, if flash protection is enabled, then writes
to protected sectors will fail.
Special care must be taken when writing to flash.
• First, any flash sector written to must have been previously erased with a
FlashEraseAll, FlashEraseRegion, or FlashEraseAllUnsecure command.
• Writing to flash requires the start address to be 4-byte aligned ([1:0] = 00).
• The byte count will be rounded up to a multiple of 4, and the trailing bytes will be
filled with the flash erase pattern (0xff).
• If the VerifyWrites property is set to true, then writes to flash will also perform a
flash verify program operation.
When writing to RAM, the start address need not be aligned, and the data will not be
padded.
The start address and number of bytes are the 2 parameters required for WriteMemory
command.
Table 13-33. Parameters for WriteMemory Command
Byte #
Command
0 - 3
Start address
4 - 7
Byte count
Functional Description
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
204
Freescale Semiconductor, Inc.