cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert GNU toolchain program to keil compiler compatible.

jai23
Associate II
Posted on July 18, 2012 at 15:21

I am currently working on a project in which i have to interface SD card with STM32f100RB.

I  did the same with 8bit PIC microcontroller using Application Library provided by Microchip.

for STM32 i get a FATFs module named Chan Application Module modified by Martin Thomas  

But this code is tested for Gcc Toolchain . I am using Keil compiler. This code is not building with Keil compiler.

Please help me in converting the code in Keil compiler compatible.

Thanks in advance.

 
20 REPLIES 20
Posted on July 18, 2012 at 16:55

You're right, it's a bit of a mess.

Suggest you start with a donor/template project for your unspecified board, get that working. Then copy/merge in the functions you need.

SD and FsFat support is presented in several of the ST firmware libraries for their assorted boards and chips. Suggest you download and review some of those.

There is definitely code in the \Utilities\STM32_EVAL\Common directory (STM32F2 peripheral library for example) that demonstrate SPI SD, and SDIO SD, the latter probably not application to the VL series parts, but there is definitely code for the F1xx parts.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
jai23
Associate II
Posted on July 19, 2012 at 08:01

Thanks for your quick response.

Can you suggest me a  link from where i can download STM32 Firmware Library?

frankmeyer9
Associate II
Posted on July 19, 2012 at 10:56

There is the ''Design Support'' page for the STM32F100RB, with documentation and software/firmware downloads:

http://www.st.com/internet/mcu/product/216844.jsp

Posted on July 19, 2012 at 14:05

Can you suggest me a  link from where i can download STM32 Firmware Library?

 

The one I cited, that also contains F1 series EVAL board code is currently here

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32f2xx_stdperiph_lib.zip

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
jai23
Associate II
Posted on July 20, 2012 at 07:13

The one I cited, that also contains F1 series EVAL board code is currently here

 

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32f2xx_stdperiph_lib.zip

 

sir i was look for application firmware library but its only a peripheral library.

Posted on July 20, 2012 at 08:15

Then perhaps

STM32F10x_StdPeriph_Lib_V3.5.0\Utilities\STM32_EVAL\Common\stm32_eval_spi_sd.c

STM32L1xx_StdPeriph_Lib_V1.1.1\Utilities\STM32_EVAL\STM32L152_EVAL\stm32l152_eval_spi_sd.c

Might be instructive. Go fish under the ''Design Support'' tabs of the assorted parts.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
jai23
Associate II
Posted on July 20, 2012 at 13:10

Might be instructive. Go fish under the ''Design Support'' tabs of the assorted parts.

 

Sir i need to store a file in FAT32 file system. So none of these could not help me.

vinothraj
Associate II
Posted on July 20, 2012 at 13:23

@singh.jai:u are from chennai or India?

Posted on July 20, 2012 at 14:04

FatFs code is pervasive

STM32F4-Discovery_FW_V1.1.0\Utilities\Third_Party\fat_fs\src\ff.c

If you have used it before, you'd be aware that the only part you have to port to your memory/disk subsystem is in diskio.c. The bulk of FatFs can be dropped into Keil with no modification.

The trick with pulling a project into a new platform is to be familiar with the code, pull out and use the parts that work, discard those that won't, and code the pieces needed to tied them back together. The ease of this will depend on your familiarity with both GNU/GCC and Keil.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..