bbbowden

One of the functions (apps?) that I want to run on the RTOS is a web server. However, I think I read one of your posts that said the Ethernet lib isn't RTOS friendly. I can't find the post again but do I have that right?

arduino2012

Is it possible to use the RTOS you have ported with Atmel Studio?If it is possible do you have any guide of how to do it? Or I just can copy the folder and place it in my project.What I want to do is use Arduino Due with Atmel Studio.

LinuxGuru

Thanks a LOT for so useful contribution! I just come across your work. May I ask you few quick questions?

1) Which Arduino libraries known NOT to work with FreeRTOS, or have timing issues?2) Which Arduino would you recommend to handle 3 step motors (at speed up to 2000 rpm), 2 rotary encoders and 2 magnetic hall sensors with any of RTOS? Probably Arduino Due is a minimum?

Any library that calls delay() or has a wait loop for something to complete will block all lower priority threads.

The ideal way to handle devices with an RTOS is to start an operation in a thread then wait on a semaphore. When the operation completes, an interrupt occurs and the device ISR signals with the semaphore to wake the waiting thread. This means many Arduino libraries need some mods for optimum performance.

The malloc() included with new versions of the Arduino IDE will not work in threads. This is O.K. since dynamic memory is not a good idea in real-time systems after setup.

FreeRTOS uses the most RAM and flash, ChibiOS/RT is smaller, faster, and has more features. Nil RTOS is the smallest but has few features and probably is not appropriate for your system.

Certainly Due is the minimum but I can't guess what you will need.

LinuxGuru

I have an early draft for a software which should control 2 step motors, display data on TM1639, and exchange data via Firmata with Linux PC (3rd feature is not written yet). Currently I have only 1 step motor and TM1638 LED connected, and both work wit conventional Arduino setup.

I took a FreeRTOS example which basically spawns 2 threads, and in my case call of vTaskStartScheduler() hangs Due. I even removed all TM1639 calls, result is still the same.