Information
Table 28-52. Program Section 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]
The requested section crosses a program flash sector boundary FSTAT[ACCERR]
The requested number of longwords is zero FSTAT[ACCERR]
The space required to store data for the requested number of longwords is more than half the
size of the FlexRAM
FSTAT[ACCERR]
The FlexRAM is not set to function as a traditional RAM, i.e. set if RAMRDY=0 FSTAT[ACCERR]
The flash address falls in a protected area FSTAT[FPVIOL]
Any errors have been encountered during the verify operation FSTAT[MGSTAT0]
28.4.11.8.1 Flash Sector Programming
The process of programming an entire flash sector using the Program Section command
is as follows:
1. If required, execute the Set FlexRAM Function command to make the FlexRAM
available as traditional RAM and initialize the FlexRAM to all ones.
2. Launch the Erase Flash Sector command to erase the flash sector to be programmed.
3. Beginning with the starting address of the FlexRAM, sequentially write enough data
to the RAM to fill an entire flash sector or half the FlexRAM, whichever is less. This
area of the RAM serves as the section program buffer.
NOTE
In step 1, the section program buffer was initialized to all
ones, the erased state of the flash memory.
The section program buffer can be written to while the operation launched in step 2
is executing, i.e. while CCIF = 0.
4. Execute the Program Section command to program the contents of the section
program buffer into the selected flash sector.
5. If a flash sector is larger than half the FlexRAM, repeat steps 3 and 4 until the sector
is completely programmed.
6. To program additional flash sectors, repeat steps 2 through 4.
7. To restore EEPROM functionality, execute the Set FlexRAM Function command to
make the FlexRAM available as EEPROM.
Flash Operation in Low-Power Modes
K20 Sub-Family Reference Manual, Rev. 2, Feb 2012
544 Freescale Semiconductor, Inc.
