• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microcontroller Tips

Microcontroller engineering resources, new microcontroller products and electronics engineering news

  • Products
    • 8-bit
    • 16-bit
    • 32-bit
    • 64-bit
  • Applications
    • 5G
    • Automotive
    • Connectivity
    • Consumer Electronics
    • EV Engineering
    • Industrial
    • IoT
    • Medical
    • Security
    • Telecommunications
    • Wearables
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • EE Training Days
    • FAQs
    • Learning Center
    • Tech Toolboxes
    • Webinars/Digital Events
  • Resources
    • Design Guide Library
    • DesignFast
    • LEAP Awards
    • Podcasts
    • White Papers
  • Videos
    • EE Videos & Interviews
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

Three RTOS basics: What, when and how

January 8, 2020 By Majeed Ahmad 1 Comment

While real-time operating system (RTOS) software is becoming a key feature in the out-of-box support for embedded systems built around MCUs, the overall concept of RTOS is still muddy for many design engineers.

So, here is the when and why RTOS solutions are needed in embedded designs. But, before that, what is RTOS anyway, especially when compared to bare metal solutions?

What

An RTOS is an operating system designed to manage hardware resources of an embedded system; it creates multiple threads of software execution and a scheduler for managing these threads. Another way to put it is a scheduling kernel that creates a multi-tasking and deterministic run-time environment.

Figure 1: A comparison between non-RTOS and RTOS executions. Image: Texas Instruments

The presence of a scheduler and the capability of assigning precise and reproducible time slots for the running tasks distinguishes RTOS solutions from embedded designs based on “bare metal” programming. That brings us to when embedded developers should make a switch from the bare-metal system to RTOS.

When

An RTOS is commonly used when there are more interrupt sources, more functions, and more communication interfaces. In short, it’s the application complexity that mostly decides the use of RTOS tailored for MCUs.

Another way to determine whether an RTOS is needed is to watch out one of the following design requirements: 1) TCP/IP or other complex networking stacks, 2) a complex GUI, or 3) a file system. Here, it’s worth mentioning that a design encompassing all three requirements will merit the use of a full-fledged operating system.

Figure 2: The block diagram of an embedded system design incorporating an RTOS. Image: GitHub

What an RTOS does here is suspend a task while giving higher priority to tasks with real-time requirements. Here, RTOS software, a collection of initialization routines, drivers, and utility functions, provides inter-thread synchronization mechanisms and software timer services.

How

Once an embedded developer decides to use an RTOS solution, the first thing to see is the amount of RAM and flash available in a microcontroller. An RTOS solution may require 6 KB to 10 KB of flash, so as a rule of thumb, the MCU should have around 32 KB of flash memory to ensure that there is ample space for the application code.

Likewise, 4 KB to 8 KB of RAM is advisable for supporting RTOS operations, given that each task has its own control block and stack. Many 32-bit MCUs set 2 KB of RAM per task or stack by default.

RTOS in the IoT era

The Internet of Things (IoT) bandwagon is accelerating the use of third-party software stacks, especially the TCP/IP and USB stacks that few developers want to write. And these third-party stacks and tools are often compatible with various RTOS solutions.

Moreover, popular RTOS solutions like Azure RTOS, Amazon FreeRTOS, and Segger’s embOS are being qualified for MCUs from large suppliers. This out-of-box integration is crucial in managing software complexity and lowering the barriers to entry for smaller embedded design outfits.

However, the use of RTOS also increases the overall system complexity and may introduce new types of bugs. So, developers must have adequate knowledge of how to implement RTOS-based programs effectively.

 

You may also like:

  • MCU-based hardware virtualization
    The fundamentals of MCU-based hardware virtualization

  • IoT MCUs will support Microsoft Azure RTOS
  • Segger Software libraries
    Software libraries support RA family of MCUs

  • Real-time vs. a standard operating system & How to choose…
  • Amazon FreeRTOS
    32-bit microcontroller family now supports Amazon FreeRTOS

Filed Under: Embedded, FAQ, Featured, RTOS Tagged With: FAQ

Reader Interactions

Comments

  1. Abdulrahman Nasser Alzhrani says

    January 10, 2020 at 4:17 pm

    That’s pretty nice! I’m still working with round robin sketch using time periods comparisons.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured Contributions

Five challenges for developing next-generation ADAS and autonomous vehicles

Securing IoT devices against quantum computing risks

RISC-V implementation strategies for certification of safety-critical systems

What’s new with Matter: how Matter 1.4 is reshaping interoperability and energy management

Edge AI: Revolutionizing real-time data processing and automation

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“bills
“microcontroller
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

DesignFast

Design Fast Logo
Component Selection Made Simple.

Try it Today
design fast globle

Footer

Microcontroller Tips

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

Microcontroller Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy