File System

File tags

Description

File system commands have the optional <tag> parameter that allows the user to specify a file type when a file system AT command is issued, to inform the system what to do with it. Application specific files must be saved with the correct type tag, otherwise they are treated as common user files.

The file tag applicability depends on the module series: see Table 21 for the allowed tags supported by the interested product. An overview about each file tag is provided in Table 22.

Table 21. Tag applicabilities to module series
Module"USER""FOAT""AUDIO""ECALL_EXT""FOTA_EXT""AUDIO_EXT""PROFILE""GNSS""CALLSRV_EXT""XLWM2M""MNO""UNVM""SCM"

Table 22. Tag meanings
TagNameSpecification

"USER"

User file system

This is the default type if the <tag> parameter is omitted in file system AT commands. All generic files can be stored in this manner.

Example: AT+UDWNFILE="foobar",25,"USER" is the same as AT+UDWNFILE="foobar",25

"FOAT"

FOAT file system

This tag is used to specify the file type as a firmware update package. It will place the firmware update package in the proper file cache to be used later by the +UFWINSTALL command.

"AUDIO"

Audio parameters

This tag is used to store audio calibration file "audio_gain_calibration<X>.xml" and "voice<X>.nvm" in the selected profile <X>=0,1. The profile is stored into NVM by using ATZ<X>.

The "audio_gain_calibration<X>.xml" and "voice<X>.nvm" files can be over-written with AT&W<X> command.

"FOTA_EXT"

Firmware for FOTA procedure

This tag has to be used to store the firmware file for the FOTA procedure using a dedicated channel of the USB CDC-ACM interface.

"PROFILE"

Profile files

This tag refers to the profile files that can be loaded on to the module to support Mobile Network Operators (MNOs) specific configurations. For more details on the profiles, see the +UMNOPROF command.

"GNSS"

GNSS files

This tag has to be used to store the firmware file for the internal GNSS receiver.

"CALLSRV_EXT"

Emergency Call Number List (ECNL) management

This tag is used to manage the Emergency Call Number List (ECNL) file stored in NVM. All numbers in the list will be treated as emergency numbers when dialled and will result in disabling the thermal daemon software shutdown. Some notes about ECNL:

  • If eCall is enabled, the ECNL list is not used and call is treated as any normal call.

  • Conflict manager will not manage these calls, meaning no ongoing calls will be dropped.

  • Maximum allowed numbers in the ECNL list is 20. Numbers after 20 will be ignored.

  • Reboot is required to reload the ECNL list after download.

File should be composed by text lines consisting of 'type','number' lines that end with carriage return where 'type' is a type of the number in 'number' according to one of the formats supported by 3GPP TS 24.008 [12] sub-clause 10.5.4.7).

All numbers that start with '00' should be stored with '+' instead in order to keep only one occurrence for international number. In order to manage numbers properly the configuration file should contain the number with international prefix and without it.

Example of a two line ECNL file:

`2,+390123456789`
`2,390123456789`

"XLWM2M"

LwM2M object script files

This tag is used to read or store Lua files defining a LwM2M object for use by the LwM2M client. The file specified with the "XLWM2M" can be only downloaded completely (see +UDWNFILE AT command), deleted (see +UDELFILE AT command), fully or partially read (see +URDFILE or +URDBLOCK) and queried (see +ULSTFILE AT command).

"MNO"

ICCID and MCC/MNC MNO lists

This tag refers to the files containing the ICCID and MCC/MNC MNO lists used by the SIM ICCID/IMSI selection (see the +UMNOPROF AT command). The file specified with the "MNO" tag can be downloaded to the module (see the +UDWNFILE AT command), deleted (see the +UDELFILE AT command), fully or partially read (see the +URDFILE or +URDBLOCK AT commands) and queried (see the +ULSTFILE AT command). Depending on the file name (<filename>) the file contains the ICCID and MCC/MNC MNO lists. The allowed file names are:

  • "iccid_list"

  • "mno_list"

"UNVM"

Saving in NVM

This tag is used to list or delete the NVM items related to AT commands with parameter configuration saved in the UNVM section. The AT commands with parameters in this section can be listed with the +UNVMCFG test command.

Deletion of a UNVM item restores the factory-programmed configuration at next boot. To delete a UNVM item use the +UDELFILE AT command. To list all the UNVM items, use the +ULSTFILE AT command.

If the UNVM item of an AT command is not listed by +ULSTFILE AT command, the factory-programmed settings are in use.

"SCM"

SCM configuration files

This tag is used to read or store SCM configuration files.

List files information +ULSTFILE

+ULSTFILE

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

-

+CME Error

Description

Retrieves some information about the FS. Depending on the specified <op_code>, it can print:

  • List of files stored into the FS

  • Remaining free FS space expressed in bytes

  • Size of the specified file expressed in bytes

