Problem with include file stm32f10x.h when creating a STM32F10x executable

Comments

3 comments

  • Avatar
    Richard Webb

    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.

    0
    Comment actions Permalink
  • Avatar
    Srinath M

    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.c

    Building "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 failed

    stm32f10x_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?

     

    0
    Comment actions Permalink
  • Avatar
    Richard Webb

    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

    0
    Comment actions Permalink

Please sign in to leave a comment.