2017-02-22 05:43 AM
Hello. I am trying to integrate SD Card (Transcend 4GB) with STM32F407 Disc board. I had followed all previous discussion & made corrections yet i am getting Error. I have attached my clock configuration, Pin diagram of STM Cube MX & Detail Code. Can anybody tell me what extra changes i Need to do to get rid of error. Usually i am getting Disc error (Program is not going aheaf 'f_mount()'). When i press reset button it gives Disc Error.
I changed all GPIOs to 'Pull high'. I am not sure if 3V power is enough for the Memory Card as i am directly connecting my VDD pin (STM32F4) to Memory Card. I have connected Memory Card by following way to board:
1. Card Detect (PIN1) to PC2
2.CMD (PIN2) to PD2
3. Clock(PIN5) to PC12
4. VDD(PIN4) to 3V
5. DAT0(PIN7) to PC8
Any comments about Code & configurations will be highly appreciated.
#fatfs #stm32f4discovery-stm32f4 #stmcubemx2017-02-22 01:34 PM
Ok, so zipped project doesn't contain source code
Don't think you've quite grasped the Card Detect here. If you are running in SDIO mode, vis SPI.
The Card Detect on a socket is typically a switch to ground, not a card pin. If a card pin it is used as a Chip Select.
Is this a full sized SD Card?
Is it using a socket? Soldered directly to the card pins?
Got a data sheet or web page for the socket? Cite it.
Do you have the Ground pin (3 & 6) wired?
The STM32F4-DISCO will accommodate a full SDIO 4-bit interface, the circuit and connectivity being covered here multiple times. I'm not looking to keep debugging these things, my goals have been to provide clear info and code to get it working, not debug 1000 disfunctional designs/codes.
Remember there is no point prodding the FatFs side of the code, you need to get into the SDIO/SPI layer and make that work properly first, otherwise most salient detail and failure mechanism is lost with an arbitrary ''Doesn't Work'' kind of error telling us nothing.
An SPI type connection would look something like this
I'd recommend a fully wired SDIO solution, look at the STM32F4DIS-BB board for a common and working interface.
2017-02-23 03:24 AM
Hello Clive,
You are right ist already explained many times on this community about Interface. But unfortunatly i was unable to get cause of error.
About your questions:
1. Card is full sized.
2. Yes i am using socket. I have soldered Pins with socket. Please find attached Information of same. It have 9 Pins which i have connected with Discovery board via connectors.
http://www.molex.com/molex/products/datasheet.jsp?part=active/5035000991_MEMORY_CARD_SOCKET.xml
3. Yes i have wired Ground Pin 3,6 & connected it with GND terminal on the Discovery board.
4. Regarding Code i had attached Keil V5 source file. Also i am attaching now Src files generated from Cube MX.
I will again go through all my Connections.
Thanks for Reply.
2017-04-03 04:05 AM
Hey ,
Problem solved. I guess error was in Clock Initialisation for SDIO. I think when i generated Code from cube MX, clock initialisation was Missing. Also I have assigned seperate pin for Card detect (PE15 for STM32F205). SO now i can detect my SD Card as well as write data on it.
Thanks for Detail Information.