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.