Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 17 Oct 2007 11:19 PM by  arjun.kv@7lf-tech.com
How to access MMC (SD card) with Linux?
 9 Replies
Sort:
You are not authorized to post a reply.
Author Messages
jesus.ruizdeinfante@hale.at
New Member
New Member
Posts:


--
11 Jul 2007 03:40 AM
    I'm having problems trying to access a SD card with linux.

    I'm using linux 2.6.19.2 ADS plus LITEKIT patches.

    dmsg doesn't show any event on card insertion.
    No device node is created either.
    Do I need to create the device node manually?
    Something like "mknod /dev/mmcblock0 b 254 0" ?

    This is strange, because in message http://www.logicpd.com/su...viewtopic.php?t=1135
    zonque reported that he tested MMC successfully.

    Some more info:

    The boot log shows that the MMC is initialized:
    ...
    [ 54.950000] MXC MMC/SD driver

    ps shows that udevd is up and running.


    mx31# cat /proc/devices
    Block devices:
    ...
    254 mmc
    mx31# mknod /dev/mmcblock0 b 254 0
    mx31# mount /dev/mmcblock0 /mnt/
    mount: Mounting /dev/mmcblock0 on /mnt/ failed: No such device or address






    Any ideas?
    guijuan721@sina.com
    New Member
    New Member
    Posts:


    --
    13 Jul 2007 07:29 AM
    Quote:
    dmsg doesn't show any event on card insertion.
    No device node is created either.
    Do I need to create the device node manually?
    Something like "mknod /dev/mmcblock0 b 254 0" ?


    1.you can check whether the mmc driver configed in the kernel,i think if it configed there should have some info about it.
    2.in the .config you should config the following
    file system -->
    pseudo filesystem-->
    /proc file system support choose
    /proc/kcore support choose
    sysfs file system support choose
    /dev file system support choose
    auto mount at boot not choose
    3. fdisk /dev/mmcblock0
    4. mx31# mount -t vfat /dev/mmcblock0p1 /mnt/
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    16 Aug 2007 08:25 AM
    Hi,

    I am also having problems with my SanDisk TransFlash card. I have enabled MMC/SD drivers, /proc, sysfs file system support and I am getting the following error:

    MXCMMC: CMD: opcode: 18 <6>arg: 0x00000000 <6>flags: 0x00000035
    [ 54.700000] mxcmci_request:status: <6>CARD_BUS_CLK_RUN |<6>SDIO_INT_ACTIVE |<6>XBUF_EMPTY |<6>YBUF_EMPTY |<6>
    [ 54.710000] mxcmci_start_clock:status: <6>mxcmci_irq:status: <6>RESP_CRC_ERR |<6>BUF_READ_RDY |<6>END_CMD_RESP |<6>SDIO_I>[ 51.720000] MXCMMC: cmd crc error
    [ 54.730000] CARD_BUS_CLK_RUN |<6>SDIO_INT_ACTIVE |<6>XBUF_EMPTY |<6>YBUF_EMPTY |<6>
    [ 54.740000] mxcmci_start_clock:status: <6>BUF_READ_RDY |<6>CARD_BUS_CLK_RUN |<6>SDIO_INT_ACTIVE |<6>BUF_OVFL |<6>XBUF_FUL>[ 51.750000] mmcblk0: error 2 sending read/write command
    [ 52.750000] end_request: I/O error, dev mmcblk0, sector 0
    [ 51.750000] Buffer I/O error on device mmcblk0, logical block 0
    [ 54.770000] MXCMMC: CMD: opcode: 18 <6>arg: 0x00000000 <6>flags: 0x00000035
    [ 54.770000] mxcmci_request:status: <6>BUF_READ_RDY |<6>SDIO_INT_ACTIVE |<6>BUF_OVFL |<6>XBUF_FULL |<6>YBUF_FULL |<6>
    [ 54.780000] mxcmci_start_clock:status: <6>SDIO_INT_ACTIVE |<6>XBUF_EMPTY |<6>YBUF_EMPTY |<6>
    [ 54.790000] mxcmci_start_clock:status: <6>BUF_READ_RDY |<6>CARD_BUS_CLK_RUN |<6>SDIO_INT_ACTIVE |<6>BUF_OVFL |<6>XBUF_FUL>

    And the kernel hangs there.

    If I try to mount after bootup, it doesnt mount.

    mx31# cat /proc/devices
    Block devices:
    ...
    254 mmc
    mx31# mknod /dev/mmcblock0 b 254 0
    mx31# fdisk /dev/mmcblock0
    Unable to open /dev/mmcblock0
    mx31# mount -t vfat /dev/mmcblock0 /mnt/
    mount: Mounting /dev/mmcblock0 on /mnt/ failed: No such device or address

    Is this a problem with the disk since it says CRC error?

    Thanks
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    18 Sep 2007 08:05 AM
    I am not able to mount the SD/MMC card after the system boots. If the card is inserted at the time of boot up the card works just fine. But when I insert the card later(after bootup) I dont see a mmcblk created. And the interrupt routine itself is not called. Has anybody faced this problem. Any pointers would be really great.
    OradFarez
    New Member
    New Member
    Posts:


    --
    19 Sep 2007 04:34 AM
    Similar problem for me as well:

    mx31# mount -t vfat /dev/mmcblock0 /mnt/sd
    udevsend[1268]: main: error getting socket: Address family not supported by protocol
    mount: Mounting /dev/mmcblock0 on /mnt/sd failed: Invalid argument

    I have tried booting with the card in and then I don't have to do mknod, but it won't mount. I have tried an old 32MB card and a newer 2GB one. When I stick the card in I get these warnings:

    mx31# [ 52.880000] mmc0: host does not support reading read-only switch. assuming write-enable.
    [ 54.940000] mmcblk0: mmc0:b368 D0507 29888KiB
    [ 54.940000] mmcblk0:udevsend[1362]: main: error getting socket: Address family not supported by protoco
    l
    p1
    udevsend[1389]: main: error getting socket: Address family not supported by protocol
    udevsend[1391]: main: error getting socket: Address family not supported by protocol


    I hope the solution is out there.
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    26 Sep 2007 03:50 PM
    someone more familiar with the patches will have to comment on what's in the code, but I know the two switches built into the sd socket are wired up differently on the ads board and the lpd board. ads board used their fpga and lpd board uses processor gpio. if the patches don't set up and point to these gpio it might explain why it works when the card is in prior to booting.
    sanjeevgt@gmail.com
    New Member
    New Member
    Posts:


    --
    09 Oct 2007 02:56 PM
    change the GPIO1_1 to GPIO1_6 in mx31lite_gpio.c for sdhc (1).

    This will solve the problem of autodetection of sd card after linux has booted.
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    09 Oct 2007 05:09 PM
    How are you getting fdisk, do you have to configure busybox to add this or is it in another ltib package?
    sanjeevgt@gmail.com
    New Member
    New Member
    Posts:


    --
    10 Oct 2007 07:24 AM
    fdisk is already there in my busybox rootfs. I am using imx31_ads_20070128-rel3-ltib.iso and by default it is there in /sbin.
    arjun.kv@7lf-tech.com
    New Member
    New Member
    Posts:


    --
    17 Oct 2007 11:19 PM
    Your changes worked for detection of the card, but mmcblk doesnt get created and there are no error messages either. It still works when i have card inserted prior to booting.
    You are not authorized to post a reply.