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.

CC3200 SDHOST_FATFS example hangs in diskio.c -> CardSelect()

Other Parts Discussed in Thread: CC3200

Hi,

I am trying to run the SDHOST_FATFS example program on my CC3200 launchpad.  I have built a custom daughterboard that plugs into the LP.  The daughtercard contains an SD card and a VS1011e MP3 decoder.  I've been able to get the VS1011e working using the serial flash to store the source files but as you know, the serial flash is really tiny and not good for storing lots of .MP3's.  Today I started trying to get the SD card attached and working.  I soldered a microSD to full size SD adapter to the daughterboard and connected the pins to the LP.  I changed the pinmux to the actual pins I am connected to with the SD Card.  Since I am using the SPI port for the VS1011e I can't use the default pins.  My pinmux settings are here:

/*    //
    // Configure PIN_06 for SDHOST0 SDHost_D0
    //
    MAP_PinTypeSDHost(PIN_06, PIN_MODE_8);

    //
    // Configure PIN_07 for SDHOST0 SDHost_CLK
    //
    MAP_PinTypeSDHost(PIN_07, PIN_MODE_8);

    //
    // Configure PIN_08 for SDHOST0 SDHost_CMD
    //
    MAP_PinTypeSDHost(PIN_08, PIN_MODE_8);*/

    //
     // Configure PIN_64 for SDHost0 SDCARD_DATA
     //
     MAP_PinTypeSDHost(PIN_64, PIN_MODE_6);

     //
     // Configure PIN_01 for SDHost0 SDCARD_CLK
     //
     MAP_PinTypeSDHost(PIN_01, PIN_MODE_6);

     //
     // Configure PIN_08 for SDHost0 SDCARD_CMD
     //
     MAP_PinTypeSDHost(PIN_08, PIN_MODE_8);

I changed the clock assignment in the main file as well to PIN_01, matching the clock pin I'm using.  My SD card is connected as follows:

SD Card Launch Pad
2 P2.3
3 GND
4 P1.1
5 P1.9
6 GND
7 P3.9
8 P3.7

*I connected the IRQ pin from the SD Card (SD pin 8) but I did not configure the LP to utilize the IRQ.

I have put a 1GB, FAT32 formatted, microSD card in the adapter, compiled the example and ran it without success.  The example gets stuck in the function CardSelect() found in diskio.c.  The program is waiting for the SDHOST_INT_TC interrupt flag to be set and it isn't.  If I remove the SD card from the adapter, the program runs to completion but obviously fails because there isn't a card installed.  I've verified all my connections with a DMM.

Unfortunately I have no idea where to start on this one.  Does this sound like a physical interface issue?  Is it a software problem?  Can anyone give some insight where to start looking?  Stepping through the code line by line with the debugger doesn't reveal any obvious issues.  (i.e. none of the functions return error values which tells me it is able to talk to the SD Card.)

Thanks in advance,

Shawn

EDIT:  I should also point out that the failing call to CardSelect() happens within the function diskio.c -> disk_initialize().  I should also point out that the disk_initialize() procedure is able to identify the type of SD card I have installed.  (It identified the 1GB as a ver 1 device and a second 8GB as a ver 2 device.)  It was also able to determine the card capacity correctly for the two different cards.  This confirms that the CC3200 can at least talk somewhat to the SD Card.  Now I really don't know where else to look.

  • Update*  I've tried running the SD_Host Demo App and it too fails in the exact same place.  After successfully initializing the card, (and displaying the appropriate details of type, capacity, and version for said card), the program gets stuck waiting for the SDHOST_INT_TC interrupt flag to be set after sending the command CMD_SELECT_CARD.  Since the technical reference manual (SWRU367B) doesn't provide any information regarding the registers for the SD Host interface, I can't say what this interrupt flag is that the controller is waiting to be set.  

    Can anyone help point me in the direction of either additional documentation regarding the SDHost registers or additional documentation about the libraries that are being used.  Also, if anyone has any thoughts regarding what might be happening here I'm all ears.

    Thanks,

    Shawn

  • Hi Shawn,

    To your pin mux can you add following additional API calls and try, these will enable Pull-ups on Data and CMD line

    MAP_PinConfigSet(PIN_08,PIN_STRENGTH_6MA,PIN_TYPE_STD_PU);

    MAP_PinConfigSet(PIN_64,PIN_STRENGTH_6MA,PIN_TYPE_STD_PU);

    Thanks and Regards,

    Praveen

  • Hi Praveen,

    Unfortunately adding those lines to the pin mux had no noticeable effect.  The program still hangs at 

    while( !(MAP_SDHostIntStatus(SDHOST_BASE) & SDHOST_INT_TC) )

    Shawn

  • Can somebody please point me to some documentation that describes the setup and control registers for the SD Host Controller in the CC3200?  The Technical Reference (SWRU367B) has register information for most other peripherals but not the SD Host controller.  I need to figure out what interrupt isn't getting set so that I can figure out what is happening.  I've looked for register level descriptions of the SD Host controller but have not found anything yet.

    I've also tried slowing things way down with the SD Card thinking maybe my point-to-point wiring was having issues, but even running the SD Card CLK signal all the way down to 1MHz isn't enough to make this work.  Like I said, I need more documentation about how the SD Host Controller works so that I can more effectively troubleshoot the problem.  

    Thanks,

    Shawn

  • Did you ever figure out a solution? I think in having very similar problems, although slightly different symptoms. Thanks.

  • No, I never did find a solution.  Partly because of this issue and partly because life got in the way, I have since abandoned this project for the time being.  Perhaps if I get some free time this next year I might pick it back up again.  If you happen to figure this out, please pass the info along.

    Shawn