ftRTOS 0.1 review
DownloadftRTOS is another free and small realtime kernel for microcontrollers focused on minimal RAM usage
|
|
ftRTOS is another free and small realtime kernel for microcontrollers focused on minimal RAM usage. The "ft" prefix means femto, the next order after nano and pico.
Primarily this kernel is intended for MSP430 family of microcontrollers. Porting to another architectures is quite simple but on some architectures performance may degrade.
The source code is written in pure C. The preference is given to GCC as free software should be compiled with a free compiler. Assembly language is used only where it is unavoidable.
Here are some key features of "ftRTOS":
Minimal use of RAM. For example, on MSP430 in minimalistic configuration it is required only 6 bytes of RAM per task not including stack.
Static definition of tasks and protected shared objects.
Multiple levels of priority, fixed priority scheduling. By design, the number of levels is limited by the maximum number that unsigned char data type can hold.
Preemptive or cooperative scheduling policy.
Unlimited number of tasks by design.
No idle task.
Simplicity and clarity as a design philosophy.
Two approaches are used to achieve the main design goal: 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. Without dynamic memory management it is impossible to dynamically create tasks and synchronization objects (more precisely, protected shared objects, PSO). But for tiny systems it is not a key feature. So, all tasks and PSOs are defined at compile time.
Splitting structures that describe tasks and PSO means that they have constant (ROMable) and variable parts. The first one contains static properties, such as priority, address of entry point, address of stack, etc. The variable part is placed in RAM and contains only those properties that require changes at run time.
It is necessary to note that such division requires frequent access to the flash/ROM and on some architectures it may lead to performance degradation. For example in AVR family the access to the flash memory is very painful.
The simplicity of kernel as a design philosophy obliges to implement only minimal set of functions and only those which are absolutely necessary. There's only one global critical section which disables context switching. There are no functions to suspend and resume tasks (their appearance in user code tells that something wrong in software design). Only one type of PSO, namely queue, is used for communications between tasks.
However, sticking to minimalistic design leads to inflexibility. Therefore in addition to minimalistic design a list-based design has been implemented. The user can choose either. The differences and features will be explained later. Generally, list-based design increases the size of variable part of task structure (on MSP430 it becomes 12 bytes) but allows several waiting tasks on each side of PSO, the priority inversion problem is handled (the user's choice) and other types of PSO may be implemented.
ftRTOS 0.1 search tags