cancel
Showing results for 
Search instead for 
Did you mean: 

Which files to use? CMSIS from Keil of ST?

cameronm
Associate
Posted on June 08, 2012 at 10:31

I would like to apologize if this topic is already been discussed, but my search just wasted time.

We are trying to figure out which files to use for our ST device (STM32F2xx).

We would like to use the ST standard peripheral libraries.  It contains CMSIS folder and the peripheral libraries.  Can we reference the STM32F2xx.h file from this CMSIS folder?  Must we also reference the core header files (e.g. core_cm3.h) from this folder(s)?

The issue that we have at the moment (and we think we will have more issues in future with this) is that the stm32f2xx.h file is located under keil\arm\inc\st\stm32f32xx.  We need to modify this file to for example modify the HSE_VALUE, because our system runs at a different frequency.

We believe that because of this, we should rather include the CMSIS library separately from the compiler, however, we are not sure how it affects the Keil libraries (.lib files).

We have for example a newer version of the ST peripheral library, but we are not sure if we can use it or not?

Could someone please give us some insight on how to go about using the CMSIS library without it being tied to ARM compiler.  Also, we would like to easily switch to any new versions of the peripheral library should ST make it available.  Thanks in advance for your response.

#cmsis-keil-peripheral-library
5 REPLIES 5
mgerth
Associate
Posted on June 08, 2012 at 12:20

I'd recommend to use the CMSIS files (like core_cm3.h, core_cmFunc.h, core_cmInstr.h) directly from the ARM website, and to use the stm32f10x.h from the ST package.

You should also use the ST Standard Peripheral Library from the ST website instead of the Keil one.

With this approach, you are independant of the current Keil revision. However, to avoid any issues with the files provided by Keil, I'd recommend to delete CMSIS and the ST Standard Peripheral Library files out of C:\Keil\ARM.

Regards, 

Martin

Posted on June 08, 2012 at 13:39

With Martin here, download the firmware libraries from ST, I put them under the \Keil\ARM\Examples\ST directory to keep things together. Most of the new releases from ST have an example project template.

Moving to a new version of the library is a matter of copying the files under the new tree, and using a new template if necessary. Using merge tools can also be quite effective, see WinMerge or Araxis Merge. The most frustrating point is usually the project file itself and all the metadata and option settings it may hold.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
alok472
Associate II
Posted on June 09, 2012 at 09:13

as long a you are using STM32F2x, use the library example from ST as lower layers. Your code will be anyway application code and you can migrate to any MCU when needed.

i always start from the ST's example code and then add my files on top of it.

Andrew Neil
Chief II
Posted on June 09, 2012 at 13:35

I answered in your cross-post on the Keil forum:

http://www.keil.com/forum/20996

They are all ST files - Keil simply includes a copy of ST's files with their installation.

I would recommend that you should, wherever possible, go direct to the source - in this case, ST.

It has been the case (maybe still is) that what Keil shipped was out-of-date and incompatible with the current version direct from ST - which meant that none of the current examples from the ST site would work if you used the Keil-supplied stuff. So, again, I recommend going direct to the source.

jlchoobs
Associate II
Posted on June 10, 2012 at 14:35

Don't bother worrying about N's negative comments.

 

He has been doing this all through the forum.

 

Some kid who likes crittiquing everybody - without giving any actual helpful advice.