cancel
Showing results for 
Search instead for 
Did you mean: 

FATfs for STM32 on Crossworks

mcgilvra
Associate II
Posted on September 21, 2009 at 02:23

FATfs for STM32 on Crossworks

8 REPLIES 8
mcgilvra
Associate II
Posted on May 17, 2011 at 13:23

I ported the FATfs to a CW project on a STM3210E-EVAL bd. The interface is SDIO. The real-time clock stuff is untested, but we will be implementing a full clock-calender and I will post again then. The project is attached. The main code formats the card then creates and writes a file. Also displays some card info. If you do not comment out the format code block your card will get formatted.

guyvo67
Associate II
Posted on May 17, 2011 at 13:23

Nice.

Do you plan to write an SPI driver too for FATFs ?

-G

domen2
Associate III
Posted on May 17, 2011 at 13:23

guyvo67,

check out

http://www.st.com/mcu/forums-cat-8752-23.html

mcgilvra
Associate II
Posted on May 17, 2011 at 13:23

guyvo67,

No, I wasn't planning an SPI driver. As domen points out there are projects done for that although I don't think on Crossworks. The nice thing about FATfs is it gives you just a few low-level drivers in diskio.h that you must write. Any of the FATfs-SPI projects out there should have a diskio.c that you can borrow and replace in my project. Then you have a Crossworks solution. Another popular FATfs-SPI project is Martin Thomas'

http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html

yak
Associate
Posted on May 17, 2011 at 13:23

Thanks to your effort.

I confirmed that your FatFs driver works using gcc with small modification.(just the deletion of crossworks header include)

By the way, your code does not have license notice on it. Now I am writing a book for novice STM32 user. I would like to introduce your FatFs-SDIO driver with modification for gcc.

If you have any problem please tell me.

Yasuo Kawachi

guyvo67
Associate II
Posted on May 17, 2011 at 13:23

mcgilvra,

Quote:

Another popular FATfs-SPI project is Martin Thomas'

FATfs for STM32.

Thanks for that great link !

-G

mcgilvra
Associate II
Posted on May 17, 2011 at 13:23

Yak1,

Glad you could use it. If you could, please respond and attach the gcc project along with your tool chain details so others can benefit.

If you include the example in your book, just give credit to ChaN for original FATfs, Justin Shaler for low-level SDIO drivers, and myself (Albert McGilvra) for integration and application.

Note, if you want a different output than the debug console, you can edit printf_direct.c to redirect printf, then just change all debug_printf() calls to printf() calls.

yak
Associate
Posted on May 17, 2011 at 13:23

Thank you very much for quick response and approval.

And sorry for my late response.

Files are attached.

Due to the collition of ''bool'' definition between stm32f103x.h and bool.h, definition below have to be comment out form stm32f103x.h

aroud line 239

//typedef enum {FALSE = 0, TRUE = !FALSE} bool;

Print_String function is a print function without parsing in my implementation.

The compiler I use is latest Codesourcery G++.

Hopes this helps STM32 users.

Yasuo