2012-02-08 04:06 PM
Hi Chaps,
Going slowly mad trying to get Chan Fat working with the sdio libs on a stm32f4.I'm using the most recent (1.0.0) library for the F4, and the low level access demo within that library builds and (at least appears to ) work OK. I've spent many, many hours attempting to patch in 0.9 version of fatfs from chan (thks chan, you're a hero) - but I can't get it to work.If possible, I'd really really appreciate a demo project/source (or direction to - though I've scoured the web and can't find anything that works!)I'll post separately about the current problems I'm having with the my current build, but a working example would sort it.Many thanks,nat. #hse-sdio-stm32 #stm32-fat-chanfat-fatfs-sdio #sdcard-stm32f4-sdio-fatfs #sdcard-stm32f4-sdio-fatfs2012-10-16 09:38 PM
Hi
I have the same problem....Kindly give me sample MDK ARM project to use sdio driver with chan fatfs library....I have initialized sd card using SDIO peripheral...my card is functional now i want to store an image on sd card using FATFs..Kindly tell me what to do and how to do2012-10-17 05:10 AM
There is a simple trick to avoid using FS and still have your data stored in a file.
Pre-format an empty card by putting a big file onto it. Find out where the file starts and start writing from this sector.2012-10-17 07:19 AM - edited 2024-05-06 12:11 PM
Posted on October 17, 2012 at 16:19, updated link 6-May-2024
This is my Keil project for SDCard and FatFs on the STM32F4-Discovery
FATFS-DBG_Keil.zip
Unpack under project directory of Discovery library
Keil\ARM\Examples\ST\STM32F4-Discovery_FW_V1.1.0\Project\FATFS-DBG
This expects a suitably wired MicroSD socket (refer to other STM32F4-Discovery SDIO projects I've posted), and a serial port connected via USART2
2012-10-17 07:27 AM
Many thanks!
2012-10-18 01:31 AM
The project you shared is quite helpful but can you tell me where disk initialization function is being called?
2012-10-18 04:35 AM
It is called by FatFs and flagged within it's structures.
Use grep, or Find-In-Files to locate it's usage.2012-10-22 03:15 AM
@Clive
sorry for asking same questions again and again......as i already told you that i am a newbie so i am unable to comprehend your project in detail......i am running your code but it is neither initializing the card nor it is creating any file on sd card. I am using stm32f4 discovery board and i have excluded detect pin from my circuit. Can you please tell me how should i go? the SD_Init() code you are using is not initializing my card :( i don't know why :(2012-10-22 04:20 AM
Sorry to butt in, Clive1 have you got any other stm32f4discovery projects available we could have a look at? id love to have a play with some of them :)
2012-10-22 07:38 AM
Can you please tell me how should i go? the SD_Init() code you are using is not initializing my card :( i don't know why :(
There are many reasons things can fail, you might want to break out the debugger and step through things, or review the error codes return. I'm using Micro SD cards, with a socket specifically wired, the system is going to be rather intolerant of this being done incorrectly. If you don't use the card detect, or move it to a different pin, you will need to adjust the code to accommodate the changes. The SD_Init() routines are called from within the diskio routines, along with all the other code that ties FatFs to the particular platform.
The SD Slot/Socket is expected to be wired as follows
CARDDETECT = PC2 (Retargetable)
CLK = PC12
CMD = PD2
D0 = PC8
D1 = PC9
D2 = PC10
D3 = PC11
VDD = 3V
VSS = GND
PC10 (SCLK) and PC12 (SDIN) potentially conflict with the CS43L22
The CMD, D0, D1, D2, D3 pins should have 33K or 47K pull up resistors.