Hi everyone.
I'm trying to program some KL27s using the ROMN bootloader via SPI in a custom circuit and I am unable to write to memory using the WriteMemory command.
I use the FlashEraseUnsecure command then do the WriteMemory command which gets nacked at the first data packet.
Below a a capture of the packets sent over the SPI bus when attempting to set 100 bytes at address 0 to 0xA2
erase cmd 5A A4 4 0 F6 61 0D
ack 5A A1
Generic response 5A A4 0C 0 54 81 A0 0 0 2 0 0 0 0 0D 0 0 0
ack 5A A1
write cmd 5A A4 0C 0 6D 3A 4 1 0 2 0 0 0 0 64 0 0 0 0 0
ack 5A A1
Generic response 5A A4 0C 0 23 72 A0 0 0 2 0 0 0 0 4 0 0 0
ack 5A A1
data packet 5A A5 20 0 B4 B0 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2 A2
nack 5A A2
Does anyone have any ideas what I'm doing wrong?
Cheers,
Rich
已解决! 转到解答。
Problem solved!.
I had a subtle bug in the calculation of the data packet crc.
Thanks for the help.
There's no other activity going on. LPUART0 and 1 are not connected to anything at the moment and I'm not using I2C.
Apart from the SPI, it's all digital I/O which aren't changing states and 1 channel of ADC, which should be disabled in bootloader mode anyway.