#94 Some SDHC cards not working

libogc (20)
Raphael Enns

I have a Verbatim 4GB SDHC card. The homebrew channel is able to view the contents of the card. However, when trying to run any homebrew that accesses the SDHC card, an error appears and the only way to get the Wii to recognize the card again is to remove it and put it back in. I know there are serveral SDHC cards out there that aren't working. There is a compatibility page on wiibrew regarding this. I wanted to try and trace into the code to see if I could find out why my card didn't work with devkitPro.

I created a very simple homebrew application which just calls fatInitDefault() (from libfat). It returns false.

I traced the failure to __sd0_initio() in libogc/wiisd.c.

If I comment out the line at the top of the function, "sdio_resetcard();", the SDHC works perfect. However, when trying to run the app with a regular SD card in the Wii, the function sd0_initio() fails at the line "ret = sdio_sendcommand(SDIO_CMD_SENDIFCOND, 0, SDIO_RESPONSE_R6, 0x1aa, 0, 0, NULL, &resp, sizeof(resp));". This is in the section of code where the status says the SD card is not initialized. If sdio_resetcard() is left uncommented with the SD card, the status is properly set to initialized for the SD card, but is not for the SDHC card.

To me it looks like the problem has to do with resetting the SD card. For some reason, my SDHC card doesn't like it if it is reset.

I looked in the __sdio_resetcard() function and outputted some of the variables. For both the SD and the SDHC cards, the return value from the call to IOS_Ioctl was 0. However, the value of status was different. For the SD card, the value of status was 0x00010000. For the SDHC card, the value of *status was 0.

I don't have enough knowledge of SD, SDHC and Starlet to be able to go any further with this.

Let me know if you want any more information.


  • DacoTaco

    if you look at the defines, 0x00010000 means its init. so the reset init'd it i guess. i wonder where it fails with the SDHC in the init forcing under the resetcard