New version of ChibiOS/RT with coop scheduling example

Status
Not open for further replies.

Bill Greiman

Well-known member
I have posted a version of ChibiOS/RT for Teensy 3.0, AVR boards, and Due as ChibiOSBeta20121212.zip http://code.google.com/p/beta-lib/downloads/list.

It is easy to use this version in cooperative mode.
Setting this mode disables preemption for threads with equal priority and round robin becomes cooperative. Note that higher priority threads can still preempt, the kernel is always preemptive.

This allows using cooperative scheduling for the bulk of an application to avoid pitfalls of preemptive scheduling and still have a high priority time critical thread.
 
Hi Bill,

looks very interresting as you chibiOS can mix both concepts.
you might consider providing some wraper or macro to make task and stack declaration easier for noob or beginers. as soon as I have some spare time, I ll play with your version and see if I can wrap something with the same keywords I used in SCoop.
 
The best wrapper for ChibiOS is CMSIS RTOS. I probably will do that unless a version of ChibiOS/RT with it is done soon. Giovanni Di Sirio said he plans to support that API.

I already found it for FreeRTOS. Many commercial products comply with the CMSIS RTOS API standard.

A standard is really valuable for an OS, POSIX saved Unix/Linux. Inventing a new RTOS API is a loser.

You can download the version 3 CMSIS standard from arm.org or look at this if it is still on the web.

http://mazsola.iit.uni-miskolc.hu/DATA/segedletek/arm/cmsis/CMSIS/Documentation/RTOS/html/index.html

Another disadvantage of yet another wrapper for existing RTOSs is that many, such as FreeRTOS, have great documentation and examples. I suspect this will also be true of CMSIS RTOS since many companies will provide complaint products.
 
Last edited:
Hi Bill,
I just downloaeded the fix version 17 december and now examples have a compile error on teensy++20. but it works on arduino uno and teensy3 (I m on 1.02 beta8).
here is the error I get.
c:/arduino-1.0.2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr51\libc.a(malloc.o): In function `malloc':
(.text+0x0): multiple definition of `malloc'
core.a(malloc.c.o):C:\arduino-1.0.2\hardware\teensy\cores\teensy/malloc.c:82: first defined here
c:/arduino-1.0.2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
c:/arduino-1.0.2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr51\libc.a(malloc.o): In function `free':
(.text+0x154): multiple definition of `free'
core.a(malloc.c.o):C:\arduino-1.0.2\hardware\teensy\cores\teensy/malloc.c:194: first defined here

maybe this comes from my setup, but I doubt as everything else works fine on teensy++2.
 
Paul put his own version of malloc() in the Teensy core and there is another version in the Teensy avr libc.a.

I use features of the avr libc malloc() that causes an attempt to load both.

I may try to fix the problem but it is low priority, I don't have a Teensy++ 2.0.

Edit: I think I have a fix so I will post it in hope that it works. At least it links now with no duplicate malloc.

I also found problems with Teensy and the SdFat examples. I will wait until Paul has a solution to the Teensy 3.0 SPI problem and then post fixes to these problems.

The Teensy malloc will not work with RTOSes so I will not be posting updates.
http://arduino.cc/forum/index.php/topic,138392.0.html
 
Last edited:
Status
Not open for further replies.
Back
Top