Porting FreeRTOS to Arduino Mega2560 – Anyone Tried?

Hi all,

I’ve read that it’s possible to run FreeRTOS on an Arduino Mega2560, But I can’t find a clear, step-by-step guide on how to actually port.

I’m not building a full project just curious to explore FreeRTOS tasks, queues, Mutex and semaphores on Arduino Mega2560 and see how it works

anyone here tried it?

Where did you see this ?

Why on Mega?
why not to probe RTOS in a MCU, that uses it from a box, from example on ESP32?

Doesn’t this link say https://docs.arduino.cc/libraries/freertos/

Because I already have a Mega on hand

Yes, it does say that FreeRTOS can be run on a Mega but how was I to know where you had seen that advice ?

Why not install the library, which is available from the IDE Library Manager, and try the examples yourself

Thanks. I’ve installed the library and ran the example code for task status. The LED blinked as expected, and on the Serial Monitor I only get “Suspend!” and “Resume!” when I send the respective commands.

With the limited resources of the Mega use of FreeRTOS is more of a demo and “because we can”.

If you want to seriously explore the capabilities I would suggest an ESP32 or Raspberry Pi Pico for about the same price as a Mega. They have much more powerful processors, more memory, and higher clock speeds. They also have dual cores so you experience why synchronization is important.

I'd say it's just as important on a single core processor when time sliced multi-tasking in involved.

Of course it is important when multitasking on a single processor. But with a singe processor there are things you can get away with because only one task is running at a time. Some operations that are relatively atomic on a single core may not be with multiple cores.

EDIT:
If you are using the FreeRTOS support you should be OK. It is when you try to get fancy with your own sync attempts you need to be careful.