RTOS uC / Micro-processor

Thread Starter

MikeJacobs

Joined Dec 7, 2019
226
Ok, I am going to go out on limb and ask this question.

If you look up what a uC is, you will find in numerous locations that a uC does not have an OS. They simply have a setup and loop. Boom done.
Its an IC that has all of its needed hardware on a single chip and off we go. They also generally cant use an OS anyway due to limited on chip available ram/rom

When I think RTOS I think of an OS designed to be on something like an actual microprocessor like an intel I5 or something. A CPU that is in fact designed to use an OS.

So here is the question, if uC do not need OS-es, then why the heck are most commercially available RTOS designed to run on a uC. For example, the freertos.org site under compatible hardware lists rows of uC but no microprocessors...

Can someone explain this?
Thanks
 

MrChips

Joined Oct 2, 2009
30,712
Semantics

uP - microprocessor. At the core of any computer design is the uP. The design and implementation of the uP evolved from discrete components, integrated circuits, and single chip uP. Complex uPs require a lot of real estate and require many external components to create a complete computer design.

uC - microcontroller began as small, low cost, single chip computers with built-in peripherals and memory. uCs span a very wide range from low functioning controllers to highly sophisticated computers such as raspberryPi.
MCU - microcontroller unit is another acronym for uC. Many modern MCUs have enough memory to run RTOS.

OS - Operating System, supervisory program to manage various tasks demanded by the application.
RTOS - Real Time Operating System. In reality there is no such thing as real time. In practice, real time means having a response time between input and output that is adequate for the application.

Now to answer your question, every working MCU application is an OS. The extent and capabilities of the OS is a matter of definition. An OS can be a collection of low-level drivers, library functions, time and task handlers, I/O handlers, memory management, etc. One can create their own OS or use a third-party OS.

OS can be written for any size MCU. MCUs come in many flavors with less than 1kB memory to more than 1MB memory.
Yes, commercial OS generally require uP or MCUs with large memory space. Many ARM MCUs have enough memory to run RTOS.
 

trebla

Joined Jun 29, 2019
542
So here is the question, if uC do not need OS-es, then why the heck are most commercially available RTOS designed to run on a uC. For example, the freertos.org site under compatible hardware lists rows of uC but no microprocessors
If a system must run only few tasks on regular basis then probably there is no need for RTOS. If the system must run many tasks with different priorities and resource needs then probably RTOS based software works better (is more manageable).
As @MrChips wrote, different RTOSes are for different memory sizes. There are also some RTOSes for MPU basesed systems available, for example RMX for Intel CPU based systems, i remember the Siemens Hicom 3xx phone exchange computing unit uses RMX.
 

Ya’akov

Joined Jan 27, 2019
9,071
With the availability of FreeRTOS, written with MCUs as the target, and its official support by companies like Espressif to help leverage their multicore ESP32 MCUs, RTOS on an MCU is just business as usual.

One of the problems solved by an RTOS is having to deal with “yielding” or other strategies to share CPU with time critical sections of a program. If you don’t use an RTOS you have to duplicate its functionality, which is a pain and usually not very efficient. With the RTOS you can program as if you are the only process on the system and use a second core for the time critical sections knowing they will get enough CPU, soon enough, not to die.
 

Thread Starter

MikeJacobs

Joined Dec 7, 2019
226
Appreciate all the replies
I think your answers yield more questions.

when we change the playing Field and now say that a uC has enough ram to run an OS then now the question arises again of what is the difference between a uC and uP with new uC having enough ram to run an OS?
Since previously the defining factor was a uC doesn’t typically run an OS because of program storage size limitations and ram limitations.
If that is no longer true that what is the difference between them
 

MrChips

Joined Oct 2, 2009
30,712
Appreciate all the replies
I think your answers yield more questions.

when we change the playing Field and now say that a uC has enough ram to run an OS then now the question arises again of what is the difference between a uC and uP with new uC having enough ram to run an OS?
Since previously the defining factor was a uC doesn’t typically run an OS because of program storage size limitations and ram limitations.
If that is no longer true that what is the difference between them
uP generally has a lot of computing power but no on-board memory and peripherals
uC is a single chip computer with the desirable amount of memory and peripherals on the chip to get the job done. An MCU is normally employed to get one job accomplish. It is unlike a desktop computer that has many diverse apps on the go at the same time.
 

Irving

Joined Jan 30, 2016
3,845
Two of the big differences are traditionally,
a uP eg 8086, etc was a CISC machine and a uC was a RISC.​
a uP has complex memory management, paging, etc, and uC has flat memory space.​

Of course that's been blurred over the years.
 

Ya’akov

Joined Jan 27, 2019
9,071
I think the key is that an MCU, being a controller has both a CPU and hardware to do a lot of high level communications and specialized operations like encryption. The microprocessor, on the other hand, is just the CPU. So as stated above, an MCU IS a microprocessor plus peripherals and memory that make it ready to go in the controller role without adding outboard hardware.

An MCU is designed to be the brains of something that needs computer control, the microprocessor is just a smaller version of a CPU designed for low bandwidth, low power operation ((named in the past, they are now exceedingly capable and power hungry microprocessors with more capacity than the “big” CPUs of the day could dream oF).
 

nsaspook

Joined Aug 27, 2009
13,086
Most of the 32-bit controllers that would be a good candidate for complex memory management, paging because it has the hardware. A RTOS typically doesn't use VM related MMU/MPU as a default option because per process VM type protection is costly in terms of cycles even on a high-end controller and is unnecessary on the vast number of controller level projects. If you only have flat address space and process scope then the rational for using a RTOS just becomes a matter of choice, not a operational requirement.

https://www.freertos.org/FreeRTOS-MPU-memory-protection-unit.html

https://docs.espressif.com/projects/esp-idf/en/v4.4-beta1/esp32/api-guides/freertos-smp.html
 
Top