Lesson 15: Real-Time OS μC/OS-III

About μC/OS Real-Time Operating System

Micriμm's μC/OS (pronounced "Micro C O S") is a preemptive, highly portable, and scalable real-time kernel. μC/OS has three versions:

  • Portable
  • ROMable
  • Very Scalable
  • Preemptive Real-Time
  • Multitasking Kernel
  • Posted over 45 different CPU architecture
  • 6 KB ~ 24 KB RTOS Kernel
  • Can manage up to 250 application tasks
  • Provides the following services:
    • Semaphores
    • Event Flags
    • Mutual-exclusion semaphores
    • Message mailboxes and queues
    • Task management
    • Time management
    • Timer management
    • Fixed-sized memory block management
  • Included all features in μC/OS-II
  • Additional features:
    • Allows multiple tasks to run at the same priority level
    • Round Robin Scheduling of tasks at equal priority
    • Unlimited number of application tasks
    • Unlimited number of kernel objects
    • Unlimited number of priorities (32~256)
    • The low interrupt disable time (near 0)
    • Real-time configurable



μC/OS-II is provided in source form, and μC/OS-III is a linkable library for a FREE evaluation, educational use, or peaceful research. If you plan on using μC/OS-II or μC/OS-III in a commercial product, you need to contact Micriμm to properly license its use in your product.


Create μC/OS-III Project

  1. Create a new Project in PSoC Creator.
  2. Download RTOS_uCOS-III_V3.03.01.zip, and unzip it into the project folder.
  3. Add RTOS path into the Project
    • From the Project menu, select Build Setting...
    • Expand the tree under ARM GCC XXXX, and click Compiler
    • Add the following directories into the Additional Include Directories item:
      .\RTOS; .\RTOS\uC-CPU; .\RTOS\uC-CPU\ARM-Cortex-M3\GNU; .\RTOS\uC-LIB; .\RTOS\uCOS-III\Source; .\RTOS\uCOS-III\Ports\ARM-Cortex-M3\Generic\GNU; .\RTOS\PSoC5\BSP; .\RTOS\PSoC5\BSP\OS\uCOS-III

    addRTOSpath s
  4. Add RTOS Library to the Project
    • Expand the tree under ARM GCC XXXX, and click Linker
    • Add the following libraries to the Additional Libraries item:
      m; :uCOS-III-ARM-Cortex-M3.a
    • Add the following directory to the Additional Libraries Directories item:
    addRTOSlib s
  5. Create Folders and add RTOS files to your project
    • Right-click on the Project in the Workspace Explorer window, then type RTOS as the folder name.
    • Select Add ➤ New Folder. Add the following folders under the RTOS folder
    • Right-click on the RTOS folder just created, and select Add ➤ Existing Item. Add the following files into the folders as shown as blows:
  6. Copy and paste the content from RTOS_main.c into your main.c
  7. Modify or create the AppTask_xxx based on the project design
  8. Modify the App_TaskCreate() to create all tasks


Application Code