Go Down

Topic: ArdOS: The Arduino Operating System. Now for the Arduino IDE! (Read 5924 times) previous topic - next topic


Hi all,

A while back I released the original version of ArdOS that was really meant to be compiled using Atmel Studio 6. Today I am proud to introduce the latest version of ArdOS that was re-written for use within the Arduino IDE. :D

ArdOS is now available at https://bitbucket.org/ctank/ardos-ide. You can download the ZIP file (includes quick start guide and reference guide) directly from https://bitbucket.org/ctank/ardos-ide/downloads.

The following changes were made:

- 100% support for Arduino libraries. All the features that you love like Serial, attachInterrupt, etc are now accessible in ArdOS.
- You can now bring ArdOS into the Arduino IDE through Sketch->Import Library->Add Library (on Arduino 1.0.5 onwards) or by unzipping the ZIP file into the libraries directory.
- Examples accessible through File->Examples->ArdOS.
- Much better documentation.
- Greatly simplified configuration. By default all components of ArdOS will be compiled in, but you can edit the kernel.h file to exclude components.
- Simplified task creation. Task stacks are automatically created for you.
- Stack sizes for each task can now be set at run-time.
- The number of tasks can now also be set at run-time, albeit only when ArdOS is initialized. However this means no more fiddling with the ArdOS header files to set the number of tasks.
- Now supports boards based on the ATmega168, ATmega328, ATmega1280 and ATmega2560.
- Now supports analog output on all PWM pins.

ArdOS features:

- A compact and configurable kernel.
- Prioritized scheduling for hard real-time tasks.
- Binary and counting semaphores.
- Mutex locks and conditional variables.
- First-in-first out and prioritized message queues.

Do take ArdOS out for a spin and let me know your thoughts!

Best regards,


Sounds pretty cool, you think I can monitor one analog pin with this while I report in low priority some values thru ethernet? Right now I have to stop the monitoring for few seconds every couple minutes (asking before testing anything, I tried some different similar approaches in the past, but ethernet never worked properly)
My website: http://ried.cl


Sounds pretty cool, you think I can monitor one analog pin with this while I report in low priority some values thru ethernet? Right now I have to stop the monitoring for few seconds every couple minutes (asking before testing anything, I tried some different similar approaches in the past, but ethernet never worked properly)

Hi Eried,

Sorry for this late reply. For the moment I don't have Ethernet support, but that's definitely something good to add in once I get an Ethernet shield.

Thanks again for your input!


Jun 27, 2013, 09:48 am Last Edit: Jun 27, 2013, 10:45 am by cengav4r Reason: 1
I downloaded and tried example.It works properly, I try to figure out codes (what is going on).Then I will try drive multiple (2 or more) servos simultaneosly.
Thanks for sharing


Thanks cegav4r! Please do let me know how it turns out.


@ctank - this is excellent and well-timed for me. At the moment, I am playing around (since last night) with NilRTOS (from author of ChibiOS/RT ported by Bill), and after downloading ArdOS and going thru it's quick-start and reference manual, I can see how easy it looks.

Do you have any figures on flash and RAM use of code using ArdOS using various features/combinations ?
Secondly, do you have any plans of supporting ArdOS on some of the ATtiny AVRs like tiny84/85/86x ? They do have some limitations (usually fewer peripherals, pins etc.) but still excellent for ultra low-cost projects.


in the future do you support ' ATMEGA32U4 ' ?

Hi everybody. Thanks for your help and work. Greatly appreciated.

ArdOS mutlitasking is the way to do things but I guess there are limitations or there is something wrong with my code.

Still, I have tried a direct (loop) program and then convert it to a Task. So the logic is first tested, as much as possible, as a single serial program.

The problem is a single task routine that uses the standard OneWire and Dallas library.
Code: [Select]

void setup()

void temperature( void *p)

    while (true)

As stated, when run in the loop() routine temperature is perfectly printed.

As a task, "prereq" and "req" are printed but not the temperature. The led in the 3p with a DS18B20 turns on when in loop() mode but not as a task. Also using the long OneWire method confirms the DS18B20

Anything i can do/try? Thanks.



Sep 09, 2013, 10:48 am Last Edit: Sep 09, 2013, 10:52 am by leo72 Reason: 1
I've tried to... try the RTOS but I wasn't able to compile any of the test sketches.
I always get this error:
Code: [Select]

/home/leo/sketchbook/libraries/ArdOS/kernel.cpp: In function 'void OSSwap()':
/home/leo/sketchbook/libraries/ArdOS/kernel.cpp:363:20: error: local frame unavailable (naked function?)
/home/leo/sketchbook/libraries/ArdOS/kernel.cpp:363: confused by earlier errors, bailing out

I'm using Arduino IDE 1.0.5 with Atmel toolchain 3.4.2 (not the original one that comes with Arduino). I compile on Linux.

if I use the toolchain provided by the IDE, it compiles correctly. So there's something in your kernel code that isn't compatible with the newer toolchains. You should look at this because, as you should know, the IDE toolchain is too old and has a bug for that it cannot compile working firmwares bigger than 128 kB.


It seems that it doesn't want the inline function OSMakeAtomic.
But if I substitute all the calls to OSMakeAtomic with its code, the IDE compiles the examples but simply they don't work at all.... I am able to get a working example only if I use the old toolchain that comes with the Arduino IDE.
May during the time something in the naked ISR management has changed...

Colin Tan

Sorry all for this horribly late reply! I've been monitoring the ardos-help account for questions but only recently looked at this forum. It's 1 am now but I will reply to all of you tomorrow.

Sorry again for his late response!



Thanks for letting me know that ArdOS does not compile on the newer toolchains. It's probably because several of the functions are declared to be naked (to guarantee stack correctness). I'll need to look into this.

As for Serial shenanigans, try inserting a delay between calls to Serial.println. I'm having some issues with getting the ArdOS to play nice with Serial. ArdOS seems to sometimes cause the serial buffers to overrun. At the moment short of moderating traffic to the Serial libraries, I don't yet have a way to solve this problem.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131