# Returned value from adl\_fsInstall?

**URL:** <https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356>\
**Category:** Open AT\
**Created:** [June 4, 2013, 3:05pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356 "2013-06-04T15:05:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaG](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@MichaG](https://forum.sierrawireless.com/u/MichaG)\
**Post date:** [June 4, 2013, 3:05pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/1 "2013-06-04T15:05:18Z")

</div>

Hello,

In the ADL User Guide for Open AT Framework OS 6.50.A2 for AirPrime SL808xT and Q2698, here is what is written for adl\_fsInstall function:

> [@](#):
>
> Prototype  
> int adl\_fsInstall ( ascii \* filename )
> 
> Returned values  
> Embedded module resets on success. The parameter of the adl\_main function is then set to  
> ADL\_INIT\_DOWNLOAD\_SUCCESS, or ADL\_INIT\_DOWNLOAD\_ERROR, according to the  
> .DWL file update success or not.  
> errorcode – which was set a lasterror

But there is no documentation about the int returned value.  
Can Sierra Wireless clarify this point ?

Thanks.  
Marc

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [June 4, 2013, 3:56pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/2 "2013-06-04T15:56:38Z")

</div>

Here is the prototype for the adl\_adInstall function, maybe the return is similar?

```auto
/**
 * @brief A&D install process
 * @par Description: This function installs the content of the requested cell, if it is a .DWL file. This file should be an Open AT® application, an EEPROM configuration file, an XModem downloader binary file, or a Sierra Wireless Firmware binary file.
 * @note <b> Caution: This API resets the Wireless CPU® on success.</b>
 * @param [in] CellHandle A&D cell handle returned by #adl_adSubscribe function.
 * @retval reset Wireless CPU® resets on success. The parameter of the adl_main function is then set to ADL_INIT_DOWNLOAD_SUCCESS, or ADL_INIT_DOWNLOAD_ERROR, according to the .DWL file update success or not. Before the Wireless CPU® reset, all subscribed event handlers (if any) will receive the ADL_AD_EVENT_INSTALL event, in order to let them perform last operations.
 * @retval ADL_RET_ERR_BAD_STATE if the cell is not finalized
 * @retval ADL_RET_ERR_UNKNOWN_HDL if the handle was not subscribed
 * @retval ADL_RET_ERR_SERVICE_LOCKED if the function was called from a low level interrupt handler (the function is forbidden in this context)
 */
s32 adl_adInstall ( s32 CellHandle );
```

---

<div class="post-metadata">

**Author:** ![karlkuhn](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@karlkuhn](https://forum.sierrawireless.com/u/karlkuhn)\
**Post date:** [February 7, 2014, 3:16pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/3 "2014-02-07T15:16:04Z")

</div>

Hi, has anyone got more info on these return values? I have managed to download a dwl file and want to now install it. I call the adl\_fsInstall() method and get -6 back. No idea what it means though?

Any thoughts?

Thanks,

Karl

---

<div class="post-metadata">

**Author:** ![karlkuhn](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@karlkuhn](https://forum.sierrawireless.com/u/karlkuhn)\
**Post date:** [February 7, 2014, 3:34pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/4 "2014-02-07T15:34:36Z")

</div>

I have solved my problem… Silly mistake 😮 I was passing the wrong file name … BUT that means that maybe one of the error codes are now defined…

-6 = File does not exist (Or something to that effect)…

Cheers,

Karl

---

<div class="post-metadata">

**Author:** ![mikejamesleslie](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mikejamesleslie](https://forum.sierrawireless.com/u/mikejamesleslie)\
**Post date:** [October 28, 2014, 6:58pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/5 "2014-10-28T18:58:50Z")

</div>

Hi karlkuhn

Did you work out the issue installing from file system?

I’m getting error -1 returned from adl\_fsInstall which isn’t listed in the fs error codes OR the standard adl error codes ❗

From the file system error prototypes:

/\* 0 _/ ADL\_FS\_NO\_ERROR,  
/_ 1 _/ ADL\_FS\_ERR\_INVALIDDRIVE,  
/_ 2 _/ ADL\_FS\_ERR\_NOTFORMATTED,  
/_ 3 _/ ADL\_FS\_ERR\_INVALIDDIR,  
/_ 4 _/ ADL\_FS\_ERR\_INVALIDNAME,  
/_ 5 _/ ADL\_FS\_ERR\_NOTFOUND,  
/_ 6 _/ ADL\_FS\_ERR\_DUPLICATED,  
/_ 7 _/ ADL\_FS\_ERR\_NOMOREENTRY,  
/_ 8 _/ ADL\_FS\_ERR\_NOTOPEN,  
/_ 9 _/ ADL\_FS\_ERR\_EOF,  
/_ 10 _/ ADL\_FS\_ERR\_RESERVED,  
/_ 11 _/ ADL\_FS\_ERR\_NOTUSEABLE,  
/_ 12 _/ ADL\_FS\_ERR\_LOCKED,  
/_ 13 _/ ADL\_FS\_ERR\_ACCESSDENIED,  
/_ 14 _/ ADL\_FS\_ERR\_NOTEMPTY,  
/_ 15 _/ ADL\_FS\_ERR\_INITFUNC,  
/_ 16 _/ ADL\_FS\_ERR\_CARDREMOVED,  
/_ 17 _/ ADL\_FS\_ERR\_ONDRIVE,  
/_ 18 _/ ADL\_FS\_ERR\_INVALIDSECTOR,  
/_ 19 _/ ADL\_FS\_ERR\_READ,  
/_ 20 _/ ADL\_FS\_ERR\_WRITE,  
/_ 21 _/ ADL\_FS\_ERR\_INVALIDMEDIA,  
/_ 22 _/ ADL\_FS\_ERR\_BUSY,  
/_ 23 _/ ADL\_FS\_ERR\_WRITEPROTECT,  
/_ 24 _/ ADL\_FS\_ERR\_INVFATTYPE,  
/_ 25 _/ ADL\_FS\_ERR\_MEDIATOOSMALL,  
/_ 26 _/ ADL\_FS\_ERR\_MEDIATOOLARGE,  
/_ 27 _/ ADL\_FS\_ERR\_NOTSUPPSECTORSIZE,  
/_ 28 _/ ADL\_FS\_ERR\_UNKNOWN,  
/_ 29 _/ ADL\_FS\_ERR\_DRVALREADYMNT,  
/_ 30 _/ ADL\_FS\_ERR\_TOOLONGNAME,  
/_ 31 _/ ADL\_FS\_ERR\_NOTFORREAD,  
/_ 32 _/ ADL\_FS\_ERR\_DELFUNC,  
/_ 33 _/ ADL\_FS\_ERR\_ALLOCATION,  
/_ 34 _/ ADL\_FS\_ERR\_INVALIDPOS,  
/_ 35 _/ ADL\_FS\_ERR\_NOMORETASK,  
/_ 36 _/ ADL\_FS\_ERR\_NOTAVAILABLE,  
/_ 37 _/ ADL\_FS\_ERR\_TASKNOTFOUND,  
/_ 38 _/ ADL\_FS\_ERR\_UNUSABLE,  
/_ 39 \*/ ADL\_FS\_ERR\_CRCERROR,

/\* 60 _/ ADL\_FS\_ERR\_SECURE\_PATH = 60,  
/_ 61 _/ ADL\_FS\_ERR\_OPEN\_FILE,  
/_ 62 _/ ADL\_FS\_ERR\_LENGTH\_FILE,  
/_ 63 _/ ADL\_FS\_ERR\_READ\_FILE,  
/_ 64 _/ ADL\_FS\_ERR\_WRITE\_FILE,  
/_ 65 _/ ADL\_FS\_ERR\_FILE\_PRESENCE,  
/_ 66 _/ ADL\_FS\_ERR\_PASSWORD,  
/_ 67 \*/ ADL\_FS\_ERR\_NOT\_ALLOWED

From the adl error prototypes:

#define ADL\_RET\_ERR\_PARAM -2 ///\< Parameter error  
#define ADL\_RET\_ERR\_UNKNOWN\_HDL -3 ///\< Unknown handler, handle or resource error  
#define ADL\_RET\_ERR\_ALREADY\_SUBSCRIBED -4 ///\< Already subscribed service or resource error  
#define ADL\_RET\_ERR\_NOT\_SUBSCRIBED -5 ///\< Not subscribed service error  
#define ADL\_RET\_ERR\_FATAL -6 ///\< Fatal error  
#define ADL\_RET\_ERR\_BAD\_HDL -7 ///\< Bad handle or resource error  
#define ADL\_RET\_ERR\_BAD\_STATE -8 ///\< Bad state error  
#define ADL\_RET\_ERR\_PIN\_KO -9 ///\< Bad PIN state error  
#define ADL\_RET\_ERR\_NO\_MORE\_HANDLES -10 ///\< The service subscription maximum capacity is reached  
#define ADL\_RET\_ERR\_DONE -11 ///\< The required iterative process is now terminated  
#define ADL\_RET\_ERR\_OVERFLOW -12 ///\< The required operation has exceeded the function capabilities  
#define ADL\_RET\_ERR\_NOT\_SUPPORTED -13 ///\< An option, required by the function, is not enabled on the Wireless CPU®, the function is not supported in this configuration  
#define ADL\_RET\_ERR\_NO\_MORE\_TIMERS -14 ///\< The function requires a timer subscription, but no more timer resources are available  
#define ADL\_RET\_ERR\_NO\_MORE\_SEMAPHORES -15 ///\< The function requires a semaphore allocation, but there are no more semaphores resources  
#define ADL\_RET\_ERR\_SERVICE\_LOCKED -16 ///\< The function was called from a low or high lewel interrupt handler (the function is forbidden in this case)

#define ADL\_RET\_ERR\_SPECIFIC\_BASE -20 ///\< Beginning of specific errors ranges

No -1 to be found!!

---

<div class="post-metadata">

**Author:** ![karlkuhn](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@karlkuhn](https://forum.sierrawireless.com/u/karlkuhn)\
**Post date:** [October 28, 2014, 9:24pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/6 "2014-10-28T21:24:07Z")

</div>

Hi mikejamesleslie,

I am afraid I never found a list of error codes for adl\_fsInstall. My error code -6 was because I was passing in the wrong file path and it could not find the file. SiWi can you please update the documentation!!

It is fairly straight forward to use though. Make sure the file actually exists on the device. Retrieve it using DevStudio and do a binary compare. If the file is definitely there and it is correct then you should simply have to call adl\_fsInstall passing in the filename.

Sorry if that is not much help, it was a bit of trial and error for myself. But I can confirm that it does / can work…

Thanks,

Karl

---

<div class="post-metadata">

**Author:** ![MichaG](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@MichaG](https://forum.sierrawireless.com/u/MichaG)\
**Post date:** [October 29, 2014, 1:25pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/7 "2014-10-29T13:25:20Z")

</div>

Hello mikejamesleslie,

> [@mikejamesleslie](#):
>
> Hi karlkuhn  
> I’m getting error -1 returned from adl\_fsInstall which isn’t listed in the fs error codes OR the standard adl error codes ❗

What is the version of the firmware you use ?

Marc

---

<div class="post-metadata">

**Author:** ![mikejamesleslie](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mikejamesleslie](https://forum.sierrawireless.com/u/mikejamesleslie)\
**Post date:** [October 29, 2014, 10:20pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/8 "2014-10-29T22:20:02Z")

</div>

> [@MichaG](#):
>
> Hello mikejamesleslie,
> 
> > [@mikejamesleslie](#):
> >
> > Hi karlkuhn  
> > I’m getting error -1 returned from adl\_fsInstall which isn’t listed in the fs error codes OR the standard adl error codes ❗
> 
> What is the version of the firmware you use ?
> 
> Marc

Hi Marc

I’ve just recently upgraded to 7.51.1.A5, I am using the SL808x. I’ve eliminated the -1 error code from adl\_fsInstall after adjusting my method for writing to the fs (I think I had my “# of items to write” and “item size” mixed up in adl\_fsWrite). Now I am seeing the module reboot after install command, which is promising, but I am getting the ADL\_INIT\_DOWNLOAD\_ERROR initialization after each attempt to install the dwl file. The only method I have tested for downloading the file to the module is via FTP server. The FTP download application is robust and was copied over from a WMP100 DOTA application. Downloading appears to be working fine and is compatible with the SL.

Things I have confirmed:

- My dwl file is saved to the fs and it is named correctly
- I am calling the correct file name and path to install the file
- The file was built on the correct Framework profile to be compatible with my firmware
- The file is the same size as the source file on the FTP server and it’s copy in my workspace

Things I know I should test:

- Do a checksum on the file to ensure it is copied correctly
- Try another method for saving the file (for ex. over UART)

I wondering if anyone has any suggestions for my next step? Or maybe I just need to keep plugging away

So there are no obvious errors while downloading and saving the file. Everything works up until reboot and seeing the response of adl\_InitGetType. Is there any more information I can retrieve from the device to indicate a reason for not being able to install? Anything more than just ADL\_INIT\_DOWNLOAD\_ERROR?

---

<div class="post-metadata">

**Author:** ![mikejamesleslie](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mikejamesleslie](https://forum.sierrawireless.com/u/mikejamesleslie)\
**Post date:** [October 29, 2014, 10:24pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/9 "2014-10-29T22:24:22Z")

</div>

> [@karlkuhn](#):
>
> Hi mikejamesleslie,
> 
> I am afraid I never found a list of error codes for adl\_fsInstall. My error code -6 was because I was passing in the wrong file path and it could not find the file. SiWi can you please update the documentation!!
> 
> It is fairly straight forward to use though. Make sure the file actually exists on the device. Retrieve it using DevStudio and do a binary compare. If the file is definitely there and it is correct then you should simply have to call adl\_fsInstall passing in the filename.
> 
> Sorry if that is not much help, it was a bit of trial and error for myself. But I can confirm that it does / can work…
> 
> Thanks,
> 
> Karl

Hi Karl

Thanks for the response. What device and FW version did you have success with?

I’m curious as to what you mean by “Retrieve it using DevStudio and do a binary compare”. Are you saying you have a way of accessing the file saved on the device through devStudio and comparing it with the original dwl file?

Mike

---

<div class="post-metadata">

**Author:** ![mikejamesleslie](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mikejamesleslie](https://forum.sierrawireless.com/u/mikejamesleslie)\
**Post date:** [October 29, 2014, 11:46pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/10 "2014-10-29T23:46:00Z")

</div>

OK so I’ve figured out how to access the files system through dev studio. This is a huge perk when trying to debug a DOTA operation because you can eliminate the possibility of a corrupt FTP or FCM download as the culprit. This info would be really useful on some other threads I have come across.

I’ve simplified my process to downloading a dwl file to the module fs through the File System tab from Target Management. This is a tested and functional dwl file. See attached image showing the file “HelloWorld.dwl” as the only thing of the file system.

So we know there is a reliable dwl file waiting to be installed. No need to check the validity of the file correct? ❓

I then run this VERY simple application to subscribe to the file system and install HelloWorld.dwl:

```auto
#include "adl_global.h"
#include "generated.h"
#include "adl_filesystem.h"

ascii* fileName = "HelloWorld.dwl";

void installFile(void)
{
	adl_atSendResponse(ADL_AT_RSP, "\r\nInstalling ");
	adl_atSendResponse(ADL_AT_RSP, fileName);
	adl_atSendResponse(ADL_AT_RSP, "!\r\n");

	s32 ret = adl_fsInstall(fileName);
	if (ret != OK)
	{
		ascii buf[10];
		adl_atSendResponse(ADL_AT_RSP, "Error installing software: ");
		adl_atSendResponse(ADL_AT_RSP, wm_itoa(ret, buf));
		adl_atSendResponse(ADL_AT_RSP, "\r\n");
	}
}

void initFileSystem(void)
{
	s32 ret = 0;

	ret = adl_fsSubscribe();
	if (ret == OK)
		adl_atSendResponse(ADL_AT_RSP, "Successfully subscribed to file system\r\n");
	else
	{
		ascii buf[10];
		adl_atSendResponse(ADL_AT_RSP, "Error subscribing to file system: ");
		adl_atSendResponse(ADL_AT_RSP, wm_itoa(ret, buf));
		adl_atSendResponse(ADL_AT_RSP, "\r\n");
	}

	ret = adl_fsEnterFS();
	if (ret == OK)
		adl_atSendResponse(ADL_AT_RSP, "Successfully entered file system\r\n");
	else
	{
		ascii buf[10];
		adl_atSendResponse(ADL_AT_RSP, "Error entering file system: ");
		adl_atSendResponse(ADL_AT_RSP, wm_itoa(ret, buf));
		adl_atSendResponse(ADL_AT_RSP, "\r\n");
	}

	adl_atSendResponse(ADL_AT_RSP, "Install in 5 seconds...\r\n");
	adl_tmrSubscribe(FALSE, 50, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t) installFile);
}

static void checkResetReason(void)
{
	//Display the reason for last reboot
	adl_InitType_e init_type = adl_InitGetType();
	switch (init_type)
	{
	case ADL_INIT_POWER_ON:
		adl_atSendResponse(ADL_AT_RSP, "Normal power-on\r\n\r\n");
		break;

	case ADL_INIT_REBOOT_FROM_EXCEPTION:
		adl_atSendResponse(ADL_AT_RSP, "Reboot after an exception\r\n\r\n");
		break;

	case ADL_INIT_DOWNLOAD_SUCCESS:
		adl_atSendResponse(ADL_AT_RSP, "Reboot after a successful install process\r\n\r\n");
		break;

	case ADL_INIT_DOWNLOAD_ERROR:
		adl_atSendResponse(ADL_AT_RSP, "Reboot after an error in install process\r\n\r\n");
		break;

	case ADL_INIT_RTC:
		adl_atSendResponse(ADL_AT_RSP, "Power-on due to an RTC alarm\r\n\r\n");
		break;
	}

	initFileSystem();
}

void main_task(void)
{
	adl_atSendResponse(ADL_AT_RSP, "Installing file from file system\r\n");

	checkResetReason();
}
```

When this application is run, everything checks out. However after the module reboot occurs I do not have “HelloWorld.dwl” running and I get ADL\_INIT\_DOWNLOAD\_ERROR. There is very little I can do to simplify this process further.

The problem must lie with the way I define the file name, the way I subscribe to the FS service, or the way I have it saved on the module.

I am using an SL8084 modem on FW 7.51.1.A5  
 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/5/54b35c9aa06b7e07c5f04058094bd1490b1f2e3a.JPG)

---

<div class="post-metadata">

**Author:** ![sushil](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sushil](https://forum.sierrawireless.com/u/sushil)\
**Post date:** [October 30, 2014, 3:00am UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/11 "2014-10-30T03:00:39Z")

</div>

Try “/HelloWorld.dwl” instead of “HelloWorld.dwl”.

---

<div class="post-metadata">

**Author:** ![karlkuhn](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@karlkuhn](https://forum.sierrawireless.com/u/karlkuhn)\
**Post date:** [October 30, 2014, 7:13am UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/12 "2014-10-30T07:13:03Z")

</div>

As you said, there are only a few steps involved, so you need to test that each one is working correctly. Yes it seems you have a valid file in the filesystem. But can you access the filesystem successfully? Try and create a file and put some data it in. Then check from DevStudio if it exists. Now try and read the file and output it’s contents to the traces.

My process for subscribing to the filesystem is as follows:

```auto
ret = adl_fsSubscribe();
	if (ret)
	{
		trace("adl_fsSubscribe error %d", ret);
		return ret;
	}

	ret = adl_fsMountDrive(0, ADL_FS_INTERNAL_NOR, NULL);

	trace("adl_fsMountDrive ret %d", ret);
	if (ret)
		return ret;
	ret = adl_fsChDrive(0);
	trace(" adl_fsChDrive ret %d", ret);
```

I don’t seem to end up calling adl\_fsEnter(). Can’t remember why. Either way this is how I initialise it and I download data over a TCP/IP connection and then install it successfully. That said I am working on a FXT009 with 7.52

I hope that helps. But in general, try and test each step… then you can hopefully pinpoint your problem…

Karl

---

<div class="post-metadata">

**Author:** ![mikejamesleslie](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mikejamesleslie](https://forum.sierrawireless.com/u/mikejamesleslie)\
**Post date:** [March 2, 2015, 6:56pm UTC](https://forum.sierrawireless.com/t/returned-value-from-adl-fsinstall/6356/13 "2015-03-02T18:56:06Z")

</div>

FS install on the SL808x has been resolved.

Turns out is was nothing to do with the programming - I had purchased devices running a dated bootloader version, which was preventing the FS install form working. I had upgraded the FW but didn’t realize I need to also upgrade the bootloader.

Broken bootloader version: S4\_1\_0\_7BT R1431 CNSZXD00000155 2012/11/19 16:06:52
