Creating CMSIS project

Comments

6 comments

  • Avatar
    Michael Johnson

    CMSIS files are included by default for an STM32 project.

    The STM32 peripheral library updates project contains a template project that you can copy if you want to use the STM32 peripheral library.

    0
    Comment actions Permalink
  • Avatar
    Richard Webb

    I know I'm a dummy but could you provide a pointer to where that gets installed, and perhaps the .hzp filename? So much useful information gets buried deep into assorted directories under Documents and Settings, and it can be hard to dig it back out or, having found something, to know which is applicable to CrossWorks or which may be generic and needs some tweaking.

     I do have the "STMicroelectronics STM32F10x Standard Peripherals Library Updates" installed, in my own case, although the version history notes that V1.1 "Removed example project files" so perhaps it's in a different package?

    I currently eschew using the CMSIS files, preferring to attack the register settings on my own but an option to easily setup and use the CMSIS library could be useful.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    The CMSIS header files are available by putting

    #include <stm32f10x.h>

    into your source code. Remarkably if you right click on this line in the editor and select "Go to Definition" then you can get to the file.

    That's all there is to the basic CMSIS support.

    The CMSIS DSP library is available as a separate CPU support package. I need to work on a .hzp file to build the library but for the moment you can add the source files to your project.

    The easiest way to get to the targets directory is using "File | Open Directory In File Explorer" and then select the Targets directory. Create a desktop short cut so that you can quickly get to this directory.

    Regarding the Standard Peripheral Library Updates package. You need to install it on top of the download from ST and then read the package documentation which is buried in the package and can be dug up using "Tools | Show Installed Packages" and then click on the package link.

    Regards

    Michael

    0
    Comment actions Permalink
  • Avatar
    Richard Webb

    <stm32f10x.h> doesn't seem to be found. Perhaps I need to uninstall/reinstall?

    I created a new project with the template "An executable for STMicroelectronics STM32F10x" [1]. In that project I created a new source file main.c with #include <stm32f10x.h> (and an empty main(){}) but, on the pop-up menu, neither Go To Definition nor Go to Included File succeeds. A fatal error, no such file or directory, is the result.

     The link "File | Open Directory in File Explorer" to Targets does work, taking me to "C:\Documents and Settings\rwebb\Local Settings\Application Data\Rowley Associates Limited\CrossWorks for ARM\packages\targets" under which there is an STM32 directory. If I continue to click down the tree, I find two instances of stm32f10x.h, one in "C:\Documents and Settings\rwebb\Local Settings\Application Data\Rowley Associates Limited\CrossWorks for ARM\packages\targets\STM32\include" and one in the "targets" directory below that. [2]

    Both of these header files work, although their styles differ slightly, where one (CMSIS) uses typedef'd structures and their members to access the registers and the other (Rowley) #includes a processor-specific file that uses #defines for each register address. Neither is found by the vanilla project, however.

     I have evolved my own check-list to set up CrossWorks [4] for STM32F10x projects that works okay. I'm a little concerned that I may be mixing schemas but once configured, the projects compile/link correctly. Sans CMSIS for now, though; manual bit-twiddles of individual registers.

    Notes: 

    [1] The project is created on a separate partition under my own local "projects" tree, rather than in the default "C:\Documents and Settings\rwebb\My Documents/CrossWorks Projects/" directory. Could this be affecting the include-file search path?

    [2] There seems to be a third stm32f10x.h located in "C:\Documents and Settings\rwebb\Local Settings\Application Data\Rowley Associates Limited\CrossWorks for ARM\packages\include\targets" 

    [3] I think that I went through the proper steps regarding installing ST's library first and then the Update package, although it has been a while since I started with the STM32 chips and I certainly may have missed something. Perhaps I should back out of everything and reload?

    [4] Shouldn't CrossWorks be accepted by the spell checker?  ;-) 

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    You need to create an STM32 CPU project not an STM32F10x project. The STM32F10x is the package for the 1.7 Crossworks.

    0
    Comment actions Permalink
  • Avatar
    Richard Webb

    Shazam! That worked. 

     I had no idea that the STM32F10x project option was deprecated under CrossWorks 2.x. It seemed like the better choice of the two I currently show as available under the "New Project | STMicroelectronics" option, since it was more part-specific (Generic STM32 versus Generic STM32F10x). A side-effect of an in-place upgrade from 1.7 to 2.1? Now I have something to play with this weekend...

    Thanks again! 

    0
    Comment actions Permalink

Please sign in to leave a comment.