SDHC controller (SBC-i.MX51)

Aus BECOM Systems Support
Zur Navigation springen Zur Suche springen

The SD card slot on the SBC-i.MX51 is connected to the eSDHC controller #1 of the i.MX51 processor. See chapter 31 of the i.MX51 Reference Manual for detailed information.

SDHC cards [1] are supported.

Kernel configuration

Device Drivers  --->
  <*> MMC/SD/SDIO card support  --->
    <*>   MMC block device driver
    [*]     Use bounce buffer for simple hosts
    <*>   Freescale i.MX Secure Digital Host Controller Interface support
File systems  --->
  <*> Ext3 journalling file system support
  [*]   Ext3 extended attributes

(choose file systems that you want to use)

Test in Linux

Insert a card into the SD slot. Linux will automatically detect the card and create the device files

/dev/mmcblk0
/dev/mmcblk0p1
/dev/mmcblk0p2
...

for the card itself and its partitions.

We will now create a single partition on the SD card, format it with the EXT3 file system, write a random file to it, and read it back:

  • Create single partition:
fdisk /dev/mmcblk0
p (prints partition table)
d (deletes existing partitions) ...repeat until no partitions exist
n (adds a new parition) ...maximum size
w (writes partition table and exits)
  • Make ext3 file system and mount it:
mkfs.ext3 /dev/mmcblk0p1
mkdir /mnt/sdcard
mount /dev/mmcblk0p1 /mnt/sdcard
  • Create random file:
dd if=/dev/urandom of=/randomfile bs=1M count=1
  • Copy random file to SD card and unmount card:
cp /randomfile /mnt/sdcard
umount /mnt/sdcard
  • Mount SD card again and check randomfile:
mount /dev/mmcblk0p1 /mnt/sdcard
diff /mnt/sdcard/randomfile /randomfile

diff must not output anything, which means the files are 100% identical.

Booting from SD card

See page Boot media.

Performance

We have measured the following speeds with a SanDisk SDHC 4GB card:

  • Read: 13.0 MiB/s
  • Write: 6.3 MiB/s