I'm interested in what software packs are commonly used in industry for ARM Cortex-M. E.g which of them are actually used in real projects. How common is it to write one's own API and what does such an internally made API not include?

Furthermore, I'm interested in whether the HAL-Library/Cube from ST is actually a thing.

My special interests are: CMSIS & STM HAL

Please provide also some more information about the cost of the CMSIS package. I thought it to be free and found this:

The CMSIS is provided free of charge by ARM under Apache 2.0 license. View the Apache 2.0 License.

Does this apply for all modules of the CMSIS pack or is there some limitation?

  • 2
    \$\begingroup\$ STM HAL is replaced by the STM Cube, which is generating the HAL-like code and CMSIS. So the way promoted by STM is just to use the Cube. (well, my knowledge of the matter might be a bit outdated). \$\endgroup\$
    – Eugene Sh.
    Feb 8, 2017 at 15:38
  • \$\begingroup\$ There is also MBED which is built on top of CMSIS. \$\endgroup\$ Feb 8, 2017 at 15:54
  • \$\begingroup\$ Afaik HAL is partially built on top of CMSIS and Mbed does use both of them. But that doesn't imply that you'd use only the Cube or Mbed only cuz it's build upon the others. \$\endgroup\$ Feb 8, 2017 at 16:00
  • \$\begingroup\$ CMSIS is a core standard from ARM, common to all ARM Cortex M vendors. But since it is low-level API, ST built HAL high-level wrapper library (surely based on CMSIS) that shall provide more abstraction, portability, easiness. SPL is older library that provided similar functionality, but ST stated that SPL is no more supported and now HAL shall be used. So yes, currently STM32CubeMX is the only official tool that generates start-up code, with HAL, and it is free (+ eclipse plugin with similar functionality). \$\endgroup\$
    – Flanker
    Feb 8, 2017 at 16:12
  • \$\begingroup\$ Thank you all for your explanation. I'm not sure whether my question is unclear. I know that there are different packages some built on top of others, at least to me that doesn't mean anything. I mean let's say you worked all the time with SPL why'd you go for HAL then when using STM32F1 only? But since I never worked really, I can only speculate. So please spare you explanation, or we can discuss this in chat (No offence at all). Or give an actual answer if you have experiences where this did the difference. \$\endgroup\$ Feb 8, 2017 at 16:18

3 Answers 3


Some folks roll their own, they own it they control it they are responsible for it, it is the size and shape they want. Lots of pros, the cons are you have to figure stuff out.

Chip vendors that want to be in business will provide something in some form, the cube thing the hal thing, etc. ARM is jumping in with CMSIS to try to help out if you call that helping out. These libraries and help from the chip vendors, even paying the chip vendors in some way to modify/add things to their libraries, can/do happen. So they are used in industry as well, you can get up and running faster, but you didnt write the code so there is some trust there. When your boss has to trash 40,000 units because of a bug he/she wont care that it wasnt in your code, it was your responsibility, so you should at least read through all of that code and own it. Or gamble. But you can sometimes get up and running faster, and sometimes that code is written by a mid to high level engineer at that company rather than the intern who got stuck with it (I have seen some disturbingly bad code in vendor libraries).

Just like vendors marketing departments will change logos or product family names, etc. the libraries change names and or wholesale get replaced. the CMSIS thing no doubt is throwing a wrench in all the arm based vendors solutions likely causing a do-over.

So the code you didnt write and dont own, will likely have a limited shelf life and support by the vendor for various reasons. Ideally with a product like this that is fine, you write the code get it working and go into mass production and never touch it again.

These parts are generally really easy to program if you roll your own, sometimes easier than trying to figure out how to use the vendor library, sometimes not. I highly recommend you try all the solutions available for the product in question and figure out what fits you personally/professionally. And every so many years repeat the experiment. The st parts have older libraries, the cube stuff, the cmsis stuff a new library and some are supported by mbed, and then there is the just read the manual and poke a few registers approach. Try as many as you can tolerate. How easy was it to get up and running, how bulky is the binary, did you have to use a more expensive part in your project because of library baggage, did you have to burn more NRE because you rolled your own, did you have to burn more NRE because you didnt roll your own?

There is no one right answer here. As far as what is done in "the industry", pretty much everything you can think of. Cost can drive you in different directions, squeeze every instruction out of that binary to save a few cents by using the smaller flash or otp part. Cost can also drive schedule, get it done, save the NRE, even if it costs a few cents per part.

And yes this is a very religious topic, and I may get flamed, you will walk into jobs where it is done one way and one way only, or jobs where you are given freedom (until you screw up), so periodically try the solutions you are not using personally or professionally from time to time in case a new manager comes in or you have to change jobs or you find that the next new ghee whiz solution from that vendor is way better than what you have been doing to date. All the solutions are both right and wrong depending on who you are talking to.


What API for Cortex-M (STM32) are commonly used?

Depending on your definition of "API", at large firms, there tend to be a "corporate environment" or multiple instances of "corporate environment" where "house libraries" are used instead.

For the rest, vendor libraries, both from toolchain vendors and silicon / IP vendors, are often used. CMSIS and associated libraries for example. I have seen quite a few cases where CMSIS-DSP was used.

Keil offers RTP for 5.x users, and it seems to be getting some traction. Others have similar approaches as well.

In the case of STM32, I wouldn't be surprised if there are multiple versions of OEM libraries. I'm an SPL user, augmented by my own middleware. There is HAL too.

Then there are generic "libraries", like graphics, LCDs, etc.

It is tough to be more specific when your question is so generic.


When you used word "industry",you must explain more about your definition, If you are speaking about high safety critical industries (e.g. automotive,Medical, avionic,etc.)As I know codes must be written based on related safety standards(e.g. SIL4 for automotive ,MISRA C ,etc.)And every template of high level used API must obtained these certificates before and as I know SPL,HAL does not have any certification in this area then I think peoples in this industries wrote their program in register level. For other non critical areas like consumer electronic, For saving time in R&D process usually these high level API are used for speeding process up and preparing sample products,after these stage some times codes will be modified and altered with register based or pure functions.

  • 1
    \$\begingroup\$ This looks a lot more like "discussion" than an "answer". Stack exchange sites, including this one, are fairly strict that "answers" must be actual answers. The question itself is arguably not a fit here, as it isn't really one that can have a definitive solution. These sites are not intended to cover all related topics of potential interest, but rather only questions that fit within their model. \$\endgroup\$ Feb 11, 2017 at 20:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.