Table 13-34. FlashReadResource Response Format (Example)
FlashReadResource
Response
Parameter
Value
Framing packet
start byte
0x5A
packetType
0xA4
length
0x0C 0x00
crc
0xD2 0xB0
Command packet
commandTag
0xB0
flags
0x01
reserved
0x00
parameterCount
0x02
status
0x0000_0000
byteCount
0x0000_0008
Data phase: The FlashReadResource command has a data phase. Because the target
(Kinetis Bootloader) works in slave mode, the host must pull data packets until the
number of bytes of data specified in the byteCount parameter of FlashReadResource
command
are received by the host.
13.3.7.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 or FlashEraseRegion command.
• Writing to flash requires the start address to be .
• The byte count will be rounded up to a multiple of , 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.
Chapter 13 Kinetis Flashloader
K22F Sub-Family Reference Manual , Rev. 3, 7/2014
Freescale Semiconductor, Inc.
307