sdmmc_send_command HEX values?

Post Reply
Posts: 1
Joined: Wed Jan 03, 2018 12:18 am

sdmmc_send_command HEX values?

Post by gingerbeardman » Wed Jan 03, 2018 12:26 am


First thanks for a great framework and thanks again for adding sdmmc functions such as being able to read the CID of an SD card.

I want to build on this, by writing the CID (some Samsung eMMC are susceptible, google "Samdunk" paper).

As far as I have read, I need to do the following to the SD card:

use CMD62 (vendor specific) to enter vendor mode
use CMD26 (standard) to write/program the CID
use CMD62 (vendor specific) to exit vendor mode

I've tried my best to figure out the HEX data that represents the commands. But it's just educated guessing, looking at the type of arguments and return method expected of the these commands in various documentation.

I cannot help but I'm missing something.

Is there a better way to go about this? How were the HEX values derived for the SDIO commands already used in libnds?


Code: Select all

    // use cmd7 to put sd card in standby mode
    // CMD7
    sdmmc_send_command(device, 0x10507, 0);
My untested code:

Code: Select all

    // use cmd62 to enter Samsung Vendor Mode
    sdmmc_send_command(device, 0x01053E, device->initarg << 0xEF50);

    // use cmd26 to program CID
    sdmmc_send_command(device, 0x01041A, device->initarg << 0x10);

    // use cmd62 to exit Samsung Vendor Mode
    sdmmc_send_command(device, 0x01053E, device->initarg << 0x10);
Help me Obi-wan!


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests