emFile

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 optimized for minimum memory consumption in RAM and ROM, high speed and versatility. It is written in ANSI C and can be used on any CPU. 

Features

  • 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.
  • Multiple media support. A device driver allows you to access different media at the same time.
  • Cache support. Improves the performance of the file system by keeping the last recently used sectors in RAM.
  • 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.
  • Optional NOR flash (EEPROM) driver. Any CFI-compliant NOR flash is supported. Wear leveling included.
  • Optional device driver for NAND flash devices. Very high read/write speeds. ECC and wear leveling included.
  • 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 CompactFlash using either True IDE or Memory Mapped mode.
  • An optional proprietary file system (EFS) with native long file name support.
  • An optional journaling add-on. It protects the integrity of file system against unexpected resets.
  • NAND flash evaluation board available.

Software structure & components

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 initialize 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 optimized 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 Layer

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. A device driver consists of basic I/O functions for accessing the hardware and a global table that holds pointers to these functions.

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.

emFile trial versions

emFile is available for download as a full functional trial version. This trial version is shipped as a library to be used with MS Visual C++ on a PC. The only limitation is that the package does not contain all sources of emFile and therefor you cannot compile the library for a different architecture. Per default the project is configured to use the RAM disk driver which uses the system memory as storage. It is also possible to access logical drives of a Windows system using the WinDrive driver.

Additional trial versions available for different evaluation boards. Click here for an overview.