[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MMC card with spi-sd-card.c
- Date: Mon, 22 Dec 2008 14:43:36 -0500
- From: gds at chartertn.net (Gene Smith)
- Subject: MMC card with spi-sd-card.c
I have been trying to use an MMC with the "spi/sd" drivers in RTEMS. I
worked until it tries to send two commands in a loop waiting for idle
conditon in an init routine:
rv = sd_card_send_command( e, SD_CARD_CMD_APP_CMD, 0);
CLEANUP_RVSC( rv, sc, sd_card_driver_init_cleanup, "Send:
SD_CARD_CMD_APP_CMD");
rv = sd_card_send_command( e, SD_CARD_ACMD_SD_SEND_OP_COND, 0);
CLEANUP_RVSC( rv, sc, sd_card_driver_init_cleanup, "Send:
SD_CARD_ACMD_SD_SEND_OP_COND");
The first on seems to work but the 2nd on fails.
I found something in a Samsung MMC manual that says when waiting for
idle on it you should do this instead.
rv = sd_card_send_command( e, SD_CARD_CMD_SEND_OP_COND, 0);
CLEANUP_RVSC( rv, sc, sd_card_driver_init_cleanup, "Send:
SD_CARD_CMD_SEND_OP_COND");
When I do this instead the code detects idle after two loops (stepping
with debugger) and continues on with no apparent errors and registers
the card.
I am not sure if there are other ways a MMC differs from a SD.
-gene