Why not FreeRTOS?

Hi All,

I see that Ardupilot used Nuttx and ChibiOS, I was wondering about the technical reasons for not selecting FreeRTOS as an option?

1 Like

I suggest you start reading the documentation as a lot of your questions can have proper answer here

https://ardupilot.org/dev/

Hmm, I already had a look on the link and already searched the forum before asking.

I don’t see any technical discssion about RTOS selection or key metrics.

is there any section you want to take my attention to it?

You can follow history on this thread

1 Like

Thanks for the link. I went through it and I could understand that Nuttx has issues with the performance.

so ChibiOS was selected because it has lower load and provide HAL as stated in this post

this is good to know but I thought the team made an intesive study on different RTOS before selecting ChibiOS. uC-OS has very small footprint as well and very short context switching time.

I am not sure about the footprint and context switching time of FreeRTOS but it is ported on many HW, strong support, many tutorials and courses online, intensively used in production… etc

This is an interesting comparaison between nuttx chibios and freertos

https://www.reddit.com/r/embedded/comments/6b8x4t/anyone_did_a_nuttx_chibios_freertos_comparison/

And final word
. If you need a small, fast, deterministic system then ChibiOS is probably the finest open-source RTOS+HAL.

1 Like

Thx, I know about this link.

it is just opinions and didn’t discuss any performance metrics.
The post didn’t mention anything about FreeRTOS. It is just Nuttx and ChibiOS.

1 Like

Anyway… If you feel the need to rewrite ArduPilot HAL under FreeRtos, PR’s are welcome :wink:

2 Likes

At that time, developers use what they were more used to and the plan was to make new boards development easier. At that time Chibios was the the RTOS that fill our needs.

FreeRTOS could fill our needs now but would need a significant developers effort to make a new HAL for it. Nothing is closed, just need people to do it.

3 Likes

Firstly, don’t forget that Ardupilot ESP32 port on development branch already uses FreeRTOS natively. That might be a good place to start to convert ESP32 to more generic FreeRTOS HAL if that is what you wanted to do

I have to mention too that I did a port of ArduPilot to FreeRTOS some years ago, when Ardupilot was using Nuttx as the main operating system. I had already made an OSD on an STM32F4 with FreeRTOS and since at that time Ardupilot still ran on an ATmega2560, I figured that the board was quite capable of running the OSD and Ardupilot, and so it proved:

The board
Discussion about the board
The source code
Discussion of the development process

As to whether it is better or worse than Chibios, my goal was slightly different. I had already used FreeRTOS to write the OSD so enjoyed to write my own peripheral drivers and optimise the code for the particular board and onboard sensors I had and to attach the OSD as a library to Ardupilot code in its own tasks.

On the other hand The Chibios Ardupilot port is more generic, includes many drivers and detects arbitrary external sensors and I was happy to use the Chibios version to get a custom version of Ardupilot working quickly recently.

In favour of FreeRTOS is that I believe it has mature ports on a greater range of hardware.

In favour of Chibios is that it is possibly better optimised for the STM32 ? There are quite a few ports but maybe not as mature as FreeRTOS

Another Interesting RTOS is Zephyr of course.

3 Likes

Thanks for this inputs ! I was sur that somebody already used freertos in the past.