2009-12-07 21:52:18     Another question on SD-MMC using SPI

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2009-12-07 21:52:18     Another question on SD-MMC using SPI


Message: 83182   


I am having some problem with the SD-MMC. The SD device loading is unreliable. Sometime I can see the device being mounted but sometime not mounted (The mounting is done in .rc). I have try different frequency setting in the structure but the result is the same. There are certain SD Card that I can mount most of the time and some SD Card I just cannot mount. Just wonder if there is any suggestion. I am using the BlueTechnix board with our own expansion board.


Attached is boot message of an unsuccessful mount. Some time the


mmcblk0: mmc0:0000 SD02G 1.83 GiB

mmcblk0: p1


appears after the Welcome to ucLinux message.








Michael KOu




U-Boot 2009.06-svn1987 (ADI-2009R2-pre) (Aug 13 2009 - 14:58:14)


CPU:   ADSP bf537-0.3 (Detected Rev: 0.3) (bypass boot)

Board: Bluetechnix CM-BF537E board

       Support:   www.bluetechnix.at/

Clock: VCO: 500 MHz, Core: 500 MHz, System: 125 MHz

RAM:   32 MB

Flash: ERROR: too many flash sectors

8 MB

In:    serial

Out:   serial

Err:   serial

Net:   Blackfin EMAC

MAC:   da:c1:a6:ee:ea:db

Hit any key to stop autoboot:  0


## Booting kernel from Legacy Image at 01000000 ...

   Image Name:   Linux Kernel and ext2

   Created:      2009-10-18   1:10:23 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    2899225 Bytes =  2.8 MB

   Load Address: 00001000

   Entry Point:  001f9e10

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 001f9e10

Linux version (root@colinux) (gcc version 4.1.2 (ADI svn))

#263 Sat Oct 17 21:09:30 EDT 2009

Board Memory: 32MB

Kernel Managed Memory: 32MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00163a10

  rodata    = 0x00163a10-0x001cd1a8

  bss       = 0x001ce000-0x001dee1c

  data      = 0x001dee1c-0x001ee000

    stack   = 0x001ec000-0x001ee000

  init      = 0x001ee000-0x0020d000

  available = 0x0020d000-0x01900000

  rootfs    = 0x01900000-0x01e00000

  DMA Zone  = 0x01e00000-0x02000000

Hardware Trace Active and Enabled

Boot Mode: 0

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.3

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 125 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

Data Cache Enabled for CPU0 (write-back)

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 6350

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial

,uart0,115200 console=ttyBF0,115200 ip=

55.255.0:cm-bf537e:eth0:off ip=


Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 128 (order: 7, 512 bytes)

console [ttyBF0] enabled

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

Memory available: 23212k/32768k RAM, (124k init code, 1418k kernel code, 554k da

ta, 2048k dma, 292k reserved)

Calibrating delay loop... 997.37 BogoMIPS (lpj=1994752)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (9 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (38 KB free)

net_namespace: 288 bytes

NET: Registered protocol family 16

Blackfin DMA Controller

cm_bf537_init(): registering device resources

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

NET: Registered protocol family 1

NTFS driver 2.1.29 [Flags: R/W].

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

msgmni has been set to 45

io scheduler noop registered (default)

io scheduler cfq registered

PPI: ADSP PPI Frame Capture Driver IRQ:11

simple-gpio: now handling 48 GPIOs: 0 - 47

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 20) is a BFIN-UART

bfin-sport-uart.0: ttySS0 at MMIO 0xffc00800 (irq = 12) is a SPORT0

bfin_mii_bus: probed

arch/blackfin/mach-bf537/boards/cm_bf537.c:bfin_get_ether_addr: Setting Ethernet

MAC to a random one

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1, mdc_


bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

uclinux[mtd]: RAM probe address=0x1900000 size=0x500000

Creating 1 MTD partitions on "RAM":

0x00000000-0x00500000 : "ROMfs"

gpio-addr-flash: probing 16-bit flash bus

gpio-addr-flash: Found 1 x16 devices at 0x0 in 16-bit bank

NOR chip too large to fit in mapping. Attempting to cope...

Intel/Sharp Extended Query Table at 0x010A

