Hello,
I am using DA16600 for my project. I want to develop a system to update the DA16600 firmware on-field.
I referred the documentation and implemented Y-Modem protocol. Everything works fine, except for the last packet.
According the the protocol used, packet size is 1024 bytes. there will be a case where, the last packet will be smaller and padding has to be done. In my code, padding is done with '\0' byte, but when same firmware is downloaded with multidownloader tool, padding bytes are different. please refer the attached file [time marker '0' marks the end of firmware file and the rest are padding bytes].
7534.refer.zip
folder contains 3 files;
1. CP145_WIFI_RTOS.img [firmware image used, this is RTOS image renamed manually]
2. fw_update_manual.sal [this is a capture of programming the DA16600 using my MCU]
3. fw_update_multidownloader.sal [this is a capture of programming the DA16600 using multidownloader tool]
how to generate these padding bytes ? can you direct me to a documentation mentioning this ?
Thank you.
Kind regards,
synd223
Hi Synd223,Apologies for the delay.Unfortunately, there is no special document about Y-Modem.Please find attached a code snippet of the multidownloader tool.The main function for packetizing is makePacketAndSend which is called from DownloadImage.Regardless of size, the packet size is 1024+5, CRC is located at the same location.The last packet must have the same shape.
//innerData = Enumerable.Repeat((byte)26, 1024).ToArray(); Buffer.BlockCopy(fData, fDataOffset, innerData, 0, size); packet[0] = 0x02; //long packet Buffer.BlockCopy(innerData, 0, packet, 3, 1024); crc = CRC16(innerData, 1024); packet[1024 + 5 - 2] = (byte)(crc >> 8); packet[1024 + 5 - 1] = (byte)(crc); packetLen = 1024 + 5;
Hi OV_Renesas,
Thank you for the clarification.
Please correct me if I am wrong.
As you mentioned, the last packet should have the same shape as the previous ones [as per the Y-Modem protocol],
I am assuming the padding [extra bytes] will not matter and can be null characters. is this correct ?Best Regards,
HI Synd223.Thank you for the reply.
synd223 said:I am assuming the padding [extra bytes] will not matter and can be null characters. is this correct ?
That's right. The padding at last packet does not matter and can be null character. When image is loaded from flash, only actual image(the size is in the header of image) is loaded. Best Regards,OV_Renesas
Thank you so much for the clarification.
Best Regards,
synd223.