This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

using mmc-utils or SD ioctl with omap_hsmmc & Beagle Bone Black

Other Parts Discussed in Thread: CSD

Hi Folks,


I am running Linux kernel 3.8.13-00794-g59be459-dirty with buildroot-fs on Beagle-Bone-Black.

I have installed mmc-utils package, and executed the following command:

# mmc extcsd read /dev/mmcblk0
[   34.863647] mmc_claim_host exectued
[   34.867380] calling mmc_wait_for_req
[   34.871147] ** mmc0: starting CMD8 arg 00000000 flags 000000b5
[   34.877754] omap_hsmmc mmc.5: mmc_blk_ioctl_cmd: cmd error -110
ioctl: Connection timed out
Could not read EXT_CSD from /dev/mmcblk0

I have implemented a simple app to send ioctl to get card status, which I am able to do fine. (Here I have sent the argument as RCA), if the argument is 0x0 or 0x0001000 its failing to respond and giving time out error.

int send_status(int fd, __u32 *response)
{
    int ret = 0;
    struct mmc_ioc_cmd idata;

    memset(&idata, 0, sizeof(idata));
    idata.opcode = MMC_SEND_STATUS;

    /* card relative address is shifted by 16 */
    idata.arg = (0xaaaa << 16);
    idata.flags = MMC_RSP_R1 | MMC_CMD_AC | MMC_RSP_SPI_S1;

    ret = ioctl(fd, MMC_IOC_CMD, &idata);
    if (ret)
        perror("ioctl");

    *response = idata.response[0];

    return ret;
}

why mmc-utils failing and how to read card CID through ioctl. I do not want to use cat /sys/block/mmcblk0/device/cid for reading CID

When I am sending GEN_CMD (56) kernel is haning??


Please help giving pointers to debug this issue. Thanks in advance.

Regards,

Vamshi G/

  • Hi,

    Can you verify that MMC controller is not in some idle state before executing the mmc extcsd read /dev/mmcblk0?

    What happens, if you enable MMC controller through prcm clkctrl register first? Do you get the same behavior if you use TI SDK on your BBB?

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks for your response, I am sorry for delayed response, I  have took my time to debug further.

    I am booting from uSD(mmc0), and I have on board eMMC (mmc1).
    - > I have implemented a standalone application that send SD commands through IOCTLS for mmc1.

    -> I have sent CMD13 with argument as RCA (obtained from the boot-log), I got the response fine 0x900 (2304), command executed

    I have sent CMD0 (executed) and then CMD8 which is then failing with error ioctl: Connection timed out

    Is there any way we can address this issue?

  • Hi,

    Could you please provide a register dump of the MMC controller? Maybe there is something that is set incorrectly..

    Best Regards,
    Yordan