Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SDHC SdCard Example

Overview

The SDHC SdCard Example application demonstrates the use of SD card driver. It displays the card information followed by a write-read compare test and the erase operation. Provide an example with different modes:

Supported Platforms

These Freescale Freedom development platforms and Tower System modules are supported by the SDHC SdCard example.

System Requirement

Hardware requirements

Toolchain requirements

Software requirements

Getting Started

Hardware settings

The SDHC SdCard Example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board's jumper settings and configurations in default state when running this example.

Prepare the example

  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.
  2. Open a serial terminal with these settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  3. Download the program to the target board.
  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Run the example

Insert an SD or a micro-SD card depending on the board connector. Ensure that the card doesn't contain any important content because the demo will erase and overwrite some sectors.

These instructions are displayed/shown on the terminal window:

SD Card Demo Start!
This demo is going to access data on card
A card is detected
sdcard initialized
------- Card Information -------
Card Type: SDHC
Card Capacity: f GB
Host Clock Max Rate: 120 MHz
Clock Rate: 20 MHz
Manufacturer ID: 0x3
OEM ID: 0x5344
Product name: SD04G
Product serial number: 0x25BD9A0
Product revision: 8.0
Manufacturing data: Dec 2010
CSD Structure: 0x1
taac: f ns
nsac: 0 clks
tran speed: f kbps
ccc: class 0 2 4 5 7 8 10
max read block length: 512 Bytes
c_size: 7562
Erase unit size is one or multiple units of 512 bytes
The size of write protected group is 2 blocks
R2W_Factor: 2
max write block length: 9
The content is copied
Hard disk-like file system with partition table
SCR Structure: 0x0
SD Spec: 0x2
SD Spec 3.0
SDHC Card(Security Version 2.00)
Card supports 1-bit bus width
Card supports 4-bit bus width
Support set block count command
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
THIS DEMO IS GOING TO ERASE AND WRITE RAW DATA TO THE CARD,
MAKE SURE YOU TAKE BACKUP OF ANY VALUEABLE DATA PRESENT IN THE CARD
BEFORE PROCEEDING.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Do you want to proceed? (Enter 'y' IF yes) :

User need type 'Y' character from the keyboard. These instructions are displayed/shown on the terminal window:

Start write/read/compare demo...
Single block write/read/compare demo passed!
Multi-block write/read/compare demo passed!
Erase blocks demo passed!
SD Card Demo End!