cancel
Showing results for 
Search instead for 
Did you mean: 

crating new stm32f103 project in keil

mhdizgah
Associate II
Posted on August 31, 2014 at 06:52

hi every body

i have some question about creating a new project becouse of my serious problems with it:

in version 4 we copy header files of mcu &cmsis library to the projects folder,& i saw some learning cources do this in version 5 ! but unless dosent keil copy this files automaticaly ?

for a simple cmsis project with stm32f103 which files need to copy ? from where?

in option of the project window/c++ tab:

in define why we must type words like this? 

USE_STDPERIPH_DRIVER,STM32F10X_MD

what does they do ?

in include path : when we must define folder ? some project do this & some dont !

for using spi what setting we must do ?(except selecting at first ?)

WBR

#keil #stm32f103
6 REPLIES 6
Posted on August 31, 2014 at 11:31

Wouldn't Keil 5 load an old project template?

STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Template\MDK-ARM

The compiler needs to know where, and what order, the directories containing include files might be situated. Normally it will look in the current directory (of the source file doing the #include), and then whatever defaults Keil has set up, like C:\Keil\ARM\RV31\INC

The above template has

..\;

..\..\..\Libraries\CMSIS\CM3\CoreSupport;

..\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x;

..\..\..\Libraries\STM32F10x_StdPeriph_Driver\inc;

..\..\..\Utilities\STM32_EVAL;

..\..\..\Utilities\STM32_EVAL\STM32100E_EVAL;

..\..\..\Utilities\STM32_EVAL\Common

The defines are pass to the compiler command line, they impact how the preprocessor deals with the include files and what functions, enumerations, and vectors etc. If project structure conforms to the Standard Library model, ie stm32f10x.h will try and include a project specific stm32f10x_conf.h Different chips also have more or less Interrupt Vectors and NVIC channels, so values defined within the include files differ, and you would need an appropriate startup_stm32f10x_??.s source file in your project.

These things aren't materially specific to Keil or ST, all compilers/linkers and toolchains, expect these types of settings to control the behaviour and processing of files in a predictable way.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 31, 2014 at 11:36

For SPI you'd need to add the SPI library source file to your project, along with files handling RCC and GPIO, and whatever others are needed to achieve linkage.

STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c

and the include paths must include

STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\STM32F10x_StdPeriph_Driver\inc

so stm32f10x_spi.h is findable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mhdizgah
Associate II
Posted on August 31, 2014 at 18:34

have you a simple spi project in keil 5.11a?

and a technical note of initialing and description of spi functions?

tnks

Posted on August 31, 2014 at 19:46

I don't, you'd want to install the STM32F1 standard peripheral library, and review the example projects/template.

STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Template\MDK-ARM

STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\SPI\Simplex_Interrupt\readme.txt
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mhdizgah
Associate II
Posted on September 02, 2014 at 20:55

ex cuse me but i dont undrestand your mind

i can find  that directory

i only need a good example of initialing spi in stm32f103 in keil 5 based on CMSIS library

how i can find a example or technical notes of initialing spi & its function with comments & decription

tnks u

Posted on September 02, 2014 at 21:42

Look, I don't provide the specific things you seek, you're going to have to review the available documentation for the tool chain you have chosen, contact their technical support for support/training available. You have access to the same internet search engines as I do, Google some topics, look at the API functions and locate some assorted examples and use cases that serve your needs.

The documentation for the ST Standard Peripheral Library comes in the form of a Microsoft Help file.

STM32F10x_StdPeriph_Lib_V3.5.0\stm32f10x_stdperiph_lib_um.chm

ST provides several firmware libraries, and evaluation boards for which they have a number of examples.

http://www.cs.indiana.edu/~geobrown/book.pdf

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