mbed RTOS

16 Feb 2012

We've just published an alpha version of an official RTOS for mbed!

There has always been demand for an RTOS, but it was never obvious what to choose. The latest version of CMSIS is introducing a new CMSIS-RTOS API aiming to provide a standardized interface to existing RTOS kernels, so we have been able to build it on this to give the most flexibility in the future.

The provisional API documentation and examples are available on a new mbed RTOS handbook page:

To add the RTOS library directly to your project, you can import the following URL:

Please have a play, and tell us how you get on. Any feedback would be very useful as we work towards an official beta release.

28 Apr 2012

rationale for not choosing FreeRTOS over proprietary RTX and with its 7 task config limit?

Very good initiative !

I am now testing it, and I tried the following code that blinks two leds:

#include "mbed.h"
#include "rtos.h"

DigitalOut led1(LED1);
DigitalOut led2(LED2);


Mutex stdio_mutex; 

void led2_thread(void const *argument) {
    while (true) {
        stdio_mutex.lock();
        led2 = !led2;
        Thread::wait(1000);
        stdio_mutex.unlock();
    }
}

void led1_thread(void const *argument) {
    while (true) {
        stdio_mutex.lock();
        led1 = !led1;
        Thread::wait(1000);
        stdio_mutex.unlock();
    }
}

int main() {
    Thread Hthread1(led1_thread);
    Thread Hthread2(led2_thread);
    
    while (true) 
    {
    }
}

And the result is two blinking leds flashing at the same time synchronously !? I expected two leds blinking in an alternate way... What is wrong?

Thaks in advance, Manel

Solved in the newest RTOS lib revision ! 
02 Feb 2014

Hi, Do you have an ETA on FreeRTOS glue layer? Richard Barry from Real Time Engineers Ltd said that they would release an extension for both FreeRTOS and SafeRTOS but no ETA.

http://www.arm.com/about/newsroom/arm-extends-cmsis-with-rtos-api-and-system-view-description.php

There's an unofficial releases by FiFi-SDR but I am looking for official support by either mbed or Real Time Engineers Ltd:

http://o28.sischa.net/fifisdr/trac/browser/branches/fifisdr-pdl/pdl/libs/rtos/FreeRTOS-7.1.0?rev=369#src/portable/GCC/ARM_CM3

Thanks uCFreak