Returned value from adl_fsInstall?

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:

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

Thanks.
Marc

Here is the prototype for the adl_adInstall function, maybe the return is similar?

/**
 * @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 );

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

I have solved my problem… Silly mistake :open_mouth: 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

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 :exclamation:

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!!

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

Hello mikejamesleslie,

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?

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

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? :question:

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

#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

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

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:

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

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