The available free space on FS in bytes reported by the command AT+ULSTFILE=1 is the theoretical free space including the space occupied by the hidden and temporary files which are not displayed by the AT+ULSTFILE=0.

Syntax

TypeSyntaxResponseExample

Generic syntax

Set

AT+ULSTFILE=[<op_code>[,<param1>[,<param2>]]]

+ULSTFILE: [<param3>,…​[,<paramN>]]

OK

AT+ULSTFILE=

+ULSTFILE: "filename1","filename2"

OK

List of files stored into the FS

Set

AT+ULSTFILE=[0[,<tag>]]

+ULSTFILE: [<filename1>[,<filename2>[,…​[,<filenameN>]]]]

OK

See notes below

AT+ULSTFILE=

+ULSTFILE: "filename1","filename2"

OK

See notes below

Remaining free FS space expressed in bytes

Set

AT+ULSTFILE=1[,<tag>]

+ULSTFILE: <free_fs_space>

OK

AT+ULSTFILE=1

+ULSTFILE: 236800

OK

Size of the specified file

Set

AT+ULSTFILE=2,<filename>[,<tag>]

+ULSTFILE: <file_size>

OK

AT+ULSTFILE=2,"filename"

+ULSTFILE: 784

OK

Defined values

ParameterTypeDescription

<op_code>

Number

Allowed values are:

  • 0 (default value): lists the files belonging to <tag> file type

  • 1: gets the free space for the specific <tag> file type

  • 2: gets the file size expressed in bytes, belonging to <tag> type (if specified)

<tag>

String

Specifies the application file type. FILE TAGS table lists the allowed <tag> strings.

<filename1>,..,<filenameN>

String

Filename. For file system filename and data size limits see File system limits.

<free_fs_space>

Number

Available free space on FS in bytes.

<file_size>

Number

Size of the file specified with the <filename> parameter.

<param1>

Number / String

Type and supported content depend on related <op_code> (details are given above).

<param2>

Number / String

Type and supported content depend on related <op_code> (details are given above).

Notes

  • The <tag> parameter is accepted, but ignored. USER taken as default.

LEXI-R10401D-01B / LEXI-R10801D-01B / LEXI-R10801D-51B / LEXI-R10001D / LEXI-R10011D / SARA-R10

  • +ULSTFILE option for listing FS files (see parameter op_code=0) sets the AT terminal to direct link mode, thus direct link limitations apply for this command as well. Only one direct link connection at a time can be activated. When considering the number of active direct links, take into account also the connection established by the +USODL AT command, the UHTTP direct link mode (see parameters http_command=6 and http_command=7 in +UHTTPC command), the UMQTT binary mode (see parameter op_code=9 in +UMQTTC to publish a binary message to a topic), the UFTP direct link mode (see parameter op_code=6 in +UFTPC command), the +USOWR AT command for binary mode, and the +FREAD AT command.

Open file +FOPEN

+FOPEN

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

-

+CME Error

Description

Opens a file in USER file system with the specified name filename parameter, returning its handle that can be used for future read/write operations.

The returned handle can be disassociated from the file by calling AT+FCLOSE.

File should be considered a stream: once opened, the position indicator (internal pointer) points to the beginning of the file. Each following read/write activity will change the position affecting the point from where the next command applies.

Syntax

TypeSyntaxResponseExample

Set

AT+FOPEN=<filename>[,<mode>]

+FOPEN: <filehandle>

OK

AT+FOPEN="filename"

+FOPEN: 1

OK

List of currently opened files with mode and total number of bytes wrote in current session

Read

AT+FOPEN?

[+FOPEN: <filename>,<filehandle>,<mode>,<size>

[…​]]

OK

AT+FOPEN?

+FOPEN: filename1,1,0,10B

+FOPEN: filename2,2,0,0B

+FOPEN: filename3,3,1,5B

OK

Test

AT+FOPEN=?

+FOPEN=<filename>[,<mode>]

OK

AT+FOPEN=?

+FOPEN=<filename>[,<mode>]

OK

Defined values

ParameterTypeDescription

<filename>

String

Filename, string length limits are 1 - 63. For file system filename and data size limits see File system limits.

<filehandle>

Number

Handle of the file opened, assigned starting from 1, maximum files opened simultanously: 15.

<mode>

Number

Allowed values are:

  • 0 (default value): if the file does not exist, a new file is created; If the file exists, open the file directly. The files in both cases are readable and writable

  • 1: if the file does not exist, a new file is created; If the file exists, the file is cleared and overwritten. The files in both cases are readable and writable

  • 2: if the file exists, open the file and the file is only readable; If the file does not exist, an error is returned

<size>

Number

Written payload expressed in bytes.

Read file +FREAD

+FREAD

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

