![NXP Semiconductors freescale KV4 Series Reference Manual Download Page 225](http://html1.mh-extra.com/html/nxp-semiconductors/freescale-kv4-series/freescale-kv4-series_reference-manual_1721789225.webp)
uint16_t crc16_update(const uint8_t * src, uint32_t lengthInBytes)
{
uint32_t crc = 0;
uint32_t j;
for (j=0; j < lengthInBytes; ++j)
{
uint32_t i;
uint32_t byte = src[j];
crc ^= byte << 8;
for (i = 0; i < 8; ++i)
{
uint32_t temp = crc << 1;
if (crc & 0x8000)
{
temp ^= 0x1021;
}
crc = temp;
}
}
return crc;
}
14.2.5.4 Command packet
The command packet carries a 32-bit command header and a list of 32-bit parameters.
Table 14-7. Command Packet Format
Command Packet Format (32 bytes)
Command Header (4 bytes)
28 bytes for Parameters (Max 7 parameters)
Tag
Flags
Rsvd
Param
Count
Param1
(32-bit)
Param2
(32-bit)
Param3
(32-bit)
Param4
(32-bit)
Param5
(32-bit)
Param6
(32-bit)
Param7
(32-bit)
byte 0 byte 1 byte 2 byte 3
Chapter 14 Kinetis Flashloader
KV4x Reference Manual, Rev. 2, 02/2015
Freescale Semiconductor, Inc.
Preliminary
225
Summary of Contents for freescale KV4 Series
Page 2: ...KV4x Reference Manual Rev 2 02 2015 2 Preliminary Freescale Semiconductor Inc...
Page 60: ...KV4x Reference Manual Rev 2 02 2015 60 Preliminary Freescale Semiconductor Inc...
Page 128: ...Debug Security KV4x Reference Manual Rev 2 02 2015 128 Preliminary Freescale Semiconductor Inc...
Page 138: ...Boot KV4x Reference Manual Rev 2 02 2015 138 Preliminary Freescale Semiconductor Inc...
Page 1358: ...KV4x Reference Manual Rev 2 02 2015 1358 Preliminary Freescale Semiconductor Inc...