![NXP Semiconductors MKL27Z128VFM4 Reference Manual Download Page 917](http://html1.mh-extra.com/html/nxp-semiconductors/mkl27z128vfm4/mkl27z128vfm4_reference-manual_1721847917.webp)
Upon clearing CCIF to launch the Program Longword command, the flash memory
module programs the data bytes into the flash using the supplied address. The targeted
flash locations must be currently unprotected (see the description of the FPROT registers)
to permit execution of the Program Longword operation.
The programming operation is unidirectional. It can only move NVM bits from the erased
state ('1') to the programmed state ('0'). Erased bits that fail to program to the '0' state are
flagged as errors in FSTAT[MGSTAT0]. The CCIF flag is set after the Program
Longword operation completes.
The supplied address must be longword aligned (flash address [1:0] = 00):
• Byte 3 data is written to the supplied byte address ('start'),
• Byte 2 data is programmed to byte address start+0b01,
• Byte 1 data is programmed to byte address start+0b10, and
• Byte 0 data is programmed to byte address start+0b11.
Table 45-17. Program Longword Command Error Handling
Error Condition
Error Bit
Command not available in current mode/security
FSTAT[ACCERR]
An invalid flash address is supplied
FSTAT[ACCERR]
Flash address is not longword aligned
FSTAT[ACCERR]
Flash address points to a protected area
FSTAT[FPVIOL]
Any errors have been encountered during the verify operation
FSTAT[MGSTAT0]
45.4.10.6 Erase Flash Block Command
The Erase Flash Block operation erases all addresses in a single program flash.
Table 45-18. Erase Flash Block Command FCCOB Requirements
FCCOB Number
FCCOB Contents [7:0]
0
0x08 (ERSBLK)
1
Flash address [23:16] in the flash block to be erased
2
Flash address [15:8] in the flash block to be erased
3
Flash address [7:0]
in the flash block to be erased
1. Must be longword aligned (Flash address [1:0] = 00).
Upon clearing CCIF to launch the Erase Flash Block command, the flash memory
module erases the main array of the selected flash block and verifies that it is erased. The
Erase Flash Block command aborts and sets the FSTAT[FPVIOL] bit if any region
Chapter 45 Flash Memory Module (FTFA)
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Freescale Semiconductor, Inc.
917