Wait
for response
Yes
Yes
Waitfor payload
length part from
target (2 bytes)
Wait for CRC
checksum from
Payload length
less than supported
length?
Yes
Wait for payload
data from target
No
Set payload length
to maximum
supported length
No
No
Reached
maximum
Report a timeout
error (End)
Yes
End
No
0x5A
received?
0xA4
received?
Wait for 1 byte
from target
Wait for 1 byte
from target
retries?
target (2 bytes)
Figure 13-26. Host reads a command response from target via UART
13.4.4
USB peripheral
The Kinetis Flashloader supports loading data into flash via the USB peripheral. The
target is implemented as a USB HID class.
USB HID does not use framing packets; instead the packetization inherent in the USB
protocol itself is used. The ability for the device to NAK Out transfers (until they can be
received) provides the required flow control; the built-in CRC of each USB packet
provides the required error detection.
13.4.4.1
Clock configuration
The flashloader supports the crystal-less USB feature. If the USB peripheral is enabled,
then the flashloader enables the 48-MHz IRC. The flashloader also enables the USB
clock recovery feature (by setting
USBx_CLK_RECOVER_CTRL[CLOCK_RECOVER_EN] to 1 and
USB_CLK_RECOVER_IRC_EN[IRC_EN] to 1).
13.4.4.2
Device descriptor
The Kinetis flashloader configures the default USB VID/PID/Strings as below:
Peripherals Supported
K22F Sub-Family Reference Manual, Rev. 4, 08/2016
334 NXP Semiconductors