-

+CME Error

Description

Reads data from file opened with AT+FOPEN, starting from the current position indicator.

Each byte read will move forward the position indicator, closing and reopening the file will reset it to the beginning of the file. To start from a specific offset, use AT+FSEEK to move position indicator to the needed point.

Syntax

TypeSyntaxResponseExample

Set

AT+FREAD=<filehandle>[,<length>]

CONNECT <read_length>

<data>

OK

AT+FREAD=1

CONNECT 36

these bytes are the data of the file

OK

Test

AT+FREAD=?

+FREAD:<filehandle>[,<length>]

OK

AT+FREAD=?

+FREAD:<filehandle>[,<length>]

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

<length>

Number

Number of bytes to be read, range is 0 - 262143

<read_length>

Number

Number of bytes actually read by the command, can be less than <length> if file has not enough data.

<data>

String

Content of the file read.

Notes

LEXI-R10401D-00B / LEXI-R10801D-00B

  • +FREAD sets the AT terminal to direct link mode, thus direct link limitations apply for this command as well. Only one direct link connection at a time can be activated. When considering the number of active direct links, take into account also the connection established by the +USODL AT command, the UHTTP direct link mode (see parameters http_command=6 and http_command=7 in +UHTTPC command), the UMQTT binary mode (see parameter op_code=9 in +UMQTTC to publish a binary message to a topic), and the +USOWR AT command for binary mode.

LEXI-R10401D-01B / LEXI-R10801D-01B / LEXI-R10801D-51B / LEXI-R10001D / LEXI-R10011D / SARA-R10

  • +FREAD sets the AT terminal to direct link mode, thus direct link limitations apply for this command as well. Only one direct link connection at a time can be activated. When considering the number of active direct links, take into account also the connection established by the +USODL AT command, the UHTTP direct link mode (see parameters http_command=6 and http_command=7 in +UHTTPC command), the UMQTT binary mode (see parameter op_code=9 in +UMQTTC to publish a binary message to a topic), the UFTP direct link mode (see parameter op_code=6 in +UFTPC command), the +USOWR AT command for binary mode, and the +ULSTFILE AT command for listing FS files (see parameter op_code=0).

Write file +FWRITE

+FWRITE

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

Up to 10 s

+CME Error

Description

Writes data to file opened with AT+FOPEN, starting from the current position indicator.

To start from a specific offset, use AT+FSEEK to move position indicator to the needed point before starting write.

Syntax

TypeSyntaxResponseExample

Set

AT+FWRITE=<filehandle>[,<length>[,<timeout>]]

CONNECT

<data>

+FWRITE: <written_length>,<total_length>

OK

AT+FWRITE=1,5

CONNECT

hello

+FWRITE: 5,5

OK

Test

AT+FWRITE=?

+FWRITE:<filehandle>[,<length>[,<timeout>]]

OK

AT+FWRITE=?

+FWRITE:<filehandle>[,<length>[,<timeout>]]

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

<length>

Number

Number of bytes to be written. Despite there is no file size limit, the command accepts only 10240 bytes at a time.

<timeout>

Number

Waiting time from last received data, expressed in seconds. Default value is 5, range is 1 - 100.

<data>

String

Stream of bytes to be written, only text data (printable characters) is accepted.

<written_length>

Number

Total number of bytes written by the current command, should be equal to <length>.

<total_length>

Number

Total number of bytes in the file, can be more than <length> if the file was already existing.

Notes

  • While +FWRITE set command is in execution, an error result code will be returned to +FWRITE and +FWRITEHEX set commands issued on another AT interface.

Write file +FWRITEHEX

+FWRITEHEX

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

Up to 10 s

+CME Error

Description

Writes HEX data to file opened with AT+FOPEN, starting from the current position indicator.

To start from a specific offset, use AT+FSEEK to move position indicator to the needed point before starting write.

Syntax

TypeSyntaxResponseExample

Set

AT+FWRITEHEX=<filehandle>[,<length>[,<timeout>]]

CONNECT

<data>

+FWRITE: <written_length>,<total_length>

OK

AT+FWRITEHEX=1,10

CONNECT

48656C6C6F

+FWRITE: 5,5

OK

Test

AT+FWRITEHEX=?

+FWRITEHEX:<filehandle>[,<length>[,<timeout>]]

OK

AT+FWRITEHEX=?

+FWRITEHEX:<filehandle>[,<length>[,<timeout>]]

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

<length>

Number

Number of hex bytes to be sent. Despite there is no file size limit, the command accepts only 10240 bytes at a time.

<timeout>

Number

Waiting time from last received data, expressed in seconds. Default value is 5, range is 1 - 100.

<hexdata>

Number

Stream of bytes to be written, every byte is sent as two hexadecimal numbers (e.g. "Hello" → "48656C6C6F"), total expected number is <length>.

