cancel
Showing results for 
Search instead for 
Did you mean: 

Question for STM32 USB Full Speed Device Library V2.2.1

antonius
Senior
Posted on September 06, 2013 at 02:11

Hello guys,

I have a question for :

Question for STM32 USB Full Speed Device Library      V2.2.1

How can I use SD card on Mass_storage demos ?

is it connected via SPI or SDIO ? or I can choose ?

and how can I connect my USB to it ? where can I find the configuration for it ?

I have PA11 and PA12 connected to USB port.

Thanks a lot
23 REPLIES 23
Posted on September 08, 2013 at 15:06

Please correct me if I'm wrong thank you

I would appear to have confirmed the connectivity.

You should evaluate the SDIO functionality outside the context of the USB MSC.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
antonius
Senior
Posted on September 09, 2013 at 16:51

I can't find CD pin on my SD card, is it optional ? or a must for SDIO ?

Posted on September 09, 2013 at 18:06

I don't see a schematic, looking at the silk-screen suggests SPI, so no

The CD (Card Detect) is not on the CARD, but the SOCKET, it is a switch actuated by the card when isserted. This SOFTWARE may check this pin, and then not try to initialize/communicate with it. If you don't have the CD, then you'll need to defeat the testing for it.

I used the following with the STM32F4-Discovery

http://www.ebay.com.au/itm/MicroSD-Micro-SD-MSD-Card-Breakout-Board-/111078236563?pt=US_Audio_Cables_Adapters&hash=item19dcc76193

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 09, 2013 at 18:57

For the full size cards, I like

http://www.ebay.com.au/itm/Breakout-Board-for-SD-MMC-Cards-/171118914530?pt=LH_DefaultDomain_0&hash=item27d77b6be2

http://www.jianpingusa.com/SDMMC.asp

http://www.jianpingusa.com/datasheet/breakoutboard.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on September 10, 2013 at 14:13

is it possible for me using SPI interface for this demo ? thanks

or make CD pin as activated always...? it's active high isn't it ?

Posted on September 10, 2013 at 15:55

Hard for me to judge, I think there's enough material there to work with.

The switch typically makes to ground when the card is inserted, but rather than wire it up one could simply defeat the test within the code.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on September 11, 2013 at 17:37

so just make it CD = 0 in the code then...?

I just make :

GPIO_ResetBits(SD_DETECT_GPIO_PORT, SD_DETECT_PIN);    // set pin low

0690X00000602jXQAQ.jpg

windows can detect it but can't read the SD yet....any ideas why ?

thanks

Posted on September 11, 2013 at 17:49

No, defeat the test, for example by not doing it, and always returning SD_PRESENT?

/**
* @brief Detect if SD card is correctly plugged in the memory slot.
* @param None
* @retval Return if SD is detected or not
*/
uint8_t SD_Detect(void)
{
__IO uint8_t status = SD_PRESENT;
/*!< Check GPIO to detect SD */
if (GPIO_ReadInputDataBit(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) != Bit_RESET)
{
status = SD_NOT_PRESENT;
}
return status;
}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 12, 2013 at 13:30

so just make it CD = 0 in the code then...?

I just make : GPIO_ResetBits(SD_DETECT_GPIO_PORT, SD_DETECT_PIN); // set pin low

AGAIN NO, Does that even make the pin low? The pin is in input mode.

uint8_t SD_Detect(void)
{
return SD_PRESENT;
}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..