Page 1 of 2
CMSIS RTOS
Posted: Thu Jan 19, 2012 9:12 pm
by Giovanni
Starting from version 3.0, CMSIS will define a specific RTOS API, the preview is already available here:
http://www.onarm.com/cmsis/download/19/ ... ard-cmsis/This API will allow to design RTOS-independent components. My idea is to focus the kernel development after version 2.4.0 on providing a compliant API, the new API would wrap/supplement the normal ChibiOS API not replace it, I still think it is particularly efficient and elegant.
This development is interesting because it will possible to design complex components (file systems, networking stacks) without have to use a vendor specific interface. For example a stack like lwIP could simply assume that API instead of defining its own RTOS wrapper.
Of course it is all very preliminary, the idea is good but there is still a chance they will screw it up

Giovanni
Re: CMSIS RTOS
Posted: Fri Jan 20, 2012 9:25 am
by tecnologic
Hi Giovanni,
This means that you have to separate the Cortex MCUs from the non Cortex ones, because there is no CMSIS support for AVR or STM8. For me its no big deal because i dont use a RTOS on MCUs like this. And came to use STM32F1 even for simple Led blinking.
But when there is an CMSIS ChibiOS, then it could be a good deal to have a Look on C++ for Kernel an HAL API, then for Cortex MCUs C++ is no big deal and i think ChibiOS would get more like a real OS. The existing C++ Wrapper for the kernel API is an good step in this direction but not complete. When i am more familiar with ChibiOS then i would like to help with development, especialy for STM32F1 and F4.
I am pretty new to ChibiOS, i converted from Keil RTX and FreeRTOS. But i am getting more an more convinced by your concept. I mean things like the Serial driver and the Shell.
Tec
Re: CMSIS RTOS
Posted: Fri Jan 20, 2012 9:42 am
by Giovanni
Hi Tec,
The Kernel would remain portable, it would not have any dependency on CMSIS, this API would be a Cortex-specific extension not available for other architectures.
About the C++ wrapper, it was an experiment that I did in order to assess the C++ overhead on embedded applications out of curiosity, it received far more interest than I expected, any help about defining a new C++ API is welcome, there is also a dedicated thread about that in this forum.
Giovanni
Re: CMSIS RTOS
Posted: Fri Jan 20, 2012 2:12 pm
by tecnologic
Hi Giovanni,
building CMSIS RTOS as an extension is a goog way i think. in the same manner CMSIS Math could be handled as well.
I have tested the C++ Wrapper on F4-Discovery and found it nice to handle. The probleme with the main stacksize is an issue that must besolved because its not obvious to the user.
But first i want to code a c-project in ChibiOS on F4-Discovery to get familiar with the concepts used in ChibiOS, its a way different from systems like Keil RTX which are mere Schedulers than OSs. if i am done with that i may be an help in wiriting an C++ wrapper for kernel an Hal.
Tec
Re: CMSIS RTOS
Posted: Mon Feb 27, 2012 8:41 pm
by gfortaine
Hello,
For your information :
http://mbed.org/handbook/CMSIS-RTOSBest Regards,
Guillaume FORTAINE
Re: CMSIS RTOS
Posted: Thu Mar 08, 2012 2:51 pm
by Jacon
Some valid considerations from competition
http://goo.gl/j5ZgV
Re: CMSIS RTOS
Posted: Thu Mar 08, 2012 4:10 pm
by Giovanni
I agree with most points made in the article and also with some of the comments.
I must say that I don't particularly like the CMSIS RTOS API, it requires things that in ChibiOS I intentionally left out and that would hurt performance and/or safety, others things are simply too limiting.
For example:
1) It is meant for Cortex only, ChibiOS (and others before) proved it is possible to have a platform independent API.
2) 7 priority levels, 6 excluding the idle priority, seriously?
3) Functions return error codes. I prefer not having error conditions because safety and in order to not let users in doubt (do I have to handle some errors by calling this?). ChibiOS strives to reduce uncertainty.
4) Thread termination/deletion, allowing such a thing means a system unsafe by design.
5) It allows to change priority of other threads (bad idea if you want to implement priority inheritance or similar mechanisms).
6) I didn't find anything about how to write ISRs, critical section primitives are unspecified.
7) The API is lacking a lot of common functionalities.
8) There are lots on unspecified things, for example the exact behavior of mutexes and other objects, round robin behavior.
9) more...
It also has some things that are interesting but it has evident shortcomings IMHO. Probably writing a Posix-like or OSEK-like API would be a better spent time, anyway, let's see how it evolves.
Giovanni
Re: CMSIS RTOS
Posted: Thu Mar 08, 2012 5:49 pm
by Jacon
Very good points, Giovanni
I also think we should wait and see...
Re: CMSIS RTOS
Posted: Mon Apr 28, 2014 2:26 pm
by AndreR
Hi there,
first of all sorry to bring up such an old thread. Secondly, good job on the OS, I am coming from FreeRTOS and like it so far

I have some libraries, especially USB Host Driver from ST which use the CMSIS RTOS files (cmsis_os.h/c). I really would like to avoid fiddling around in ST's code, so my question:
Is there a cmsis_os.h/c pair for ChibiOS by now? Couldn't find it so far. If anyone has already written it, please share! Otherwise I would need to write them on my own

Re: CMSIS RTOS
Posted: Mon Apr 28, 2014 2:30 pm
by Giovanni
Hi,
It is planned for ChibiOS 3.0, no usable code yet but it is definitely doable.
I am still unimpressed by the CMSIS RTOS design, may be I will write and article about it after writing the code.
Giovanni