Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RTOS vs Traditional Firmware Coding

I'm fairly new to the embedded world. I have a little bit of experience on coding firmware for the ARM M0+ based freescale microprocessor. I am current working on a new project using the CML-5282 development board (M5282LITE) and it comes with RTXC Quadros RTOS. I was wondering what is the difference between RTOS and just coding in codewarrior IDE. Do they coexist and RTOS just ease the scheduling? Or can you replace the IDE with RTOS all together? I don't have an idea what RTOS is, please give me any insight I'd appreciate it.

like image 615
user2951012 Avatar asked Feb 12 '26 20:02

user2951012


2 Answers

The main difference is the ability of doing multitasking: run more tasks in parallel. This is done by the scheduler, which is the core of the operating system. Since it is a real-time operating system (RTOS) tasks can be scheduled according to some real-time scheduling agorithm. The most popular is fixed priority (i.e., tasks have a static priority and the scheduler always run the task at highest priority).

Pros of RTOS:

  • You can split your application into several tasks that are run concurrently
  • Some drivers can be already available and accessible through standard APIs

Cons of RTOS:

  • Some overhead due to context switch
  • More complex debugging (due to race conditions on resources shared among tasks)
like image 91
Claudio Avatar answered Feb 16 '26 01:02

Claudio


Different RTOS vary in size and features, but fundamentally an RTOS provides scheduling (typically priority based pre-emptive scheduling) of tasks or threads, synchronisation mechanisms, timers, and interprocess communication.

A typical RTOS is provided as a static link library that you link with your application just like any other library. An IDE is a different thing altogether, although in some cases you get some integration of the RTOS with the IDE with run-time debug tools and (less commonly) thread-level debugging.

You might check out Jack Ganssle's Fundamentals of Real-time Operating Systems course. It uses uC/OS-II in the examples but is fairly generic and the principles apply.

like image 30
Clifford Avatar answered Feb 16 '26 02:02

Clifford