cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between CMSIS and CMSIS-RTOS?

m m
Associate II
Posted on September 07, 2017 at 08:45

I can remember few years ago, we could create projects with CMSIS library. But nowadays when I search about CMSIS, there is CMSIS-RTOS instead of that. Is it mean we should use CMSIS-RTOS from now? Also I am confused about cubemx and HAL, what are these and what is the relationship between these?

3 REPLIES 3
Alan Chambers
Associate II
Posted on September 07, 2017 at 09:55

Keil has a good description of the CMSIS framework here:

http://www.keil.com/pack/doc/CMSIS/General/html/index.html

.

I think when you refer to just CMSIS, you mean what they call CMSIS-Core - all the low level register definitions, mask bits, and so on. The core ARM peripherals (NVIC, etc) are covered. I'm not sure how manufacturer-specific peripherals fit into the framework, but ST extend the definitions to cover all their peripherals. Some people program entirely in terms of CMSIS: it amounts to direct register access with no intermediate fluff, but it is easier to make mistakes. 

CMSIS-RTOS is an API for a real time operating system, and Keil have an implementation of this API built on top of their OS called RTX. I have used CMSIS-RTOS in a project (on a Giant Gecko). It's OK, but my needs were limited. Their are two version of the RTOS v1 and v2. I found v2 to be broken or unfinished or something. I had numerous painful issues which all went away when I reverted to v1.

HAL is an ST support library in C which is intended to replace the older Standard Peripheral Library. Both of these libraries make use of CMSIS-Core, and basically hide direct register access behind a function API. This is quite useful when a lot of bit fiddling and multiple field change in multiple registers are needed. Opinions about HAL are mixed. My own view is that it is greatly inferior to SPL, and I never use it.

STM32CubeMX is a rather nice GUI tool for configuring, generating and maintaining STM32 projects. Unfortunately, the code it generates depends on HAL, which limits to GUI's usefulness for me. The generated code is also, I think, somewhat impenetrable and poorly organised. I don't know whether other libraries and templates can be added, or how easily.
Zt Liu
Senior III
Posted on September 07, 2017 at 09:58

Is it mean we should use CMSIS-RTOS from now?

This is certainly NOT the case!

------------------------------------------

------------------------------------------

------------------------------------------

---------------------------------

The Cortex Microcontroller Software Interface Standard (CMSIS) is such a big library containing at least:

  • CMSIS-CORE: bare-metal run-time system for Cortex-M devices. Includes startup code, interface functions to the processor core, and definitions for peripheral access.
  • CMSIS-RTOS: standardize interface to real-time operating systems (RTOS) including a reference implementation based on RTX.
  • CMSIS-DSP: software library with common digital signal processing (DSP) functions; optimized for the various Cortex-M processors.
  • CMSIS-SVD: system view description (SVD) for device and peripheral awareness during debugging and consistent device header files.
  • CMSIS-DAP: firmware to interface with the debug access port (DAP) of Cortex devices that is frequently used by evaluation kits.

I guess most of the time when people saying CMSIS, they have CMSIS-CORE on their minds. core_cmx.h is what they are talking about. Those routines about NVIC, SYSTICK etc, like NVIC_EnableIRQ() or SysTick_Config()...

You will see this standard routines in every ARM Cortex Mx chip, not just in ST.

CMSIS-RTOS is a standard INTERFACE to your (preferred) RTOS. By the way, ARM has their own RTOS, called RTX. 

I am not very clear why they do this interface, and I am not using it personally. In this case, for example,  if you are using FreeRTOS, a xTaskCreate() (a FreeRTOS function) would be wrapped into osThreadCreate() (CMSIS-RTOS interface).

CMSIS-DSP  supports a lot of math functions that is quite efficient, at least for me. Take a loot at

http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html

.

Hope that helps you.

zt

Imen.D
ST Employee
Posted on September 07, 2017 at 09:59

Hello,

The CMSIS-RTOS is a common API for Real-Time operating systems (RTOS) provides a standardized programming interface that is portable to many RTOS and enables therefore software templates, middleware, libraries, and other components that can work across supported the RTOS systems.

You may refer to this

http://www.keil.com/pack/doc/CMSIS/General/html/index.html

page and

http://www.st.com/content/ccc/resource/technical/document/user_manual/2d/60/ff/15/8c/c9/43/77/DM00105pdf/files/DM00105pdf/jcr:content/translations/en.DM00105pdf

User manual for more clarificationandto understand more about the architecture.

You can get the

http://www.st.com/en/embedded-software/stm32cube-embedded-software.html?querycriteria=productId=LN1897

libraries which are delivered per Series (such as STM32CubeL4 for STM32L4 Series) and containing libraries, examples and documentation, including:

  • The STM32Cube HAL abstraction layer, ensuring maximized portability between different STM32 devices.

  • The Low-Layer (LL) APIs, a light-weight, optimized, expert-oriented layer designed for both performance and runtime efficiency. The Low-layer APIs are available only for a set of peripherals.

  • A collection of Middleware components, such as RTOS, USB library, STMTouch, FatFs, TCP/IP stack and Graphic Library (depending on the MCU series)

  • Full set of examples and demonstration.

About STM32CubeMX, it is a free ST graphical tool that allows generating peripheral initialization C code with all necessary libraries using

graphical wizards

with very easy configuration of the STM32 MCUs (pins assignments, clock tree, peripherals and middleware).

Hope this helps you.

Kind Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen