cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2XX + SDIO + FatFs problem

damien2399
Associate II
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
31 REPLIES 31
gregoire
Associate II
Posted on May 30, 2012 at 17:54

Hi,

I am trying to implement a SD logger. SDIO + FATFS

I read a lot of threads on this forum as in others... in Frank blog.

But I m till not able to make my STM32F405 working with chan-FSsource code.

In the main.c, when I try to open a file,

I have a similar issue as discribed delow.

In check_fs(), it trys to read : 

if (disk_read(fs->drv, fs->win, sect, 1) != RES_OK) /* Load boot record */

 

Then it enters the Default_Handler infinite loop...

Any help would be very apreciated!!!

PS : My IDE is eclipse.

ColdWeather
Senior
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
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
Associate II
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
Posted on May 31, 2012 at 17:44

Thanks !!!

aambreen
Associate II
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 II
Posted on December 30, 2012 at 08:36

Hi,

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

Thanks

Michael

amin23
Associate II
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 II
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. 

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
Up vote any posts that you find helpful, it shows what's working..