Consider an application with a fixed amount of tasks computation per cycle (let's say 100ms) that's usually done with manual scheduling. With 100 sub-cycles of 1ms, knowing and cutting each calculation task into smaller chunks allowing that in sub-cycle n°43, task 102, 103 and 104 will be perform for example.
Everything is under control and determinism is at his peak.
This method induces a lot of work and allows no to really minor evolutions because everything has to be rescheduled in case of a modification in the workflow.
Also, to ensure this kind of beahvior, WCET of each function has to be calculated and a margin is kept in each sub-cycle to ensure that overflow could be countain in a sub-cycle.
On top of that, the newer application requires the need of much longer "algorithms" that will be run across multiple cycles and are not required to be "real time".
The use of a real-time OS (probably FreeRTOS for various reasons) with a preemption scheduling seems appealing because :
- Much more room to modify the "hard real time" part : increasing maintainability;
- Longer computation (low priority) can be done using "margin" kept for "hard real time" part;
- "hard real time" algorithm doesn't have to be cut in small parts
What kind of software architecture or mechanisms can be used to ensure that, using a real time os with preemption, everything that has to be run in a cycle is indeed run during that cycle ? How to ensure the deterministic behavior and how to verify it ?