Response: The target (Kinetis Bootloader ) will return a GenericResponse packet with
status code either set to kStatus_Success for successful execution of the command, or set
to an appropriate error status code.
13.3.8.6 FlashEraseRegion command
The FlashEraseRegion command performs an erase of one or more sectors of the flash
memory or a specified range of flash within the connected SPI flash devices.
The start address and number of bytes are the 2 parameters required for the
FlashEraseRegion command. The start and byte count parameters must be 4-byte aligned
([1:0] = 00), or the FlashEraseRegion command will fail and return
kStatus_FlashAlignmentError (0x101). If the region specified does not fit in the flash
memory space, the FlashEraseRegion command will fail and return
kStatus_FlashAddressError (0x102). If any part of the region specified is protected, the
FlashEraseRegion command will fail and return kStatus_MemoryRangeInvalid
(0x10200).
Table 13-27. Parameters for FlashEraseRegion Command
Byte #
Parameter
0 - 3
Start address
4 - 7
Byte count
Process command
Host
Target
ACK:
0x5a a1
ACK:
0x5a a1
Generic Response:
FlashEraseRegion: startAddress=0, byteCount=1024
0x5a a4 0c 00 f9 a6 02 00 00 00 00 00 00 00 00 04 00 00
0x5a a4 0c 00 ba 55 a0 00 00 02 00 00 00 00 02 00 00 00
Figure 13-11. Protocol Sequence for FlashEraseRegion Command
Functional Description
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
200
Freescale Semiconductor, Inc.