Intel/Sharp Extended Query Table at 0x010A

Intel/Sharp Extended Query Table at 0x010A

Intel/Sharp Extended Query Table at 0x010A

Intel/Sharp Extended Query Table at 0x010A

Using buffer write method

Using auto-unlock on power-up/resume

cfi_cmdset_0001: Erase suspend on write enabled

Reducing visibility of 8192KiB chip to 4096KiB

cmdlinepart partition parsing not available

RedBoot partition parsing not available

gpio-addr-flash: Using board partition definition

Creating 3 MTD partitions on "gpio-addr-flash":

0x00000000-0x00040000 : "bootloader(nor)"

0x00040000-0x003c0000 : "linux kernel and fs(nor)"

0x003c0000-0x00400000 : "ext file system(nor)"

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc00500, dma channel@7

mmc_spi spi0.1: ASSUMING 3.2-3.4 V slot power

mmc_spi spi0.1: SD/MMC host mmc0, no DMA, no WP, no poweroff

TCP cubic registered

NET: Registered protocol family 17

IP-Config: Complete:

     device=eth0, addr=, mask=, gw=,

     host=cm-bf537e, domain=, nis-domain=(none),

     bootserver=, rootserver=, rootpath=

VFS: Mounted root (ext2 filesystem).

Freeing unused kernel memory: 124k freed

dma_alloc_init: dma_page @ 0x0030e000 - 512 pages at 0x01e00000

mmc_spi spi0.1: requested mode not fully supported

mmc_spi spi0.1: can't change chip-select polarity

mmc0: host does not support reading read-only switch. assuming write-enable.

mmc0: new SD card on SPI

mmcblk0: mmc0:0000 SD02G 1.83 GiB

mmcblk0: p1

mount: mounting /dev/mmcblk0p1 on /mnt/ failed: No such file or directory


Welcome to:

       ____ _  _

      /  __| ||_|             _  _

_   _| |  | | _ ____  _   _ \ \/ /

| | | | |  | || |  _ \| | | | \  /

| |_| | |__| || | | | | |_| | /  \

|  ___\____|_||_|_| |_|\____|/_/\_\



For further information see:








2009-12-07 23:34:41     Re: Another question on SD-MMC using SPI

Mike Frysinger (UNITED STATES)

Message: 83183   


change your code to wait until the device is ready to be mounted, or use hotplug to automount it




2009-12-08 02:56:48     Re: Another question on SD-MMC using SPI

Wolfgang Muees (GERMANY)

Message: 83189   


The error message "no such file or directory" is related to the /mnt/ directory.


When is this directory created? Is it present when the mount script is executing?


What is your detect_delay in the platform data? Try a safe 500 (ms) here.




2009-12-08 12:39:56     Re: Another question on SD-MMC using SPI


Message: 83250   


Thanks for the reply. Here is what I have done.




I change the detect_delay to 500 (ms) but same thing. Reading the SD card still un-reliable.


I am not sure how to put a 'pause' during bootup because I put the mount in .rc. However, it does look like the discovery of the SD card is slow. I would like to automount but I am also not sure how to do it. I am pretty new to linux.


I did however talk to the hardware guy and he suggested that we put a scope to look at the pull up resistor line. We are using all 10KOhm as suggested here (  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:spi_mmc) but the hardware guy think we may need some different value. Any suggestion here ?


Since the page associate with the pull up resistor also mention SPI_MODE_3 so I change to SPI_MODE_0. The discovery of the SD card seem to be more reliable and I can actually discover some of the card that I was not able to discover before. Do you think that is an indication that the pull up resistor is of the wrong value ? Which way should I go, increase or decrease the value ?




Right now, I can discover the Kingston 2G card but not the 1G and 4G card (I have 2 2G cards and only one of them was working before I made the change to SPI_MODE_0). I can read the Sandisk 1G and 2G cards (1 of each). I can also read the Transcent 16G card. The Kingston cards are all class 4. Just wonder if speed has anything to do with the discovery.




Michael Kou




2009-12-08 18:40:33     Re: Another question on SD-MMC using SPI

Mike Frysinger (UNITED STATES)

Message: 83259   


search the wiki for hotplug and use that method