Page 2 of 2
Re: CMSIS RTOS
Posted: Wed May 14, 2014 10:21 am
by AndreR
I tried to start with the cmsis_os files and attached them (originally from FreeRTOS).
They are neither complete nor perfect, but at least they work with the USB Host library from ST, which was my primary goal. Maybe someone finds them useful
They use chHeapAlloc for most stuff (CMSIS isn't really great at static things, or I did not find out the best way yet). So make sure your heap works.
Re: CMSIS RTOS
Posted: Wed May 14, 2014 10:26 am
by Giovanni
Great, thanks for sharing, I wanted to add a CMSIS RTOS "skin" in 3.0 and this will help for sure. Being able to use USB host is a huge bonus.
Giovanni
Re: CMSIS RTOS
Posted: Sun Oct 05, 2014 1:08 pm
by Giovanni
Hi,
News about this, I am trying to integrate it into the 3.0 version.
The plan is to implement enough of CMSIS to support the ST HAL, I am not that interested in the API itself because it isn't that great.
I am thinking in make it work in two modes:
1) Standalone mode, where you work with a CMSIS RTOS and ChibiOS/RT is not necessarily visible.
2) Thin mode where there is just enough API to support HALs but the rest of the application uses the RT API.
Giovanni
Re: CMSIS RTOS
Posted: Mon Oct 06, 2014 2:26 pm
by Giovanni
I committed an initial version supporting: threads, signals, timers, semaphores, mutexes.
It is located under
./os/rt/ports/ARMCMx/cmsis_os, any help with testing would be very welcome

Messages, mail and pools could be implemented too easily enough.
Non-conformance:
1) Threads cannot be deleted because it is a dumb thing to do and ChibiOS discourages unsafe features. The thread is flagged instead using chThdTerminate() but it must be written to detect the condition and exit.
2) osWait() not implemented yet.
Sadly the thing requires dynamic allocation for threads and there is no workaround for this because how the thing is designed, all other objects use safer pools.
Giovanni
Re: CMSIS RTOS
Posted: Tue Oct 07, 2014 2:04 pm
by Giovanni
Messages and pools added as well.
I added a demo for the STM32F4-Discovery as an integration example, in the demo there is the CMSIS RTOS working with the ChibiOS HAL. Using CMSIS RTOS just requires 2 extra lines in the makefile and a main.c written using the CMSIS RTOS API, see the example.
It would be helpful testing the stack with external software in order to find bugs, implementation differences (there is not a formal specification) and possible conflicts.
The two remaining open points are the Mail mechanism and the osWait() API which should pose no problems.
Giovanni
Re: CMSIS RTOS
Posted: Thu Dec 11, 2014 12:53 pm
by littlekoala
Hi,
Is there any example with USB Host? this would be really helpful.
Cahya
Re: CMSIS RTOS
Posted: Thu Dec 11, 2014 1:54 pm
by Giovanni
Hi,
I don't have such an example.
Giovanni