MMC card with spi-sd-card.c

Gene Smith gds at chartertn.net
Mon Dec 22 19:43:36 UTC 2008


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






More information about the users mailing list