Fillmemory Command - NXP Semiconductors freescale KV4 Series Reference Manual

Table of Contents

Advertisement

Response: The target (Kinetis Flashloader ) will return a GenericResponse packet with
one of following error status codes.
Table 14-22. FlashEraseRegion Response Status Codes
Status Code
kStatus_Success (0x0)
kStatus_MemoryRangeInvalid (0x10200)
kStatus_FlashAlignmentError (0x101)
kStatus_FlashAddressError (0x102)
kStatus_FlashAccessError (0x103)
kStatus_FlashProtectionViolation (0x104)
kStatus_FlashCommandFailure (0x105)

14.2.6.5 FillMemory command

The FillMemory command fills a range of bytes in memory with a data pattern. It follows
the same rules as the WriteMemory command. The difference between FillMemory and
WriteMemory is that a data pattern is included in FillMemory command parameter, and
there is no data phase for the FillMemory command, while WriteMemory does have a
data phase.
Table 14-23. Parameters for FillMemory Command
Byte #
0 - 3
4 - 7
8 - 11
• To fill with a byte pattern (8-bit), the byte must be replicated 4 times in the 32-bit
pattern.
• To fill with a short pattern (16-bit), the short value must be replicated 2 times in the
32-bit pattern.
For example, to fill a byte value with 0xFE, the word pattern would be 0xFEFEFEFE; to
fill a short value 0x5AFE, the word pattern would be 0x5AFE5AFE.
Special care must be taken when writing to flash.
• First, any flash sector written to must have been previously erased with a
FlashEraseAll or FlashEraseRegion command.
Freescale Semiconductor, Inc.
Start address of memory to fill
Number of bytes to write with the pattern
• The start address should be 32-bit aligned.
• The number of bytes must be evenly divisible by 4.
32-bit pattern
KV4x Reference Manual, Rev. 2, 02/2015
Preliminary
Chapter 14 Kinetis Flashloader
Command
235

Advertisement

Table of Contents
loading

Table of Contents