WMP100 adl & File System

Hi, thank you.
I tried to do as you explained but this is what I get:

[10/08/13 17:05:54:667]at+wopen=0
[10/08/13 17:06:00:573] OK
[10/08/13 17:06:00:588] 
[10/08/13 17:06:00:592] +WIND: 13
[10/08/13 17:06:01:843] 
[10/08/13 17:06:01:844] +WIND: 1
[10/08/13 17:06:03:167] 
[10/08/13 17:06:03:169] +WIND: 16
[10/08/13 17:06:06:954] 
[10/08/13 17:06:06:955] +WIND: 4
[10/08/13 17:06:06:956] 
[10/08/13 17:06:06:957] +WIND: 10,"SM",0,"FD",0,"ON",0,"SN",0,"EN",0
[10/08/13 17:06:06:958] 
[10/08/13 17:06:06:959] +WIND: 11,,,,,"2A07875F0FAD57D22D0C487673B43696",
[10/08/13 17:06:07:075] 
[10/08/13 17:06:07:076] +WIND: 7
[10/08/13 17:06:23:125] AT+WOPEN=9,64
[10/08/13 17:06:23:138] ERROR
[10/08/13 17:06:45:486] AT+WOPEN=9,128
[10/08/13 17:06:45:498] ERROR
[10/08/13 17:07:03:120] AT+WOPEN=9,256
[10/08/13 17:07:03:129] ERROR
[10/08/13 17:07:18:247] AT+WOPEN=9,1024
[10/08/13 17:07:18:256] ERROR
[10/08/13 17:08:49:015] AT+WOPEN=9,4096
[10/08/13 17:08:49:027] ERROR
[10/08/13 17:10:57:776] AT+WOPEN?
[10/08/13 17:10:57:783] +WOPEN: 0
[10/08/13 17:10:57:784] 
[10/08/13 17:10:57:785] OK

Can you give the responses of the AT commands:

  • AT+WOPEN=?
  • AT+WOPEN=9

Thanks.

[10/09/13 08:45:21:626] AT+WOPEN=?
[10/09/13 08:45:21:642] +WOPEN: (0-9),(64-768),(0-24),(0-24)
[10/09/13 08:45:21:643] 
[10/09/13 08:45:21:644] OK
[10/09/13 08:45:28:612]  AT+WOPEN=9
[10/09/13 08:45:28:624] +WOPEN: 9,0,192
[10/09/13 08:45:28:625] 
[10/09/13 08:45:28:626] OK

Hi, good morning. If I firs give AT+WOPEN=1, the result is different. CME ERROR 3 should mean “Operation not allowed”. I don’t understand why and how to solve this.

[10/09/13 10:20:55:851] AT+WOPEN?
[10/09/13 10:20:55:863] +WOPEN: 1
[10/09/13 10:20:55:878] 
[10/09/13 10:20:55:879] OK
[10/09/13 10:21:11:144] AT+WOPEN=9,256
[10/09/13 10:21:11:161] +CME ERROR: 3

Hi,

Do you know the size of your flash memory ?
Can you send the response of AT+WOPEN=6 command ?
File system is not available because the size assigned to the FS in flash is null for now.
Normally, your module has 192KB not allocated which can be used for the FS. Can you try AT+WOPEN=9,192 command ?

Thanks.

[10/09/13 12:30:31:742] at+wopen=6
[10/09/13 12:30:31:754] +WOPEN: 6,832,192
[10/09/13 12:30:31:755] 
[10/09/13 12:30:31:756] OK
[10/09/13 12:30:43:270] at+wopen=9,192
[10/09/13 12:30:43:281] +CME ERROR: 3

Memory: a total of 4MB Flash (expandable to 8MB) and 2MB Ram. 3MB Flash
(7MB with expansion) and 1.5MB Ram are available for user applications.
The others resources are occupied by Open AT O.S.

I need the file system because my application must send via ftp a text file which might reach even one megabyte in size.

Hi,

Can you provide the response of ati9 ?
I think FS is not available for the flash of 4MB.

First, try to reduce the size of the A&D flash area: AT+WOPEN=6,256 (you may loose the saved data). There’s no enough available space in flash for the file system.
Then try to reserve the FS area: AT+WOPEN=9,256

Thanks.

Hi,
we’ve got an improvement! (Look at the command terminal below, underscores appearance mean that the system restarted)

But when I run the application the behaviour’s not changed:

adl_fsEnterFS still make the app crash. :cry:

[10/09/13 16:16:28:734] ati 9
[10/09/13 16:16:28:766] "DWL","V09c08","","Sierra Wireless",55684,"053112 09:27","6baf6254","00010000"
[10/09/13 16:16:28:767] "FW","FW_751_14.WMP100F","R7.51.0.201205311751.WMP100","Sierra Wireless",620780,"053112 17:51","de5225b8","001c0000"
[10/09/13 16:16:28:792] "MODEM","1.2.12","201205311748.WMP100","Sierra Wireless",1660692,"053112 17:48","16b6cdaa","00020000"
[10/09/13 16:16:28:793] "OAT","v1.0.11","SmartMeteringAugusto","Topcon Infomobility s.r.l.",138376,"100913 16:13","7e980f6d","002a0000"
[10/09/13 16:16:28:803] "ROM","400000"
[10/09/13 16:16:28:803] "RAM","200000"
[10/09/13 16:16:28:806] "DWLNAME","WMP100"
[10/09/13 16:16:28:807] 
[10/09/13 16:16:28:807] OK
[10/09/13 16:16:47:960] AT+WOPEN=6,256
[10/09/13 16:16:47:973] +WOPEN: 6,256,768
[10/09/13 16:16:54:437] 
[10/09/13 16:16:54:438] OK
[10/09/13 16:16:54:524] 
[10/09/13 16:16:54:525] __________________________________________________________________
[10/09/13 16:16:54:526] Application Name:SmartMeteringAugusto

....

[10/09/13 16:17:10:823] AT+WOPEN=9,256
[10/09/13 16:17:19:146] +WOPEN: 9,256,512
[10/09/13 16:17:21:520] 
[10/09/13 16:17:21:521] OK
[10/09/13 16:17:21:696] 
[10/09/13 16:17:21:697] __________________________________________________________________
[10/09/13 16:17:21:698] Application Name:SmartMeteringAugusto

...

[10/09/13 16:19:40:086] at+wopen=9
[10/09/13 16:19:40:102] +WOPEN: 9,256,512
[10/09/13 16:19:40:118] 
[10/09/13 16:19:40:119] OK

Hi,

Yes, looks better. Now the file system area is allocated (AT+WOPEN=9,… and AT+WOPEN=6,… parameters are stored in flash, no need to execute them at each boot).

Do you subscribe to the file system service (call call adl_fsSubscribe() API into your applciation) ?

Thanks.

Yes, thank you! That what was missing.

I have now changed my app into the following simple code, in order to write a string to a file then read it back. I just can’t open the adl_fsOpen returns NULL. Sorry to bother you again.
I was also wondering where to look at in the documentation on how to manage files, since I feel I miss some knowledge. Is there the functions’ reference only?

int MyFunction ( void )
{
	int ret = -1;
	ADL_FS_FILE *file;
	
	debugPrint("\nadl_fsSubscribe();");
	
	adl_fsSubscribe();
	
	debugPrint("\nMyFunction:entering");

	adl_InitType_e adl_InitType = adl_InitGetType ();

	debugPrint("\nEmbedded : Appli Init, init type >%d<    ", adl_InitType);
  
	ret = adl_fsEnterFS();
	
	if ( ret )
	{
		debugPrint("\nMyFunction: adl_fsEnterFS error %d", ret );
		return ret;
	}
	
	// mount the first volume on the internal NOR Flash
	ret = adl_fsMountDrive( 0, ADL_FS_INTERNAL_NOR, NULL );
	
	debugPrint("\nadl_fsMountDrive %d", ret);

	// set the first volume as current volume
	adl_fsChDrive( 0 );
	
	debugPrint("\nfile = adl_fsOpen");
	
	// open a file in read mode
	file = adl_fsOpen("/file.txt", "w+");
	
	debugPrint("\nadl_fsOpen in write mode returns %d", file);
	
	ascii myname[] = {"Roberto Turci"};
	adl_fsWrite(myname, sizeof(ascii), sizeof(myname)/sizeof(ascii), file);

	debugPrint("\nadl_fsWrite fatta");
	
	if (file == NULL)
	{
		debugPrint("\nMyFunction: error while opening file ");
		return -1;
	}

	// close the file
	adl_fsClose(file);

	ADL_FS_FILE *file2;
	// open a file in read mode
	file2 = adl_fsOpen("/dir/file.txt", "r");

	if (file2 == NULL)
	{
		debugPrint("\nMyFunction: error while opening file2 ");
		return -1;
	}
	
	debugPrint("\nadl_fsOpen in read mode returns %d", file2);
	
	ascii readbuf[200];
	adl_fsRead(readbuf, sizeof(ascii), sizeof(myname)/sizeof(ascii), file2);

	// close the file
	adl_fsClose(file2);
	
	debugPrint("readbuf is %s", readbuf);

		
	
	// release File System service from current task
	adl_fsReleaseFS();

	return 0;
}

The Output debug window shows the following:

[10/10/13 17:38:55:502] B4 MyFunction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[10/10/13 17:38:55:503] adl_fsSubscribe();
[10/10/13 17:38:55:512] MyFunction:ingresso
[10/10/13 17:38:55:513] Embedded : Appli Init, init type >0<    
[10/10/13 17:38:55:669] adl_fsMountDrive 2
[10/10/13 17:38:55:685] file = adl_fsOpen
[10/10/13 17:38:55:702] adl_fsOpen in write mode returns 0
[10/10/13 17:38:55:703] adl_fsWrite fatta
[10/10/13 17:38:55:714] MyFunction: error while opening file 
[10/10/13 17:38:55:715] After MyFunction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Hi,

adl_fsMountDrive returns the error code 2. Accroding to ADL user guide, it means that ADL_FS_ERR_NOTFORMATTED. So try to format the file system using adl_fsFormat API.

Thanks.

