The XBee 3 BLU device includes an internal file system that allows you to store files such as MicroPython scripts, log files, and certificates, directly in its non-volatile memory. This capability enables more flexible and robust application development by allowing local storage for important data and scripts.
While the file system offers useful functionality, it comes with certain structural and access limitations that are covered in detail within this chapter.
Directory structure
The XBee 3 BLU’s internal flash appears in the file system as /flash
, the only entry at the root level of the file system.
Files and directories other than /flash
cannot be created within the root directory, only within /flash
.
Path considerations
The XBee 3 BLU device stores all of its files in the top-level directory /flash
.
On startup, the ATFS commands and MicroPython each use that directory as their current working directory.
When specifying the path to a file or directory, it is interpreted as follows:
-
Paths starting with a forward slash are "absolute" and must start with
/flash
to be valid. -
All other paths are relative to the current working directory.
-
The directory
..
refers to the parent directory, so an operation on../filename.txt
that takes place in the directory/flash/test
accesses the file/flash/filename.txt
. -
The directory
.
refers to the current directory, soATFS ls .
is the same asATFS ls
, which lists files in the current directory. -
Names are case-insensitive, so
FILE.TXT
,file.txt
andFiLe.TxT
all refer to the same file. -
File and directory names are limited to 64 characters, and can only contain letters, numbers, periods, dashes and underscores. A period at the end of the name is ignored.
-
The full, absolute path to a file or directory is limited to 255 characters.
Other limitations
The file system on the XBee 3 BLU has a few limitations when compared to conventional file systems:
-
When a file on the file system is deleted, the space it was using is only reclaimed if it is found at the end of the file system. Deleted data that is contiguous with the last placed deleted file is also reclaimed.
-
The file system can only have one file open for writing at a time.
-
The file system cannot create new directories while a file is open for writing.
-
Files cannot be renamed.
-
The contents of the file system will be lost when any firmware update is performed. See Update the firmware over-the-air in General Purpose Flash Memory for information on how to put files on a device after a firmware over-the-air (FOTA) update.
XBee Studio interface
XBee Studio includes an embedded tool that allows you to manage the file system of your XBee 3 BLU device in an easy and quick way. For more information, refer to Manage the file system in XBee Studio.