Problem with include file stm32f10x.h when creating a STM32F10x executable
I created a simple test project for the STM32F103RB, with a #include <stm32f10x.h> statement, using the generic STM32F10x template. The include file couldn't be found, and I noticed that the Project Property for User Include Directories was missing, and there didn't seem to be any way to add it. I got round the problem by using the generic STM32 template.
Surely the STM32F10x template should have the necessary Project Property.
-
I believe that the STM32 template is the correct one to use with the current compiler release.
From my own set of crib notes:
From release 2.x of CrossWorks, new projects should be built from the STM32 template rather than from STM32F10x. The latter is associated with the previous, 1.7, release of CrossWorks. Just #include <stm32f10x.h> and go. In the event that CrossWorks is reloaded, or for a new installation, the legacy STM32F10x package may be installed to support older projects.
Also, #include system_stm32f10x.c to get the right clock, SysTick, etc. -
Hi
I have a similar problem.
I tried creating my own project and compiling a simple helloWorld that runs on CoOS.
I am not sure how to include the relevant STM32 header files in the project.So as expected i get compilation errors
Building "Executable_1" in configuration "THUMB Debug"
Compiling main.c
main.cBuilding "Executable_1" in configuration "THUMB Debug"
Compiling main.c
main.c
#error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
stm32f10x_gpio.h: No such file or directory
compilation terminated.
Build failedstm32f10x_gpio.h: No such file or directory
Do i have to search (online?) for these STM specific header files and throw in these header files one by one into the project directory or does Crossworks have them in some standard location so that i can say -I ..
Also is there a difference between building executable_1 (project name) and build solution? -
stm32f10x_gpio.h and its siblings are part of ST's Standard Peripheral Library (SPL). This is not included in the CrossWorks distribution but is available from ST's site. The current release is 3.5.0.
Rowley does provide a support package "STMicroelectronics STM32F10x Standard Peripherals Library Updates" to work with the SPL. The current release is 1.2 but that one is "Updated to work with V3.4.0 of the STM32F10x_StdPeriph_Lib." I don't use the SPL so I can't speak as to how well this plays with the 3.5 release.
There is a thread here that discusses setting up and using the SPL. It's for the STM32F4x-series but the general technique is the same: https://rowley.zendesk.com/entries/21780386-stm32f4-getting-started
Please sign in to leave a comment.
Comments
3 comments