The best RTOS ?

Hello there, i want to use the best RTOS system on arduino , i find a lot of theme, actualy i'm starting with ChibiOS i did some complexe application. but i want to know if ChibiOS is it the best RTOS on embedded application is it safe ?? works well ?? i ant your advises Thanks

Just curious, which arduino did you use?

Arduino uno

Why do you need an RTOS on the UNO?

Arduino uno

Well, they do list AVR as a supported architecture.

How much code space did you have for your application?

If you installed this system on an UNO, I think you are capable of
figuring out the “best” RTOS. I doubt many people have tried any
RTOS on a UNO…

LarryD i need RTOS becase my application is not for blinkinh led :smiley: or driving a motor. i did a PID and the OS should be RTOS. lot of functions works in the same time in my application and we should to be carful for sharing data ,so we should work with an RTOS (shared memory, mutex, semaphore…etc).

boolrules. i finished my application and i take 60% from the global memory. i want to know if chibiOS is safe or not. because my application is a HARD REAL TIME smal error will cause big dammage on a system. not just a blinking leds haha ^^

jone31: LarryD i need RTOS becase my application is not for blinkinh led :D or driving a motor. i did a PID and the OS should be RTOS. lot of functions works in the same time in my application and we should to be carful for sharing data ,so we should work with an RTOS (shared memory, mutex, semaphore..etc).

boolrules. i finished my application and i take 60% from the global memory. i want to know if chibiOS is safe or not. because my application is a HARD REAL TIME smal error will cause big dammage on a system. not just a blinking leds haha ^^

My current project is doing motion control on three axes, running three PIDs as servos driving DC motors and encoders, plus a Ethernet, a webserver, three serial ports, two USB connections, an SD card, EEPROM, and tons of other devices. All running on a Due with NO RTOS. If you think you NEED and RTOS, you're almost certainly wrong. All you need is a goof system architecture.

Regards, Ray L.

RayLivingston: All you need is a goof system architecture.

I'm not quite familiar with that one.

ChibiOS is pretty well-known. Whether it is "best" for a particular application is application-dependent. Whether it works AT ALL for a particular application with "lots of tasks" on a chip as small as the ATmega328 is ... questionable. And of course, an AVR has no memory protection of any kind, so your "careful sharing of data" is all on you.

The other commonly-mentioned RTOS that will run on something Uno-sized is FreeRTOS.

aarg: I'm not quite familiar with that one.

Info here but I'm not sure they mention RTOS. :P

Quote from: RayLivingston on Today at 12:04 am

All you need is a goof system architecture.

I'm not quite familiar with that one.

I taught him everything he knows.

@RayLivingston i'am engineer in embedded system. and i developped several embedded applicatons. what you did is not real time hard. in real time hard we d'ont use the SPI,SDCARD ...ETC ;) and i'm sur your data will be mixed :D. if you work with microseconds. i think you have no information about thread and the shared memory critical zone.

@westfw my application is hard real time and i will neo embedd arduino, i ill embed just the atmega in my own board ;)

Well, if you're an embedded systems engineer, then you should know that coming on a basically hobbyist forum and asking for "the best RTOS" is a terribly way to solve your problem. Every RTOS has it's advantages, and disadvantages, and only YOU could possibly know which are important in YOUR application. The only way to get the answer you need is to spend a lot of time studying the options, deciding which appears best-suited to your application, then installing and testing it. Anything else is just a waste of time.

Regards, Ray L.

RayLivingston: The only way to get the answer you need is to spend a lot of time studying the options, deciding which appears best-suited to your application, then installing and testing it. Anything else is just a waste of time.

And when you have it figured out, come back and tell us.

...R

jone31: i want to know if chibiOS is safe or not.

How "safe" can you calculate the amount of RAM, which will be used by the stack of each thread?

The biggest risks on using an OS on a controller with just 2048 bytes of RAM is explained here: http://www.chibios.org/dokuwiki/doku.php?id=chibios:kb:stacks

Instead of having just one stack (controller programmed without using an operating system) you will have to deal with a higher number of different stacks in the RAM when using such an OS: - C runtime stack - Interrupt Stack - Thread Stack (one stack for each thread) You have to provide enough stack size for each of those stacks, but without busting the total amount of RAM. The stack size decisions for each thread have to be done before compiling the application. The stack sizes are fixed at runtime.

If you calculate wrong (just by one byte), how much stack memory your threads might use (worst case), your program will run into stack overflows during runtime of the program. And in case a "stack overflow" occurs, it is not predictable what will happen in your application. Most likely everything is coming to a standstill, after a return address from a function call is corrupted.

@RayLivingston i think that i can find personnes that had experience en RTOS on ardino this is why i asked a question to have a quick answer , but the terribly thing is there are persones like you, copy and past code from internet. and you think you coding well. i give you a smal exercice : if you have a variable that 3 functions want to use it and computing of the variable don't take more than 200US!!!!!! how to solve this probles ??? doing copy and past from codes found on internet. i wait for your answer MR bill gates.

jone31: i give you a smal exercice : if you have a variable that 3 functions want to use it and computing of the variable don't take more than 200US!!!!!! how to solve this probles ???

myVariable = 12; (or whatever value)

mysecondVariable =  myVariable;
mythirdVariable = myVariable;
myfourthVariable = myVariable;

Or perhaps you need a clearer description of the problem you are trying to solve ?

...R

i solve my program, and you didn’t understand the exercice. i told you if all those 3 functions acess to the variable in the same time. the functions works paralels

I didn't even understand the question, far less the "answer"

jone31: the functions works paralels

Not on an Atmega 328 they don't.

Things are arranged so that it appears like that (old magician's trick).

...R