Hi, since adl_fsFormat returns 1, where can I find the meaning of this function’s returned error values?

Hi,

1 value means ADL_FS_ERR_INVALIDDRIVE.
The error codes are documented into the ADL userguide (but maybe your revision is not up-to-date).
Here is the error codes list:
Enum
{
ADL_FS_NO_ERROR,
ADL_FS_ERR_INVALIDDRIVE,
ADL_FS_ERR_NOTFORMATTED,
ADL_FS_ERR_INVALIDDIR,
ADL_FS_ERR_INVALIDNAME,
ADL_FS_ERR_NOTFOUND,
ADL_FS_ERR_DUPLICATED,
ADL_FS_ERR_NOMOREENTRY,
ADL_FS_ERR_NOTOPEN,
ADL_FS_ERR_EOF,
ADL_FS_ERR_RESERVED,
ADL_FS_ERR_NOTUSEABLE,
ADL_FS_ERR_LOCKED,
ADL_FS_ERR_ACCESSDENIED,
ADL_FS_ERR_NOTEMPTY,
ADL_FS_ERR_INITFUNC,
ADL_FS_ERR_CARDREMOVED,
ADL_FS_ERR_ONDRIVE,
ADL_FS_ERR_INVALIDSECTOR,
ADL_FS_ERR_READ,
ADL_FS_ERR_WRITE,
ADL_FS_ERR_INVALIDMEDIA,
ADL_FS_ERR_BUSY,
ADL_FS_ERR_WRITEPROTECT,
ADL_FS_ERR_INVFATTYPE,
ADL_FS_ERR_MEDIATOOSMALL,
ADL_FS_ERR_MEDIATOOLARGE,
ADL_FS_ERR_NOTSUPPSECTORSIZE,
ADL_FS_ERR_UNKNOWN,
ADL_FS_ERR_DRVALREADYMNT,
ADL_FS_ERR_TOOLONGNAME,
ADL_FS_ERR_NOTFORREAD,
ADL_FS_ERR_DELFUNC,
ADL_FS_ERR_ALLOCATION,
ADL_FS_ERR_INVALIDPOS,
ADL_FS_ERR_NOMORETASK,
ADL_FS_ERR_NOTAVAILABLE,
ADL_FS_ERR_TASKNOTFOUND,
ADL_FS_ERR_UNUSABLE,
ADL_FS_ERR_CRCERROR
}

The code should be something like :

ret = adl_fsMountDrive( 0, ADL_FS_INTERNAL_NOR, NULL );

if (ADL_FS_ERR_NOTFORMATTED == ret )
{
ret = adl_fsFormat(0);
debugPrint("\nfsFormat error %d", ret );
}

Thanks.

First of all I wish to thank you for your kind support. :slight_smile: I can now use the File System an work with files! :slight_smile:

My only problem is that I could not allocate more than 512 KBytes with the AT+WOPEN=9,512 AT command. For any number bigger than 512 I get an error:

[10/22/13 15:43:30:507] AT+WOPEN=9,513
[10/22/13 15:43:30:508] +CME ERROR: 3

I need to allocate all the available Flash memory, isn’t that possible :question:

The external Flash Memory mounted on the board is the ST M36W0R5040t8zaq Datasheet:
:arrow_right: https://www.dropbox.com/s/2oq2jdv7rsdysqh/M36W0R5040x5%20MCP%2032%2B16psram.pdf

Regards

Hi,

I think you can try to reduce again the A&D area:
Try this:
AT+WOPEN=6,64
Then (perhaps reboot)
AT+WOPEN=9,704

If it works, you can also try this combination:
AT+WOPEN=6,0
Then: AT+WOPEN=9,768

Thanks.

PS: you can thanks somebody on the openat forum by clicking on the “+1” button next to the “quote” button when the topic is over (we have a “thanks” counter). It is always good to show that we have successfully helped somebody to solve its issue. thanks.

Hi ado1,
the commands you suggest work.

In the WMP100 datasheet (AirPrime_WMP_Series_Product_Technical_Specification_and_Customer_Design_Guidelines_Rev13_0.pdf page 100/173) there is a memory map showing:
1536KB for Application & A&D storage

I just don’t get why I cannot use more than 768 KByte.

Regards

Hi, maybe you can allocate 832MB.
Anyway, I’m surprise because according to the AT user guide, file system is not availavble on 4MB flash.

Hi ado1,

sorry but , where did you get that number (832) from? Anyway it doesn’t work.

[10/23/13 17:12:53:177] AT+WOPEN=9,832
[10/23/13 17:14:24:189] +CME ERROR: 3

From AT_Command_Interface_Guide_751.pdf page 52

I assume it means, as you said, that the file system is not supported. I am currently using it with a 32 Mbit Flash, though.

:frowning:

Regards

Hi ado1,

have you got any news on this subject?

Regards

Hi,

Actually, not using file system on a 4MB flash is more a recommandation on 7.51 version, as it may prevent the using of Air Vantage service (update over the air).

A&D area and file system are using the same flash area. The max size for A&D area for a 32Mbits flash memory is 768KBytes. You can’t allocate more for the file system. If you need more, you have to use bigger flashes.