CMSIS RTOS

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
AndreR
Posts: 24
Joined: Mon Apr 28, 2014 2:01 pm

Re: CMSIS RTOS

Post 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.
Attachments
cmsis_os.zip
(12.29 KiB) Downloaded 527 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CMSIS RTOS

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CMSIS RTOS

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CMSIS RTOS

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CMSIS RTOS

Post 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
littlekoala
Posts: 8
Joined: Wed Jan 08, 2014 5:15 pm

Re: CMSIS RTOS

Post by littlekoala »

Hi,

Is there any example with USB Host? this would be really helpful.

Cahya
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CMSIS RTOS

Post by Giovanni »

Hi,

I don't have such an example.

Giovanni
Post Reply