# Application upgrade using adl\_ad service

**URL:** <https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531>\
**Category:** Legacy AirPrime modules\
**Created:** [June 24, 2010, 8:17am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531 "2010-06-24T08:17:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micrologic](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@Micrologic](https://forum.sierrawireless.com/u/Micrologic)\
**Post date:** [June 24, 2010, 8:17am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/1 "2010-06-24T08:17:47Z")

</div>

Is it possible for a running embedded application to upgrade itself (using the adl\_adInstall function) if the new .DWL application is already contained in a A&D Storage cell.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 24, 2010, 8:46am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/2 "2010-06-24T08:46:59Z")

</div>

Yes - that is the purpose of the adl\_adInstall function! 8)

---

<div class="post-metadata">

**Author:** ![Micrologic](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@Micrologic](https://forum.sierrawireless.com/u/Micrologic)\
**Post date:** [June 24, 2010, 8:57am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/3 "2010-06-24T08:57:41Z")

</div>

Thanks, good to know. Well, when I load the content of the .DWL file (binary) into a cell, finalize and then install, the ADL\_AD\_EVENT\_INSTALL notification occurrs, and module resets. Old application still starts and adl\_adGetInstallResult returns ADL\_AD\_RET\_ERR\_UPDATE\_FAILURE. Can you confirm that my understanding of the process is correct?

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 24, 2010, 9:33am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/4 "2010-06-24T09:33:07Z")

</div>

> [@Micrologic](#):
>
> Can you confirm that my understanding of the process is correct?

Yes, that’s the correct process.

> [@](#):
>
> Old application still starts and adl\_adGetInstallResult returns ADL\_AD\_RET\_ERR\_UPDATE\_FAILURE

That’s correct: If the update fails, the old application should still run.

Presumably you get a similar indication in the InitType parameter of adl\_main?

Most likely, the new application image is getting corrupted somewhere in the transfer.  
Does the same .dwl file load correctly via AT+WDWL ?

BTW: I did once have a .dwl file that would load correctly via AT+WDWL but not via DOTA - but this has only ever happened once in many years.  
(it appeared to be a glitch in the build system - it worked after a rebuild).

---

<div class="post-metadata">

**Author:** ![Micrologic](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@Micrologic](https://forum.sierrawireless.com/u/Micrologic)\
**Post date:** [June 30, 2010, 7:50am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/5 "2010-06-30T07:50:16Z")

</div>

I have written an application to calculate the CRC16-CCITT on the .DWL file content before transmitting the file to the A&D Cell. I have also modified my embedded application to step through each byte in the to be installed Cell calculating the content’s CRC16. These CRC’s are exactly the same, indicating that the content has been successfully transferred into the cell. There must still be something that I am missing? I am at a loss! Any ideas?

I can add that using XMODEM to download the same .DWL file results in the module being reprogram as expected.

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [July 4, 2010, 4:03am UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/6 "2010-07-04T04:03:37Z")

</div>

Hiya,

> [@Micrologic](#):
>
> I have written an application to calculate the CRC16-CCITT on the .DWL file content before transmitting the file to the A&D Cell. I have also modified my embedded application to step through each byte in the to be installed Cell calculating the content’s CRC16. These CRC’s are exactly the same, indicating that the content has been successfully transferred into the cell.

I’m wondering it you have hit an endianness issue when transferring the data down to the A&D cell?

Can you transfer write a known sequence of bytes to the A&D cell, then read it back and see if the endianness is the same…

Just my two cents worth…

ciao, Dave

---

<div class="post-metadata">

**Author:** ![victorjd](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@victorjd](https://forum.sierrawireless.com/u/victorjd)\
**Post date:** [July 12, 2010, 3:26pm UTC](https://forum.sierrawireless.com/t/application-upgrade-using-adl-ad-service/4531/7 "2010-07-12T15:26:46Z")

</div>

> [@Micrologic](#):
>
> Well, when I load the content of the .DWL file (binary) into a cell

If you use protocol like XMODEM it is possible that loaded DWL expanded by some garbage bytes - its because of 128 bytes multiplication of filesize in old OS from which xmodem came from. This “tail” also can produce effect like you mention in some cases - OS check loaded image before installing and consider it broken.
