2017-09-06 11:45 PM
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?
2017-09-07 12:55 AM
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.2017-09-07 12:58 AM
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:
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
2017-09-07 12:59 AM
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
User manual for more clarificationandto understand more about the architecture.
You can get the
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)./external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fresource%2Fen%2Fuser_manual%2Fdm001047pdf
https://www.youtube.com/watch?v=szMGedsp9jc&index=26&list=PLnMKNibPkDnF97QnUOFGirl1q0G_4VdDc
Hope this helps you.
Kind Regards
Imen