emFile

emFile is a file system library that enables an embedded application or system to store data securely and reliably on any kind of storage device.

The library is the result of more than 28 years of continuous and ongoing development. It is deployed on several million devices worldwide, making it a proven in-field file system for the embedded industry. emFile is hardware-agnostic and can run on any 16/32/64-bit target for which a C/C++ compiler is available. Most 8-bit targets are supported.

dongle sd card emFile

Ready-to-use device drivers are available for NAND, and NOR flash, SD/SDHC/SDXC/MMC cards, e.MMC storage devices, CompactFlash cards, and USB flash drives. emFile comes with support for the common FAT12/16/32 file systems and for SEGGER’s proprietary file system EFS (Embedded File System) that has been specifically designed to meet the requirements of state-of-the-art embedded applications.

Key features

  • File system for embedded devices
  • Fail-safe—no file system corruption, no data loss
  • Supports encryption for embedded file system
  • Supports multiple storage devices: NAND, NOR, and SD card
  • High-performance NOR driver with static and dynamic wear levelling
  • High-performance NAND driver with static and dynamic wear levelling
  • RAID 1 & RAID 5 support
  • ECC bit error correction

Encryption

emFile offers an additional component that can be used to secure the data on the file system with minimal changes of the application. It can be used with FAT and EFS file systems and supports all device types such as NAND, NOR, SD/MMC cards.

Device driver

NOR flash driver

The NOR driver allows the file system layer to efficiently write and read blocks of data (logical sectors) to and from a NOR flash device.

emFile comes with two different NOR drivers:

  • Block map NOR driver
  • Sector map NOR driver

NAND flash driver

The emFile NAND drivers allow the file system layer to efficiently write and read blocks of data (logical sectors) to and from a NAND flash device.

emFile comes with two different NAND drivers:

  • SLC driver
  • Universal driver

Fail-safe file system

emFile is designed with security in mind. All access operations are atomic, which means even an interrupt by failure does not leave storage nor data in an undefined state. In addition, RAID modes 1 and 5 can be supported to increase security at the storage layer and journaling at the file system layer.

Journaling

emFile Journaling is an additional component which sits on top of the file system and makes the file system layer fail-safe. Journaling means that a file system logs all changes to a journal before committing them to the main file system and thus ensuring the consistency of the file system.

RAID 1

emFile offers maximum data integrity and reliability with RAID 1. It provides protection from storage device defects and failures and works on the storage layer with FAT and EFS file systems.

RAID 5

emFile offers maximum data integrity and reliability with RAID 5 with increased usable capacity. RAID 5 requires at least three strorage partitions to distribute date over several partitions. Additionally, it uses less data storage to achieve the same data security as RAID 1.

Editions

The embedded file system emFile offers four basic packages that can be combined with different optional components, as shown in the following table.

emFile PROemFile FATemFile EFSemFile Storage Layer
Storage LayerIncludedIncludedIncludedIncluded
FAT File SystemIncludedIncludedNot AvailableNot Available
EFS File SystemOptionalNot AvailableIncludedNot Available
NAND Flash Device DriverIncludedOptionalOptionalOptional
NOR Flash Device DriverIncludedOptionalOptionalOptional
SD/SDHC/MMC Device DriverIncludedOptionalOptionalOptional
IDE/Compact Flash Device DriverIncludedOptionalOptionalOptional
Journaling Add-onOptionalOptionalOptionalNot Available
Encryption Add-onOptionalOptionalOptionalOptional
LFN Add-onIncludedOptionalNot AvailableNot Available
RAID1 Add-onOptionalOptionalOptionalOptional
RAID5 Add-onOptionalOptionalOptionalOptional

Performance

emFile includes some benchmark code allowing users to measure the performance on certain targets.

Test results – Read & write speed performance

Configuration and Performance Table

Target DeviceCPU SpeedStorage deviceWrite SpeedRead Speed
NXP LPC1857180 MHzSerial NAND flash1.3 MB/s3.0 MB/s
Atmel AT91SAM9G45384 MHzParallel NAND flash4.7 MB/s12.0 MB/s
NXP Kinetis K66168 MHzSD card in card mode3.6 MB/s11.1 MB/s
Renesas Synergy S7G2240 MHzSD card in card mode1.5 MB/s8.6 MB/s
Renesas RZA1H133 MHzQSPI NOR flash150 KB/s10.0 MB/s
ST STM32F7216 MHzQSPI NOR flash164 KB/s11.1 MB/s

Test Procedure

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.
  • Start measurement of write performance.
  • Write a multiple of 8 Kbytes.
  • Stop measurement of write performance.
  • Close the file
  • Reopen the file.
  • Start measurement of read performance.
  • Read a multiple of 8 Kbytes.
  • Stop measurement of read performance.
  • Close the file
  • Show the performance results.

The performance test can be easily reproduced by including the file FS_Performance.c (located in the Sample\API folder of your shipment) into your project. Just compile and run the project on your target hardware.

Memory footprint

The embedded file system emFile has been specifically designed for resource-constrained devices.

Memory requirements for 32-bit CPUs

Memory requirements for 16-bit CPUs

The file system was compiled for a Cortex-M4 CPU and configured to use the MMC/SD device driver.

The file system was compiled for an MSP430 CPU and configured to use the MMC/SD device driver.

ROM [Bytes]RAM [Bytes]
Minimal file system92001250
MMC/SD driver+370030
Additional support for:
Directory+11000
(Auto) format+22000
Disk information+1500
FAT32+2000
ROM [Bytes]RAM [Bytes]
Minimal file system130001250
MMC/SD driver+510030
Additional support for:
Directory+21000
(Auto) format+36000
Disk information+1000
FAT32+3000

Licensing

emFile is available under various Embedded Software License models and delivered in source code packages. With a wide range of licensing options, emFile can fulfill commercial requirements as well as technical requirements. All licenses are one-time payments. emFile is royalty-free and not subscription-based. This makes the software a part of the equipment expenses, keeping the costs static.

* Applies to second seat/product and all additional seats/products of the Single Product License and Single Developer License.