Dwl checksum

Hi everybody,

I don’t know if adl_adInstall verify that .dwl file is valid or not. I have seen that XMODEM(en.wikipedia.org/wiki/XMODEM) format provide some checks but I don’t know if adl_adInstall implements theses checks.

If somebody have more information, I’m interested :smiley: .
Thanks

gdt

Hi gdt,
The adl_adInstall () API verifies the contents which you want to install. You can verify this by trying to install the contents of a cell which does not contain a .dwl file. When you call adl_adInstall () for this cell, your module will reset and will show ADL_INIT_DOWNLOAD_ERROR.

Also, please note that the XModem protocol which is implemented by DOTA sample performs check on the contents which are being written.

Hence you have,
|----------------------------------------------------------------------------------|

XModem header and checksum 128 byets of .dwl file

and so on. So, the DOTA sample, first of all makes sure that the 128 bytes of XMODEM packet (which is received over the air) is not corrupted. This is done using the XModem checksum. Only if the packet is not corrupted, it iw written. Please note that the XModem header is not written in the A&D memory. Only the 128 bytes .dwl payload is written.
In this way, the integrity of the payload data is maintained.

Also, when the complete .dwl file is written in A&D memory, adl_adInstall () API verfies if the cell whose contents it is going to write is a valid .dwl file. If it is, it tries to installs it. Otherwise, it gives ADL_INIT_DOWNLOAD_ERROR on restarting the module.

Hope, this clears your doubts,
Best Regards,
Open AT Fan.

Thank you for your response.
I will check the downloaded file to be sure that he’s valid.
Two checks are better than one :wink:

Best regards,

gdt