I'm currently trying to program a KL17 microcontroller using another microcontroller and the KL17's built in UART ROM bootloader. I got pinging and erasing done, at least on the paper, but I'm struggling with writing data to the KL17. The example in the datasheet (page 43) says that for those bytes (framing packet, excluding CRC16 bytes + memory write command packet):
0x5A, 0xA4, 0x0C, 0x00, 0x04, 0x00 , 0x00, 0x02, 0x00, 0x04, 0x00, 0x20, 0x64, 0x00, 0x00, 0x00
the CRC16 bytes would be 0x06 0x5A. However the CRC16 algorithm provided on page 27 outputs 0x2b 0x56 for me. I've also tried various CRC16 calculators online with many different variants of CRC16 calculation but none of them gave me 0x06 0x5A.
Noay_0-1790003799652.png
My assumption is that I'm either missing bytes that must be included into the caluclation (I wouldn't know which since the data packets following afterwards all got their own CRC16 bytes) or that someone just messed up the datasheet (which is also unlikely because this example is also exactly like that in the KL17 Sub-Family Reference Manual).