EFS Embedded File System

Modules

 Functions
 
 Definitions
 
 Data Structures
 

Detailed Description

The embedded file system FSYS is useful for configuration file or application hex file up- and downloads. Built-in FLASH-read, -write and -sector erase function make it possible to read and write the file directly to/from the specified FLASH sector. The embedded file system consists of a two level directory structure. The root directory contains subdirectories only, each subdirectory occupies exactly one file. Because the Flash Memory can be erased on a sector basis only, each directory with write access MUST be mapped to a single or multiple unique sector(s). Overlapping of sectors with write access is not possible! No such restrictions apply to directories with read-only access.

A file is described with the direntry_type

structure direntry_type dir_1 = { dirname, filename, maxlength, access, filetype,address };

Members

dirname : name of the directory, max. 60 characters, no spaces allowed in name
filename : name of the file in this directory, max. 60 chars, no spaces
maxlength: max. length of file
access : access rights: FTP_RW, FTP_READ (OR with FTP_RAM if directory is located in RAM memory)
filetype : type of file stored in this directory 'A'scii, 'I'ntelHex, 'B'inary
address : start address in Flash Memory (or RAM memory)
Note
on using RAM: directories in RAM can be used for temporary storage; use the desired access type ORed with FTP_RAM

Example: The following example defines a directory ModuleConfig which contains file config.txt - the Module Configuration File. Read and Write access is allowed, the file type is ASCII. Also defined is the application boot file in directory Application. The file name displayed is app_bootfile.hex. Its type is Intel-Hex, read and write access is possible. The application boot file starts at Flash address 0x00000 and a maximum length of 64K bytes (0x10000) is allowed. A third directory is created, which also contains the Module Configuration File, but allows to read this file only.

direntry_type cfg_dir = {"ModuleConfig",
"config.txt",
0x10000,
'A',
0x10000};
direntry_type app_dir = {"Application" ,
"app_bootfile.hex",
0x10000,
'I',
0x00000);
direntry_type cfg_ronly = {"ModuleConfig",
"config.txt",
0x10000,
'A',
0x10000};

These files now can be added to a FTP server directory structure:

{
{"admin" , "xxxx", &cfg_dir, &app_dir, EFS_TERMINATION},
{"anonymous", "*" , &cfg_ronly, EFS_TERMINATION},
{"guest" , "*" , &cfg_ronly, EFS_TERMINATION},
EFS_TERMINATION
};

The admin account has a full read/write permission to ModuleConfig and Application file; guest and anonymous will only see an unchangeable ModuleConfig file.