emFile
CPU independent
File System for
embedded applications
User & Reference Guide
Document: UM02001
Software version: 4.04
Revision: 4
Date: June 19, 2017
A product of SEGGER Microcontroller GmbH & Co. KG
www.segger.com
2
Disclaimer
Specifications written in this document are believed to be accurate, but are not guar-
anteed to be entirely free of error. The information in this manual is subject to
change for functional or performance improvements without notice. Please make sure
your manual is the latest edition. While the information herein is assumed to be
accurate, SEGGER Microcontroller GmbH & Co. KG (SEGGER) assumes no responsibil-
ity for any errors or omissions. SEGGER makes and you receive no warranties or con-
ditions, express, implied, statutory or in any communication with you. SEGGER
specifically disclaims any implied warranty of merchantability or fitness for a particu-
lar purpose.
Copyright notice
You may not extract portions of this manual or modify the PDF file in any way without
the prior written permission of SEGGER. The software described in this document is
furnished under a license and may only be used or copied in accordance with the
terms of such a license.
©
2010 - 2016 SEGGER Microcontroller GmbH & Co. KG, Hilden / Germany
Trademarks
Names mentioned in this manual may be trademarks of their respective companies.
Brand and product names are trademarks or registered trademarks of their respec-
tive holders.
Contact address
SEGGER Microcontroller GmbH & Co. KG
In den Weiden 11
D-40721 Hilden
Germany
Tel.+49 2103-2878-0
Fax.+49 2103-2878-28
E-mail: support@segger.com
Internet: http://www.segger.com
UM02001 User & Reference Guide for emFile
© 2010 - 2016 SEGGER Microcontroller GmbH & Co. KG
3
Manual versions
This manual describes the current software version. If any error occurs, inform us
and we will try to assist you as soon as possible.
Contact us for further information on topics or routines not yet specified.
Print date: June 19, 2017
Software Revision
Date
By
Description
4.04
4
170616
• Added function for deleting entire directory trees (see Sec-
tion 4.7.2 on page 108.)
• Added test functions for Universal NAND driver (see Section
MD
6.3.2.12.5 on page 350, Section 6.3.2.12.6 on page 351,
Section 6.3.2.12.7 on page 352, Section 6.3.2.12.7 on page
352.)
• Added function for retrieving information about a file or
directory (see Section 4.6.4 on page 91.)
• Added functions for SPI bus synchronization to SPI NAND
hardware layer (see Section 6.3.1.12.3.7 on page 313 and
Section 6.3.1.12.3.8 on page 314.)
• Added function to Universal NAND driver that can be used to
MD
read only a part of a logical sector (see Section 6.3.2.12.4 on
page 349.)
• Added support for reading id information from serial NOR
flash devices (see Section 6.4.1.7.4.1 on page 398.)
• Added possibility to disable the buffering when writing to a
storage card (see Section 6.5.7.2.9 on page 467.)
• Added function that can be used to abort a journal transac-
tion (see Section 13.6.7 on page 633)
• Added new field to FS_NAND_ECC_HOOK structure and dif-
ferent return values for the (*pfApply)() function (see Sec-
MD
tion 6.3.2.9.2.10 on page 341)
• Updated the description of the NAND fatal error callback (see
Section 6.3.1.10.2.4 on page 244, Section 6.3.1.10.2.6 on
page 246, Section 6.3.1.10.2.7 on page 247)
MD
• Corrected typographical errors.
• Improved the feature list (see Section 1.2 on page 20.)
4.04
3
170308
4.04
2
161114
4.04
1
160727
4.04
0
160606
• Added function that enables the use of reliable write opera-
tions for MMC storage devices (see Section 6.5.7.2.6 on page
464.)
• Changes the paths to samples and windows utilities.
• Added description for the volume dirty flag (see Section
4.9.33 on page 157, Section 8.2.2 on page 577, and Section
4.11.8 on page 185.)
• Added description of OS delay function (see Section 9.1.3 on
page 587.)
• Updated the list of configuration functions of the NOR physi-
cal layers (see Section 6.4.1.7.2 on page 373.)
• Added chapter for profiling via SystemView (see Chapter 11.)
• Added description of FS_NAND_UNI_SetMaxBitErrorCnt()
function (see Section 6.3.2.9.2.9 on page 340.)
• Added description of pfGetECCResult() function (see Section
6.3.1.11.3.12 on page 273 and Section 6.3.1.11.3.15 on
page 276.)
MD
• Updated the list of supported serial NOR flash devices (see
Section 6.4.1.1.1 on page 358.)
• Updated the list of supported NAND flash devices (see Sec-
tion 6.3.2.1 on page 326 and Section 6.3.1.2.2 on page
232.)
• Added description of FS_NOR_SPIFI_SetDeviceList() function
(see Section 6.4.1.7.2.13 on page 387.)
• Added description of FS_NOR_SPIFI_SetDeviceList() function
(see Section 6.4.1.7.2.9 on page 383)
• Added information about bit error accumulation (see Section
6.3.2.8 on page 329.)
• Updated the information about the usage of the read-only
file attribute (see Section 4.6.3 on page 90, Section 4.6.6 on
page 93, and Section 4.6.12 on page 99.)
• Added description for the file buffer at file handle level (see
Section 4.3.8 on page 67 and Section 8.2.1 on page 575.)
UM02001 User & Reference Guide for emFile
© 2010 - 2016 SEGGER Microcontroller GmbH & Co. KG
4
Software Revision
Date
By
Description
4.02
1
160205
• Added information about the garbage collection of NOR
driver (see Section 6.4.1.5 on page 361.)
• Added description of the SPIFI phyiscal and hardware layers
(see Section 6.4.1.1 on page 357, Section 6.4.1.6.2.2 on
page 367, Section 6.4.1.7.1 on page 372, Section
6.4.1.7.2.10 on page 384, and Section 6.4.1.8.3 on page
410.)
• Updated screenshots in Section 2.2.2 on page 28 and Section
3.1 on page 35 through Section 3.4 on page 40.
MD
• Updated the information about the working buffer size of the
FS_CheckDisk() function (see Section 4.9.1 on page 123.)
• Added information about the bad block management of the
NAND drivers (see Section 6.3.1.8 on page 238 and Section
6.3.2.6 on page 328.)
• Added more information about how the RAID1 driver works
(see Section 7.7 on page 562.)
• Added configuration sample for the block map NOR driver
(see Section 6.4.2.5.2.1 on page 434.)
Section "API functions -> File system configuration functions"
* Added a new example to FS_LOGVOL_AddDevice().
Section "Performance and resource usage -> Memory footprint -
> Dynamic RAM requirements"
* Added more information about how many RAM is required
for different emFile configurations.
Section "Device drivers -> NAND flash driver -> SLC1 driver ->
Supported hardware"
* Added new devices.
MD
Section "Device drivers -> NAND flash driver -> Universal
driver -> Supported hardware"
* Added new devices.
Section "Device drivers -> MMC/SD card driver -> Additional
driver functions"
* Added FS_MMC_CM_ReadExtCSD() function.
Section "Logical drivers -> RAID1 driver -> Configuring the
driver"
* Added FS_RAID1_SetSyncSource() function.
Section "Device drivers -> MMC/SD card driver -> Additional
driver functions"
* Added FS_MMC_CM_GetCardInfo() function.
* Added FS_MMC_CARD_INFO structure.
MD Section "Device drivers -> NAND flash driver -> Additional
information"
* Added FS_NAND_PHY_SetHWType() function.
Section "API functions -> Storage layer functions"
* Added FS_STORAGE_GetSectorUsage()
4.02
0
151201
4.00
1
150813
UM02001 User & Reference Guide for emFile
© 2010 - 2016 SEGGER Microcontroller GmbH & Co. KG
5
Software Revision
Date
By
Description
4.10
0
150619
Corrected spelling and grammatical errors.
Added chapter "Porting emFile 3.x to 4.x".
Section "Default device driver names"
* Removed MMC/SD driver for ATMEL.
Removed section "Hardware functions - Card mode for ATMEL
devices"
Updated the hardware layers sections to the new API.
Section "File system configuration functions"
* Renamed function FS_ConfigUpdateDirOnWrite() to
FS_ConfigOnWriteDirUpdate()
* Moved function FS_FAT_ConfigMaintainFATCopy() to section
"FAT related functions"
* Moved function FS_FAT_ConfigUseFSInfoSector() to section
"FAT related functions"
Section "FAT related functions"
* Renamed function FS_FAT_ConfigMaintainFATCopy() to
FS_FAT_ConfigFATCopyMaintenance()
* Renamed function FS_FAT_ConfigUseFSInfoSector() to
FS_FAT_ConfigFSInfoSectorUse()
* Added function FS_FAT_ConfigROFileMovePermission()
Section "API functions -> Error handling functions ->
FS_ErrorNo2Text()"
* Added more error codes.
Section "Device drivers -> NAND flash driver -> SLC1 driver ->
Physical layer"
* Added section "Specific configuration functions"
Section "Device drivers -> NAND flash driver -> Universal
driver -> Configuring the driver"
* Added function FS_NAND_UNI_SetNumBlocksPerGroup()
* Added function FS_NAND_UNI_SetCleanThreshold()
* Added function FS_NAND_UNI_Clean()
Section "Device drivers -> NOR flash driver -> Sector map
driver -> Physical layer"
* Added section "Specific configuration functions"
MD
Section "Device drivers -> MMC/SD card driver -> Configura-
tion"
* Moved section "Enable 4-bit mode (card mode only)" one
level up
* Moved section "Cyclic redundancy check (CRC)" one level up
* Moved function FS_MMC_ActivateCRC() to section "Specific
configuration functions"
* Moved function FS_MMC_DeactivateCRC() to section "Spe-
cific configuration functions"
Section "Device drivers -> MMC/SD card driver"
* Renamed section "Configuration" to "Configuring the driver"
Section "Device drivers -> MMC/SD card driver -> Additional
driver functions"
* Moved function FS_MMC_CM_Allow4bitMode() to section
"Specific configuration functions"
* Moved function FS_MMC_CM_Allow8bitMode() to section
"Specific configuration functions"
* Moved function FS_MMC_CM_AllowHighSpeedMode() to sec-
tion "Specific configuration functions"
Section "Device drivers -> MMC/SD card driver -> Configuring
the driver -> Specific configuration functions"
* Added function FS_MMC_SetHWType()
* Added function FS_MMC_CM_SetHWType()
Section "Device drivers -> CompactFlash card and IDE driver ->
Configuring the driver"
* Move function FS_IDE_Configure() to section "Specific con-
figuration functions"
Section "Device drivers -> CompactFlash card and IDE driver ->
Configuring the driver"
* Added section "Specific configuration functions"
Section "Device drivers -> CompactFlash card and IDE driver ->
Configuring the driver -> Specific configuration functions"
* Added function FS_IDE_SetHWType()
UM02001 User & Reference Guide for emFile
© 2010 - 2016 SEGGER Microcontroller GmbH & Co. KG