you do the adl_adInstall, but you don’t “kick” your watchdog;
the time it takes to install the new app & restart is close to your watchdog timeout (especially if the adl_adInstall happened near the end of a Watchdog period);
so the watchdog “bites” before the new application has got as far as its first “kick” of the watchdog;
this time, the module restarts more quickly (doesn’t have to do the install) so the application’s first “kick” of the watchdog comes in plenty of time;
Hence the adl_adInstall appears to have caused a double restart.
Is that about it?
But this doesn’t appear to acount for charlvz’s problem - does it?
Nope its not, I believe the data from my GPS is causing multiple resets. I have seen how after a reset the modem keeps on resetting until I fisically remove the GPS from UART1…that gives the indication that the data going in on UART1 while the unit is resetting is causing multiple resets.
Have the version number embedded in the application somehow; eg,
ascii version_string[] = "v1.2.3";
Have your apllication write this version number into the module’s Flash.
When the application starts, it checks the version recorded in Flash against its own version; if they differ, it knows that an update has occurred - and can act accordingly…
I have considered it, but the real problem was that the module kept on resetting if the GPS was constantly sending data. I solved this by polling for GPS info instead of having the GPS send data on a 1second interval. The module is only resetting once now.