<written_length>

Number

Total number of bytes written by the current command, typically half of <length>.

<total_length>

Number

Total number of bytes in the file, can be more than <written_length> if the file was already existing.

Notes

  • While +FWRITEHEX set command is in execution, an error result code will be returned to +FWRITEHEX and +FWRITE set commands issued on another AT interface.

Close file +FCLOSE

+FCLOSE

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

Up to 10 s

+CME Error

Description

Closes an opened file flushing its contents in file system and frees the associated handle.

Syntax

TypeSyntaxResponseExample

Set

AT+FCLOSE=<filehandle>

OK

AT+FCLOSE=1

OK

Test

AT+FCLOSE=?

+FCLOSE:<filehandle>

OK

AT+FCLOSE=?

+FCLOSE:<filehandle>

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 -33.

Set position indicator +FSEEK

+FSEEK

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

-

+CME Error

Description

Sets the position indicator associated with the handle to a new position.

It is allowed to seek past the end-of-file with no limits and to start writing; in case of file system boundary overrun, AT+FWRITE or AT+FWRITEHEX will return an error result code; read operations in any unwritten region will return bytes with value 0.

Syntax

TypeSyntaxResponseExample

Set

AT+FSEEK=<filehandle>,<offset>[,<position>]

OK

AT+FSEEK=1,10

OK

Test

AT+FSEEK=?

+FSEEK:<filehandle>,<offset>[,<position>]

OK

AT+FSEEK=?

+FSEEK:<filehandle>,<offset>[,<position>]

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

<offset>

Number

Number of bytes to offset from <position>, range is 0 - 2147483647 (0x7FFFFFFF).

<position>

Number

Position used as reference for the <offset>, allowed values are:

  • 0 (default value): beginning of file

  • 1: current position indicator

  • 2: end of file

Get position indicator +FPOSITION

+FPOSITION

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

-

+CME Error

Description

Gets the current position indicator of the file associated with the handle.

Syntax

TypeSyntaxResponseExample

Set

AT+FPOSITION=<filehandle>

+FPOSITION:<offset>

OK

AT+FPOSITION=1

+FPOSITION=7

OK

Test

AT+FPOSITION=?

+FPOSITION:<offset>

OK

AT+FPOSITION=?

+FPOSITION:<offset>

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

<offset>

Number

Number of bytes from beginning of file, range is 0 - 262143

Truncate file +FTUCAT

+FTUCAT

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

-

+CME Error

Description

Truncates the file associated with the handle at its current position indicator.

Command can be used at the end of a file overwrite, to eliminate the remaining data. To truncate at specific offset, use AT+FSEEK to move position indicator to the needed point.

Syntax

TypeSyntaxResponseExample

Set

AT+FTUCAT=<filehandle>

OK

AT+FTUCAT=1

OK

Test

AT+FTUCAT=?

+FTUCAT:<filehandle>

OK

AT+FTUCAT=?

+FTUCAT:<filehandle>

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

Erase file +FERASE

+FERASE

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

Up to 10 s

+CME Error

Description

Erases the content of the file, leaving it still open and setting its position indicator to the beginning. File size is zeroed.

Syntax

TypeSyntaxResponseExample

Set

AT+FERASE=<filehandle>

OK

AT+FERASE=1

OK

Test

AT+FERASE=?

+FERASE:<filehandle>

OK

AT+FERASE=?

+FERASE:<filehandle>

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

Delete file +FDELETE

+FDELETE

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

No

No

Up to 10 s

+CME Error

Description

Deletes the open file from filesystem, freeing the associated handle.

Syntax

TypeSyntaxResponseExample

Set

AT+FDELETE=<filehandle>

OK

AT+FDELETE=1

OK

Test

AT+FDELETE=?

+FDELETE:<filehandle>

OK

AT+FDELETE=?

+FDELETE:<filehandle>

OK

Defined values

ParameterTypeDescription

<filehandle>

Number

File handle, given by AT+FOPEN, range is 1 - 33.

File system limits

Allowed characters in filenames

A filename cannot contain the following characters: / * : % | " < > ?

Filenames starting with a dot (.) are not valid.

Limits

See below the maximum filename length, the maximum data size of the file system, and the maximum number of files for the u-blox cellular modules.

Maximum filename length:

  • 63 characters

Maximum file size:

  • File size limited by the available file system space retrieved by AT+ULSTFILE=1 command. The file system space could change during the time, even if it is not directly used by the customer’s application.

Maximum number of files:

  • There is no limit to files that can be stored.

The theoretical maximum file size and the maximum number of files also includes system, hidden and temporary files whose number is not statically predictable, so the actual numbers can be less than stated.

Last updated: Jan 13, 2025
Need help?Contact Support
Questions?Contact us