I am currently using KE18 series controller and trying to use in built ROMBootloader feature. For sending commands such as memory write, the example shown in data sheet is having CRC16 field for the packet,
If my bin size is 20K and start address is 0x00 then, how do I compute CRC16, is it for whole image or only chunks of data? do you have any examples for the same? I am trying to use CAN loader and the PC side I am using one Python script to communicate over CAN. Appreciate a speedy response.
Dear chaitanyakumarbeeram,
In the following image you can see the description of this parameter:
So you will need to calculate the parameter from the start byte to the end of the command.
Best Regards,
Alexis Andalon
Thanks for your response, I have few more questions,
Say my binary size is 0x3c30 and start address is 0x00 then I would have to compute the CRC for 0x5A A4 0C 00 04 00 00 02 00 00 00 00 30 3C 00 00 and then insert the CRC like below:
0x5A A4 0C 00 crc_low crc_high 04 00 00 02 00 00 00 00 30 3C 00 00.
How long should I wait to get the response from board before sending the actual binary?
Now while sending binary do I need to always send 32 bytes in one packet as given is datasheet (0x5a a5 20 00 CRC16 32 bytes data)? Or Can I send more data in a packet?
How long I need to wait before sending next packet?
How often the Generic Response will be sent?
After receiving generic response, do we need to acknowledge that also?
what happens if I ignore the generic response?
Is there any better documentation to understand flow clearly?
Dear Chaitanya,
After each command the MCU will response with other Response packet that should have the same structure and this should have in the status code the kStatus_Success flag.
Each command packet should have 32 bytes long as the 23.3.7.4 Command packet says.
You should wait until you receive the response packet and the Generic Response will be send after each command.
I will suggest to verify that the command is succesful after each command.
You can also check the reference manual of the MCU bootlader:
https://www.nxp.com/docs/en/reference-manual/MCUBOOTRM.pdf
Let me know if this helps you.
Best Regards,
Alexis Andalon