Skip to main content
damien2399
Associate II
January 9, 2012
Question

STM32F2XX + SDIO + FatFs problem

  • January 9, 2012
  • 31 replies
  • 6168 views
Posted on January 09, 2012 at 10:38

Hi,

I've a problem with my STM32. I need to use fat filesystem on SD card to read/write/create files.

I tried to use Chan FatFs module but it didn't working at all ...

I use SD card in SDIO and 4 wires mode.

When I debug, check_fs() function can't retrieve 0x55 0xAA on boot sector, but, when I read sector n�0 in the main(), I can correctly read all datas on boot sector.

If someone can help me with this problem ...

Thanks.

#sdio-fatfs #sdio-chan-fatfs
This topic has been closed for replies.

31 replies

ColdWeather
Senior
May 30, 2012
Posted on May 30, 2012 at 20:02

fs->win - is that a pointer to or the buffer itself? Check if you maybe need &fs->win as a parameter of disk_read()

gregoire
Associate II
May 31, 2012
Posted on May 31, 2012 at 10:39

Hi,

Thanks for your advise.

win is a pointer to the buffer win[xx]

Thus I guess it is correct.

I see that in fact the SD_WaitReadOperation() function stuck me.

The processor receives an unexpected interrupt.

I don t see what should be the issue.

Maybe, it is a DMA issue...

Do you have other ideas?

Thanks in advance

Greg

amin23
Visitor II
May 31, 2012
Posted on May 31, 2012 at 11:46

Hi,

Have a look at this thread ''Timing, DMA & SDIO ''Bug'' in Standards Peripherals Examples V3.5.0'' [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Timing, DMA SDIO Bug in Standards Peripherals Examples V3.5.0&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=161]here

gregoire
Associate II
May 31, 2012
Posted on May 31, 2012 at 17:44

Thanks !!!

aambreen
Associate
October 17, 2012
Posted on October 17, 2012 at 06:45

Hi,

I can't understand that why to use diskio.c to initialize the disk when we already have initialized sd card using low level sd_init() in sdio driver. Why can't we directly create a file on sd card using fileopen, read/write function?

I have initialized SD card using SDIO peripheral......my next step is to save an image on sd card using FATfs..Please tell me how should i go now?

Waiting for a prompt response

mailmail9116
Associate III
December 30, 2012
Posted on December 30, 2012 at 08:36

Hi,

Does anyone have a solution? i am facing the same problem

Thanks

Michael

amin23
Visitor II
January 10, 2013
Posted on January 10, 2013 at 15:51

Below an example based on FatFS:

STM32F2 and STM32F4 demonstration builder platform: http://www.st.com/internet/mcu/product/252146.jsp

AN: http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/DM00056717.pdf

Cesar cfg
Associate III
March 5, 2013
Posted on March 05, 2013 at 10:48

Hi 

I am using the stm32f10b eval and i have to store a text file into a micro sd card connected to the stm32 with the spi protocol.

I tried to use the fatfs  but i found a problem when i used.

so how i can integrate a fatfs ibrary to my project.

thanks. 

Tesla DeLorean
Guru
March 5, 2013
Posted on March 05, 2013 at 13:05

Step 1 is to have some demonstrably functional SDIO sector/block read and write routines. These should be thoroughly tested, and you should inspect some of the card content.

Step 2 is to integrate these routines in DISKIO.C for the FatFs library.

If you are having failures you'll need to be specific about what those are, and the errors generated, etc.

One issue I've seen with GNU/GCC was a linker script that didn't zero the BSS section the required structures were allocated in.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Cesar cfg
Associate III
March 5, 2013
Posted on March 05, 2013 at 15:40

i don't inderstand you.my question is there a fatfs library that i can use it without modification.(standard library).