Skip to main content
  • 产品
  • Evaluate our Software
  • 下载
  • Free Utilities
  • 购买
  • 支持
  • 关于我们
  • Search
    • Contact Us
    • Forum
    • Knowledge Base
    • Newsletter
    • RSS
  •   工作机会
  •   视频
  •   永续性
  • emFile
  • Device Driver IDE & Compact Flash
  • Technology
  • Add-ons
  • Tools

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.

Contact us
Downloads
Documentation
SEGGER emFile
  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
}

全球总部

德国: SEGGER Microcontroller GmbH

地址: Ecolab-Allee 5
40789 Monheim am Rhein, Germany
电邮: info@segger.com
电话: +49-2173-99312-0
传真: +49-2173-99312-28

网点分布

中国:哲戈微系统科技(上海)有限公司

地址: 中国上海市闵行区秀涟路133号
大虹桥国际A 栋218室
邮编201199
电邮: china@segger.com
电话: +86-133-619-907-60

通过ISO 9001认证

ISO 9001

30多年的嵌入式行业经验

First-class embedded software tools since 1992
  • 版本说明
  • 免责声明
  • 隐私策略
  • 沪ICP备2022005181号
  • 沪公网安备 31011202014525号
© 2025 SEGGER - 版权所有.

您即将离开 segger.cn 而访问境外网站,是否继续?