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.

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
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
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
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
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.
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.
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.
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 PRO | emFile FAT | emFile EFS | emFile Storage Layer | |
Storage Layer | Included | Included | Included | Included |
FAT File System | Included | Included | Not Available | Not Available |
EFS File System | Optional | Not Available | Included | Not Available |
NAND Flash Device Driver | Included | Optional | Optional | Optional |
NOR Flash Device Driver | Included | Optional | Optional | Optional |
SD/SDHC/MMC Device Driver | Included | Optional | Optional | Optional |
IDE/Compact Flash Device Driver | Included | Optional | Optional | Optional |
Journaling Add-on | Optional | Optional | Optional | Not Available |
Encryption Add-on | Optional | Optional | Optional | Optional |
LFN Add-on | Included | Optional | Not Available | Not Available |
RAID1 Add-on | Optional | Optional | Optional | Optional |
RAID5 Add-on | Optional | Optional | Optional | Optional |
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 Device | CPU Speed | Storage device | Write Speed | Read Speed |
NXP LPC1857 | 180 MHz | Serial NAND flash | 1.3 MB/s | 3.0 MB/s |
Atmel AT91SAM9G45 | 384 MHz | Parallel NAND flash | 4.7 MB/s | 12.0 MB/s |
NXP Kinetis K66 | 168 MHz | SD card in card mode | 3.6 MB/s | 11.1 MB/s |
Renesas Synergy S7G2 | 240 MHz | SD card in card mode | 1.5 MB/s | 8.6 MB/s |
Renesas RZA1H | 133 MHz | QSPI NOR flash | 150 KB/s | 10.0 MB/s |
ST STM32F7 | 216 MHz | QSPI NOR flash | 164 KB/s | 11.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 system | 9200 | 1250 |
MMC/SD driver | +3700 | 30 |
Additional support for: | ||
Directory | +1100 | 0 |
(Auto) format | +2200 | 0 |
Disk information | +150 | 0 |
FAT32 | +200 | 0 |
ROM [Bytes] | RAM [Bytes] | |
Minimal file system | 13000 | 1250 |
MMC/SD driver | +5100 | 30 |
Additional support for: | ||
Directory | +2100 | 0 |
(Auto) format | +3600 | 0 |
Disk information | +100 | 0 |
FAT32 | +300 | 0 |
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.