2011-12-18 11:24 AM
Hello,
Im trying to use st standart peripherial libraries. In my project im adding stm32f10x.h file ,and also i uncommented #include ''stm32f10x_rcc.h'' line. There is a question at this point. When i activate #include ''stm32f10x_rcc.h'' this line ,which file does call #include ''stm32f10x_rcc.c'', I couldnt understand which file is include .c files (stm32f10x_rcc.c). If i write #include ''stm32f10x_rcc.c in main.c ,without problem i can compile project. Also there is a template that name is `STM32F10x_StdPeriph_Template` in this template all st driver files added as a group.I couldnt find how they add these .c files to main.c.Because if i add like this way i get this error from each st driver.c files. ..\M3_DENEME\stm32f10x.h(96): error: #35: #error directive: ''Please select first the target STM32F10x device used in your application (in stm32f10x.h file)''2011-12-18 02:31 PM
You don't mention your IDE toolchain, which would help for specific advice.
Generally projects contain metadata including directories, options, and defines to be passing the compiler and linker. Look at the top-level, and file-level options associated with source files. Use the template as a reference, and until you are more familiar with the toolchain consider cloning the project, and then adding/removing files you need or create. You normally add source files to the project groups, not as #include's You normally define the CPU and oscillator speeds as part of the initial project definition/wizard.2011-12-18 08:29 PM
2011-12-18 10:38 PM
Did you set all the preprocessor path in the project option setting???
2011-12-20 10:26 AM
Do you mean include paths?
2011-12-20 12:27 PM
Do you mean include paths?
Yes, I think he does. You'll have to make sure you specify any/all paths for include files outside of the main project directory. You also have to have a group within your project into which you add all of the library source files you plan on using, at least with V3.x.x, as they aren't magically pulled in by using ''#include foo.h'' which just provides the prototyping. If you have an Example/Template project and that is building properly, then analyze it very carefully, both the group/tree structure, what files/paths it is using, and options associated with them. If you don't want to read the tool chain documentation thoroughly, or are not sufficiently familiar with all the nuances of building a successful project file from scratch, then start by cloning one that does work.