Good day,
I have a custom designed Arduino Due board driven by the Arduino Framework.
As my application has grown, I am thinking about switching the framework.
The main point is, that the Arduino framework has no threading capability.
On the other hand, there a plenty of libraries available for Arduino framework and it would be hard to re-build them all.
Currently I am using a timer based implementation as non-blocking approach.
I noticed, that PlatformIO does support Simba or Zephyr, but I am not completely sure what consequences a switch would cause.
Is the SAM3X8E compatible with one of these RTOS?
I also saw, that there are some Arduino libraries (HeliOS, FreeRTOS for Android) are out there, which introduces tasks. Would that be a valid approach to get the best from both world?
I can use the Arduino libraries and also get tasks? Could you recommend one of such libraries?
I also thought about switching the whole platform from Arduino to STM32. That said, then also the question raises to witch platform I should switch.
Technically speaking, this could be the best approach, but unfortunately also the most expensive approach. That’s why I would probably not got for that.
You see, I am not quite sure where to go and I would love to get your thoughts and guidance on that …
Best
Nobody here who can give me some guidance?
Are you still looking for advice here?
I’m only just aware of Helios, but it has a library for use with PlatformIO (add lib_deps = mannypeterson/HeliOS @ ^0.2.6
to your platformio.ini
) .
While it works fine with framework = arduino
(my board is an Uno, not a Due) I don’t want to be using the Arduino Language and it’s not finding its various header files when I remove the framework
line. A minor problem that I’m looking into at the moment. 
However, it shows promise. The obligatory Uno blink sketch, using HeliOS, takes:
RAM: [= ] 11.8% (used 242 bytes from 2048 bytes)
Flash: [= ] 7.1% (used 2302 bytes from 32256 bytes)
So it’s a bit bigger than the default blink sketch which is 9 bytes of RAM and 924 bytes of Flash, but I suspect as the applications gets more complex, the overheads will diminish.
Sorry I’m not able to give you much more information at this time, but watch this space!
Some Arduino Language examples are at HeliOS/examples at master · MannyPeterson/HeliOS · GitHub if that is of any use?
Cheers,
Norm.
Hallo Norm,
thanks for your reply.
I am in fact still interested in this topic.
As I said in my first post, I started with the arudino framework and as the projects grows, I am wondering if there is a better solution. That said, I cannot change the hardware that easy.
When you say, you’re only familiar with HeliOS, it’s not the Arduino library, is it?
I am not aware, that it’s a standalone framework. I guess, that the shown overhead is constant. In a bigger project HeliOS is still the same size than in the minimalistic blink sketch.
The HeliOS library for Arduino has the advantage, that I do not have to change any library. It’s just an addition to the Arduino Framework.
Again, thanks for your impressions!
Hope to see more answers and guidance … 
Best,
caldi
Hi @caldicot,
I’m just getting started with HeliOS and I’ve found that it is Arduino specifc when used on an AVR microcontroller.
It expects to see at least one #define
at compile time which is for a #define
created by the Arduino IDE. If found it will then #include "Arduino.h"
otherwise, it will throw an error.
Until I rewrite it
it can only run under framework = arduino
.
So far, it looks to be ok. It does have a limit on the number of tasks it can control though. There’s an open issue on Github on the matter. 8 seems to be the limit but I’m sure a quick edit in either HeliOS.h
or task.h
will fix that. Arduino memory limits allowing of course.
I shall persevere, wife and/or Christmas allowing, as it looks very interesting.
Another interesting one is written about at Don't Delay() Use an Arduino Task Scheduler Today! - Hackster.io.
Disclaimer: I have a pull request open to fix a problem when millis()
rollsover from 0xffffffff to 0x00000000 but I’m not sure if Kevin has merged it yet. Read the comments on the article for details.
I might revisit this one too, to see if I can get it working in AVR C/C++ code under PlatformIO.
Have fun.
Cheers,
Norm.