Skip to main content
  • Products
  • Evaluate our Software
  • Downloads
  • Free Utilities
  • Purchase
  • Support
  • About Us
  • Blog
  • Forum
  • Search
    • Contact Us
    • Forum
    • Wiki
    • Web Shop
    • Newsletter
    • RSS
  •   Jobs
  •   Videos
  •   Blog
  •   Sustainability
  • emFile
  • Device Driver IDE & Compact Flash
  • Technology
  • Add-ons
  • Tools
SEGGER - Filesystem emFile Product Icon

emFile – IDE & CompactFlash Card Device Driver

A fast device driver that can be used to access data stored in IDE hard disk drive & CompactFlash memory cards.

  1. 1.Overview
  2. 2.How Embedded Devices Work
    1. 2.1.IDE (ATA) Drives
  3. 3.Fail-safe operation
  4. 4.Sample Usage - IDE/CF Device Driver

Overview

The emFile IDE and CompactFlash device driver can be used to access data stored to IDE hard disk drives and CompactFlash (CF) memory cards.

Supported Devices: The IDE and CompactFlash device driver supports most ATA compatible hard disk drives and CompactFlash (CF) memory cards. The access to the storage device is performed using using true IDE or memory card mode.

compact card

How Embedded Devices Work

CompactFlash is a small, removable mass storage device. The CompactFlash storage card contains a single chip controller and flash memory module(s) in a matchbook-sized package with a 50-pin connector consisting of two rows of 25 female contacts each on 50 mil (1.27 mm) centers. The controller interfaces with a host system allowing data to be written to and read from the flash memory module(s).

CompactFlash cards are designed with flash technology, a nonvolatile storage solution that does not require a battery to retain data indefinitely. The CompactFlash card specification version 2.0 supports data rates up to 16 MB/second and capacities up to 137 GBytes. CF cards consume only five percent of the power required by small disk drives.

CompactFlash cards support both 3.3V and 5V operation and can be interchanged between 3.3V and 5V systems. This means that any CF card can operate at either voltage. Other small form factor flash cards may be available to operate at 3.3V or 5V, but any single card can operate at only one of the voltages. CF+ data storage cards are also available using magnetic disk (IBM Microdrive).

Modes of operation (interface modes)

Compact Flash cards can operate in three modes:

  • Memory card mode
  • I/O card mode
  • True IDE mode

Supported modes of operation (interface modes)

Currently, TRUE IDE and MEMORY CARD mode are supported.

IDE (ATA) Drives

Just like CompactFlash cards, ATA drives have a built-in controller to drive and control the mechanical hardware in a drive. Actually there are two types of connecting ATA drives. 5.25 and 3.5 inch drives are using a 40 pin male interface to connect to an IDE controller. 2.5 and 1.8 inch drives, mostly used in Notebooks and embedded systems, have a 50 pin male interface.

Modes of operation (interface modes)

ATA drives can operate in a variety of different modes:

  • PIO (Programmed I/O)
  • Multiword DMA
  • Ultra DMA

Supported modes of operation (interface modes)

Currently, only PIO mode through TRUE IDE is supported.

Fail-safe operation

Unexpected reset

The data will be preserved.

Power failure

Power failure can be critical: If the card does not have sufficient time to complete a write operation, data may be lost. Countermeasures: make sure the power supply for the card drops slowly.

Sample Usage - IDE/CF Device Driver

The following sample shows how to configure an instance of the IDE/CF device driver. To add the driver, FS_AddDevice() is called with the driver type set to FS_IDE_Driver.

/*********************************************************************
*
*       Defines, configurable
*
**********************************************************************
*/
#define ALLOC_SIZE                 0x800      // Size defined in bytes

/*********************************************************************
*
*       Static data
*
**********************************************************************
*/
static U32   _aMemBlock[ALLOC_SIZE / 4];      // Memory pool used for semi-dynamic allocation.

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/

/*********************************************************************
*
*       FS_X_AddDevices
*
*  Function description
*    This function is called by the FS during FS_Init().
*    It is supposed to add all devices, using primarily FS_AddDevice().
*
*  Note
*    (1) Other API functions
*        Other API functions may NOT be called, since this function is called
*        during initialization. The devices are not yet ready at this point.
*/
void FS_X_AddDevices(void) {
  FS_AssignMemory(&_aMemBlock[0], sizeof(_aMemBlock));
  FS_AddDevice(&FS_IDE_Driver);
  FS_IDE_SetHWType(0, &FS_IDE_HW_Default);
#if FS_USE_FILE_BUFFER
  //
  // Enable the file buffer to increase the performance when reading/writing a small number of bytes.
  //
  FS_ConfigFileBufferDefault(512, FS_FILE_BUFFER_WRITE);
#endif
}

More Information

Purchase

  • Pricing

Technology

  • Performance
  • Resource usage
  • Software Structure
  • emFile Storage Layer

Add-ons

  • Device Driver IDE & Compact Flash
  • Device Driver RAM Disk
  • Device Driver SD, SDHC & MMC
  • Journaling
  • Encryption
  • RAID 1
  • RAID 5
  • BigFAT

Tools

  • Test & Debug Hardware

About us

  • The Company
  • Partners
  • Job Offers
  • Media
  • Contact us

Support

  • Technical Support
  • Blog
  • Forum
  • Wiki

Downloads

  • Application Notes
  • Embedded Studio
  • embOS
  • emCompress
  • emCrypt
  • emFile
  • emLib
  • emLoad
  • emModbus
  • emNet
  • emPower
  • emSecure
  • emSSH
  • emSSL
  • emUSB-Device
  • emUSB-Host
  • emVNC
  • emWin
  • Flasher
  • Free Utilities
  • IoT
  • J-Link / J-Trace
  • Linux Studio
  • SystemView
  • CE / REACH

Social Media

Headquarters

SEGGER Microcontroller GmbH

Ecolab-Allee 5
40789 Monheim am Rhein, Germany
info@segger.com
Tel.: +49-2173-99312-0
Fax: +49-2173-99312-28

Locations

USA: SEGGER Microcontroller Systems LLC

Boston area
101 Suffolk Lane
Gardner, MA 01440, USA
us-east@segger.com
Tel.: +1-978-874-0299
Fax: +1-978-874-0599

Silicon Valley
Milpitas, CA 95035, USA
us-west@segger.com
Tel.: +1-408-767-4068

China: SEGGER Microcontroller China Co., Ltd.

Room 218, Block A, Dahongqiaoguoji
No. 133 Xiulian Road
Minhang District, Shanghai 201199, China
china@segger.com
Tel.: +86-133-619-907-60

ISO 9001 certified

ISO 9001

30+ years of experience

First-class embedded software tools since 1992
  • Imprint
  • Disclaimer
  • Privacy Policy

© 2023 SEGGER - All rights reserved.