emFile is a file system for embedded applications which can be used on any media, for which you can provide basic hardware access functions.
emFile is a high performance library that has been optimised for minimum memory consumption in RAM and ROM, high speed and versatility.
It is written in ISO C and can be used on any CPU..
Manuals and trial versions are available. Please contact us.
Layers |
|
Performance |
|
Footprint |
|
Drivers and media supported |
|
|
|
MS DOS/MS Windows-compatible FAT12, FAT16 and FAT32 support.
An optional module that handles long file names of FAT media.
Multiple device driver support. You can use different device drivers with emFile, which allows you to access different types of hardware with the file system at the same time.
MultiMedia support. A device driver allows you to access different media at the same time.
OS support. emFile can be easily integrated into any OS. This allows using emFile in a multi-threaded environment.
ANSI C stdio.h-like API for user applications. An application using the standard C I/O library can easily be ported to use emFile.
Very simple device driver structure. emFile device drivers need only basic functions for reading and writing blocks. There is a template included.
An optional device driver for NAND flash devices, which can be easily used with any kind of NAND flashes
An optional device driver for MultiMedia & SD cards using SPI mode or card mode that can be easily integrated.
An optional IDE driver, which is also suitable for Compact Flash using either .True IDE. or .Memory Mapped. mode.
An optional NOR flash (EEPROM) driver that handles different flash sector sizes.
An optional proprietary file system (EFS) with native long file name support.
API Layer
The API Layer is the interface between emFile and the user application. It is subdivided in two parts, Storage API and File System API. The File System API contains file functions in ANSI C stdio style, such as FS_FOpen(), FS_FWrite() etc. The API Layer transfers these calls to the File System Layer. Currently the FAT file system or an optional file system, called EFS, are available for emFile. Right now they cannot be used simultaneously. The Storage API contains the functions which are required to initialise and access a storage medium. The Storage API allows sector read and write operations. The API Layer transfers these calls to the Storage Layer. The Storage API is optimised for applications which do not require file system functionality like file and directory handling. A typical application which uses the Storage API could be a USB mass storage device, where data has to be stored on a medium, but all file system functionality is handled by the host PC.
File System Layer
The file system layer translates file operations to logical block (sector) operations. After such a translation, the file system calls the logical block layer and specifies the corresponding device driver for a device.
Storage Layer
The main purpose of the Storage Layer is to synchronize accesses to a device driver. It furthermore provides a simple interface for the File System API. The Storage Layer calls a device driver to perform a block operation. It also contains the cache mechanism.
Device Driver
Device drivers are low-level routines that are used to access sectors of the device and to check status. It is hardware independent but depends on the storage medium.
Hardware Layer
These are the low level routines to access your hardware. These routines simply read and store fixed length sectors. The structure of the device driver is simple in order to allow easy integration of your own hardware.
A benchmark is used to measure the speed of the software on available targets. This benchmark is in no way complete, but it gives an approximation of the length of time required for common operations on various targets.
Configuration and performance table
All values are in KBytes/sec.
Device |
CPU Speed |
Medium |
W |
R |
Atmel AT91SAM7S |
48 MHz |
MMC using SPI with 24MHz |
1000.00 |
1000.00 |
Atmel AT91SAM7S |
48 MHz |
NAND with 512 bytes per page |
800.00 |
2000.00 |
Atmel AT91SAM7S |
48 MHz |
NAND with 2048 bytes per page |
695.65 |
2000.00 |
Atmel AT91SAM7S |
48 MHz |
NAND with 2048 bytes per page |
1333.33 |
2285.71 |
Atmel AT91SAM9261 |
200 MHz |
RAM disk |
128000 |
128000 |
Atmel AT91SAM9261 |
200 MHz |
NAND with 2048 bytes per page |
1446.33 |
4923.08 |
Atmel AT91SAM9261 |
200 MHz |
NAND with 2048 bytes per page |
2598.98 |
10666.67 |
Atmel AT91SAM7SE |
48 MHz |
NAND with 2048 bytes per page |
1087.05 |
3103.03 |
Atmel AT91SAM7SE |
48 MHz |
NAND with 2048 bytes per page |
3792.59 |
5885.06 |
LogicPD LH79520 |
51 MHz |
RAM disk |
20000 |
20000 |
LogicPD LH79520 |
51 MHz |
IDE mem-mapped |
1454.55 |
1753.42 |
LogicPD LH79520 |
51 MHz |
MMC using SPI with 12MHz |
558.95 |
1368.98 |
Cogent EP7312 |
74 MHz |
CompacFlash card, True IDE mode |
1951.24 |
2500.00 |
Cogent EP7312 |
74 MHz |
HDD, True IDE mode |
1760.55 |
2450.16 |
Description of the performance tests
The performance tests are executed as described and in the order below.
Performance test procedure:
Format the drive.
Create and open a file for writing.
W: Start measuring of write performance.
Write a multiple of 8 Kbytes.
W: Stop measuring of write performance.
Close the file
Reopen the file.
R: Start measuring of read performance.
Read a multiple of 8 Kbytes.
R: Stop measuring of read performance.
Close the file
Show the performance results.
The Performance test can be reproduced. Include Performance.c (located in the folder .\Sample\API) into your project. Compile and run the project on your target hardware.
The file system is designed to fit many kinds of embedded design requirements. Several features can be excluded from build to get a minimal system that can efficiently access any FAT media.
In the following section memory usage for different typical 16 and 32- bit systems is listed.
Please note that the values are valid for the given approximate values. Features can affect the size of others. For example if FAT32 is deactivated, the format function gets smaller because the 32 bit specific part of format is not added into the compilation.
This minimal configuration supports FAT12/16, but has no media format features, no directory support, no free disk space function (DiskInfo) and only one file can be opened at a time:
The configuration file (FS_Conf.h) looks as follows:
#define FS_POSIX_DIR_SUPPORT |
0 |
#define FS_FAT_NOFORMAT |
1 |
#define FS_FAT_DISKINFO |
0 |
#define FS_FAT_NOFAT32 |
1 |
#define FS_MAXOPEN |
1 |
System
Detail |
Description |
CPU |
M16C |
Tool chain |
IAR Workbench for M16C V2.12A |
Memory Model |
Data model: Near pointer; Constants: near memory |
Compiler options |
Highest size optimization |
Device driver |
MMC/SD driver |
Memory requirements
Detail |
ROM [Bytes] |
RAM [Bytes] |
Minimal file system |
11384 |
1122 |
MMC/SD driver |
+2172 |
528 |
Additional support for |
||
Directory |
+2654 |
+1310 (for each directory) |
(Auto) format |
+2175 |
0 |
Diskinfo |
+758 |
0 |
FAT32 |
+658 |
0 |
Additional open files |
0 |
1060 |
System
Detail |
Description |
CPU |
ARM 7 |
Tool chain |
IAR Workbench for ARM V4.11A |
Memory Model |
ARM7, thumb instructions; no interwork; |
Compiler options |
Highest size optimization; |
Device driver |
MMC/SD driver |
Memory requirements
Detail |
ROM [Bytes] |
RAM [Bytes] |
Minimal file system |
10298 |
1129 |
MMC/SD driver |
+2358 |
532 |
Additional support for |
||
Directory |
+2208 |
+1328 (for each directory) |
(Auto) format |
+2056 |
0 |
Diskinfo |
488 |
0 |
FAT32 |
352 |
0 |
|
||
Additional open files |
0 |
1068 |
emFile has been designed to cooperate with any kind of hardware. To use specific hardware with emFile, a so-called device driver for that hardware is required. The device driver consists of basic I/O functions for accessing the hardware and a global table that holds pointers to these functions.
The list below shows, which drivers are available for emFile.
CompactFlash card & IDE driver
emFile's CompactFlash & IDE device driver can be used to access most ATA HD drives or CompactFlash storage cards also known as CF using true IDE or Memory card mode.
MultiMedia & SD card driver
emFile supports the use of MultiMedia & SecureDigital (SD) cards. Two optional generic drivers for MultiMedia & SecureDigital (SD) cards are available. MultiMedia & SecureDigital (SD) cards can be accessed though two different modes:
SPI MODE
MMC/SD card mode.
For both modes drivers are available. To use one of these drivers, you need to configure the MMC driver and provide basic I/O functions for accessing your card reader hardware. This section describes how to enable one of these drivers and all hardware access functions required by emFile's for either the MultiMedia & SD card SPI mode or Multi- Media & SD card mode driver.
NAND flash driver
emFile supports the use of NAND flashes. An optional driver for NAND flashes is available. The NAND driver requires very little RAM, it can work with sector sizes of 512 bytes or 2 Kbytes (small sectors even on large page NAND flashes) and is extremly efficient. The driver is designed to support one or multiple SLC (Single Level Cell) NAND flashes. The NAND flash driver can also be used to access ATMEL's DataFlash chips. To use it in your system, you will have to provide basic I/O functions for accessing your flash device.
NOR flash driver
The NOR flash driver can be used with any CFI compliant 16-bit chip. The Common Flash Memory Interface (CFI) is an open specification which may be implemented freely by flash memory vendors in their devices. It was developed jointly by Intel, AMD, Sharp, and Fujitsu. The idea behind CFI was the interchangeability of current and future flash memory devices offered by different vendors. If you use only CFI compliant flash memory chips, you are able to use one driver for different flash products by reading identifying information out of the flash chip itself. The identifying information for the device, such as memory size, byte/word configuration, block configuration, necessary voltages, and timing information, is stored directly on the chip.
RAM disk driver
emFile comes with a simple RAM disk driver that makes it possible to use a portion of your system RAM as drive for data storage. This can be very helpful to examine your system performance and may also be used as a in-system test procedure
WinDrive driver
The purpose of this driver is to run emFile for test and simulation purposes on a PC running Windows. This driver is compatible with use any Windows logical driver on a Windows NT system.
Be aware, that Win9X is not supported, because it cannot access logical drives with "CreateFile".