ftRTOS is a compact and free real-time operating system designed for microcontrollers with a focus on utilizing minimal RAM.
The source code for ftRTOS is written in pure C, and the preference is given to GCC as free software should be compiled with a free compiler. Assembly language is used only where it is absolutely necessary. One of the key features of ftRTOS is its minimal use of RAM. For example, on MSP430 in minimalistic configuration, it is required only 6 bytes of RAM per task not including stack.
ftRTOS also offers static definition of tasks and protected shared objects as well as multiple levels of priority and fixed priority scheduling. The number of levels is limited by the maximum number that unsigned char data type can hold. You can also choose between preemptive or cooperative scheduling policy. There is no limit on the number of tasks that can be performed, and there is no idle task.
The design philosophy of ftRTOS emphasizes simplicity and clarity. To achieve this main design goal, two approaches are used: avoiding dynamic memory management and splitting all structures into two parts. Dynamic memory management adds overhead to all memory blocks and requires some additional code. For tiny systems, it is not a key feature. Therefore, all tasks and PSOs are defined at compile time.
Splitting structures that describe tasks and PSO means that they have constant (ROM-able) and variable parts. The first one contains static properties such as priority, address of entry point, address of the stack, etc. The variable part is placed in RAM and contains only those properties that require changes at runtime. It is important to note that such division requires frequent access to flash/ROM and on some architectures, it may lead to performance degradation.
ftRTOS also offers a list-based design that increases the size of the variable part of the task structure (on MSP430, it becomes 12 bytes) but allows several waiting tasks on each side of PSO. It handles priority inversion problems and permits the implementation of other types of PSO.
Overall, ftRTOS is a powerful and easy-to-use realtime kernel that is well-suited for microcontroller applications. If you are looking for a simple and efficient solution for your project, give it a try.
Version 0.1: N/A