2009-09-20 05:23 PM
FATfs for STM32 on Crossworks
2011-05-17 04:23 AM
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.
2011-05-17 04:23 AM
Nice.
Do you plan to write an SPI driver too for FATFs ? -G2011-05-17 04:23 AM
guyvo67,
check out2011-05-17 04:23 AM
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
2011-05-17 04:23 AM
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 Kawachi2011-05-17 04:23 AM
mcgilvra,
Quote:
Another popular FATfs-SPI project is Martin Thomas' FATfs for STM32. Thanks for that great link ! -G2011-05-17 04:23 AM
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.2011-05-17 04:23 AM
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