SD Controller

Describes the Secure Digital (SD) controller supported on the Symbian platform.

The SD controller provided by the Symbian platform is based on the Physical Layer Simplified Specification Version 2.00 from the SD Card Association.

Introduction

The Secure Digital (SD) card protocol is implemented as a super–set of multimedia cards on the Symbian platform. The Multi Media Card (MMC) controller also supports the SD cards. The SD card controller functionality is very similar to the MMC controller and hence the SD card controller is provided by a set of SD card classes which are derived from the MMC controller classes.

SD Card

The SD cards are flash based memory cards used in high capacity data storage in handheld devices like digital cameras, mobile phones and PDAs. The SD cards contain 9 pins and support a 4-bit data bus. SD cards are forward compatible with MMC and hence a device with SD card support will also support MMC cards. SD cards use star topology with dedicated command and data signals.

There are two versions of SD cards: the standard capacity SD card which has a memory capacity of up to 2GB; and high capacity SD cards which have a maximum memory capacity of up to 32GB. The SD card functionality is provided by a layered architecture. The 3 layers are:

  • File System Layer provides high level file operations

  • Media Driver layer provides an interface to the file system and enables low level file operations like read and write to a storage area

  • SD controller provides the low level data operations

The SD card stack is responsible for sending the command sequences to enable the communication between the SD card and file system of the Symbian platform.

SD Card Controller

The File Server uses the Media Driver to access user data from the SD cards. The Multi Media Card (MMC) Media Driver supports the SD cards on the Symbian platform. The MMC media drivers are implemented in MEDMMC.PDD. The Media Driver uses the services of the SD controller. The SD controller is implemented as a peripheral bus controller in EPBUSSD.DLL to support SD cards. The difference between the MMC controller and the SD controller is the default partition information and the initialization sequence used. The main functions of an SD controller are :

  • Support the SD memory card initialization protocol.

  • Reading and writing one or more blocks from/to an SD memory card.

  • Support for 4-bit wide data bus option

  • Support for Erase commands on SD cards

The SD controller first detects the card present in the card port. There can be more than one card port available in a device. When more than one card is present, the controller switches between the ports to identify them. When it detects an SD card, the SD card initialization protocol is loaded. The initialization protocol is a sequence of commands as described in the SD Association specification.

SD controller classes

Figure 1. SD controller classes

SD Stack

The SD controller is implemented through a set of classes derived from the MMC controller. The DMMCStack maintains a state machine and is responsible for detecting the new cards and initializing the necessary stack. The DSDStack is initialised when the controller detects a new SD card. The DSDStack sends the commands to acquire the cards as described in the SD topology. DSDStack::InitialiseMemoryCardSM() is used to initialize the SD cards and DSDStack::ConfigureMemoryCardSM() is used to configure the card.

TSDCard

The TSDCard class provides the functions to read and write information about the card. The PreferredWriteGroupLength returns the Erase Sector size of the SD card. Clients of the SD controller should use DMMCStack::CardP() to get a pointer to the card object. TSDCard::IsCard() function is used to detect a SD card.

Omissions

The Symbian platform does not support SPI mode in SD cards.

Session

The DSDSession class provides the session related functions for the SD cards. The DSDSession class creates the descriptors with command data. These commands are then sent to the SD cards by the controller.