4. SD/MMC Card Operation Guide

4.1. Preparation

  1. UseSDK of U-boot and kernel。

  2. FileSystem:
    SD/MMC ,SDK SupportFATFileSystem,Supportcan can 。
    kernelafterneed /mnt/sdContentsor need ofContents can。
  3. can fdiskToolsImplementationPartitionof 。

  4. CV184x SD Support 2.0and3.0:

before CV184x SD/MMC Support3.3V VDDIO,Use needNote。

4.2. Operation Procedure

  • Default SD/MMC RelatedDriverModulealready Kernel,notneed ExecuteLoadCommands。

  • on ,Canin U-Boot under,Through fat RelatedCommandView Content。 Platform kernel after, Scan SD Node:/dev/mmcblk0 and /dev/mmcblk0p1

  • U-Boot under notSupport Operation,kernel underSupport 。in kernel under SD , Can SD RelatedofOperation。 OperationPlease under ”Operation Example”。

4.3. Operation Example

4.3.1. U-Boot SD Card Operations

SD/MMC in U-Boot under Support FAT FileSystem, notSupport ,mustin U-Boot before SD 。

Steps1:Scan SD/MMC Bus

mmc rescan

Steps2:Confirm SD

mmc rescan Successafter,need ConfirmDevice inwithandPartition Table , after fatls Couldn't find partition mmc 0:1

a. Viewalready of MMC Device Table

mmc list

OutputExample:

mmc@04300000: 0 (SD)
mmc@04310000: 1

Confirm SD inDevice Number(on inDevice 0 is SD )。

b. Settings beforeDeviceandViewPartition Table

mmc dev 0            #  to SD  Device(Device Numberwith mmc list Outputis )
mmc info             # ViewDeviceInformation( 、Rateetc.)
mmc part             #  Partition Table,ConfirmPartition in

OutputExample:

Partition Map for MMC device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            61407232        00000000-01     0c Boot

on inPartition is 1(Part ),Type 0c Indicates FAT32(LBA)。If mmc part Output,Indicates SD Partition,Need to in Linux or Windows underPartitionand is FAT32。

c. Partition TableinofActualPartition ConfirmOperation

If mmc part Output Partition is 1, after CommandsUse mmc 0:1;Ifis (If 2), need Replaceis mmc 0:2

Steps3:View SD ofFile(FAT)

fatls mmc 0:1 /

in 0 is mmc list ConfirmofDevice Number,1 is mmc part ConfirmofPartition 。

Steps4:willFile Memory

fatload mmc 0:1 0x82000000 filename.bin

Steps5:fromMemoryWriteFileto SD

fatwrite mmc 0:1 0x82000000 newfile.bin 0x100000

in 0x82000000 isLoadAddress,0x100000 isWriteBytes ,Please Actual Modify。

4.3.2. Linux SD Card Operations

Steps1: Partition

SD after, DeviceNode:

ls /dev/mmcblk0*
  • If /dev/mmcblk0 Partition(If mmcblk0p1),Indicates SD Partitionor 。

  • If /dev/mmcblk0p1,IndicatesalreadyPartition,can Steps 2 。

Steps2:Partitionand (If SD Partition)

#  Partition( Operation)
fdisk /dev/mmcblk0

#  is FAT32
mkdosfs -F 32 /dev/mmcblk0p1

Steps3:

mount /dev/mmcblk0p1 /mnt/sd

Steps4:Read/writeFile

# View SD  Content
ls /mnt/sd

# from SD  CopyFileto ( )
cp /mnt/sd/data.bin ./

# from CopyFileto SD  ( )
cp ./data.bin /mnt/sd/

#  WriteandUninstall
sync
umount /mnt/sd

4.4. Issues to Note During Operation

  1. needEnsureSD and ,IfIf not , can orRead/writeData Related Information,and Read/writeFailure。

  2. SD after, Need to Operation, Read/write SD ;IfSD already toFileSystem, before must Uninstall(umount)Operation, can inunder SD after nottoSD Partition。 , Need to Uninstall 。

  3. mustEnsure SD already Partition,andwill Partition is FATorFAT32FileSystem(LINUXunderThrough fdiskCommands,WindowsunderUse Tools)。

  4. in Operation Procedureinnot ofOperation:

    • Read/write SD not , Information,and can inFileorFileSystem 。

    • If beforeContents Contents underIf/mnt/sd , UninstallOperation, must beforeContentsIf/mnt/sd, UninstallOperation。

    • SysteminRead/write Contentsof before,not UninstallOperation, must Operation Contentsof Uninstall。

    • inOperation Procedurein ofOperation:

      1. If isRead/writeDataor not FileSystem ,Read/writeSD can FileSystem Information, Need to UninstallOperation, , and , Read/write SD 。

      2. isSD of , / Need to of , afterIf , can nottoSD of 。

      3. IfinTests in ,Use Need to ctrl+c with tokernel shell under, not Information。

      4. SD on withonofPartition ,CanThrough Operation not ofPartition, afterneedConfirm Operationof andUninstallOperation etc., Ensure Uninstall of Partition。